-
Notifications
You must be signed in to change notification settings - Fork 0
/
menu.cpp
57 lines (41 loc) · 1.08 KB
/
menu.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include "menu.h"
// ???????? "????????" ????? ????
void checkMenu(HWND hwnd, int item) {
HMENU hMenu = GetMenu(hwnd);
switch (item) {
case LAYOUT: {
CheckMenuItem(hMenu, IDM_LAYOUT, MF_CHECKED);
CheckMenuItem(hMenu, IDM_NON_LAYOUT, MF_UNCHECKED);
break;
}
case NON_LAYOUT: {
CheckMenuItem(hMenu, IDM_NON_LAYOUT, MF_CHECKED);
CheckMenuItem(hMenu, IDM_LAYOUT, MF_UNCHECKED);
break;
}
default: {
CheckMenuItem(hMenu, item, MF_CHECKED);
}
}
SendMessage(hwnd, WM_SIZE, 0L, 0L);
}
// ??????? ??????????? ???????????? ????? ????
void disableMenu(HWND hwnd, int item) {
HMENU hMenu = GetMenu(hwnd);
switch (item) {
case IDM_OPEN: {
EnableMenuItem(hMenu, IDM_OPEN, MF_DISABLED);
EnableMenuItem(hMenu, IDM_CLOSE, MF_ENABLED);
break;
}
case IDM_CLOSE: {
EnableMenuItem(hMenu, IDM_OPEN, MF_ENABLED);
EnableMenuItem(hMenu, IDM_CLOSE, MF_DISABLED);
break;
}
default: {
EnableMenuItem(hMenu, item, MF_DISABLED);
}
}
SendMessage(hwnd, WM_SIZE, 0L, 0L);
}