ش | ی | د | س | چ | پ | ج |
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 |
The following example has three menu items and moves the check mark of the menu item each time the menu is opened.
Public Function WndProc (HWND hWnd, UINT iMessage
( WPARAM wParam, LPARAM lParam,
HDC hdc
PAINTSTRUCT ps
static int count = 0
Mes="Checks menu items in order every time the menu is
" opened
Select Case iMessage
case WM_INITMENU
CheckMenuItem (HMENU) wParam
(IDM_MENU1,MF_BYCOMMAND | MF_UNCHECKED ,
,CheckMenuItem (HMENU) wParam, IDM_MENU2,m
( MF_BYCOMMAND | MF_UNCHECKED
CheckMenuItem ((HMENU) wParam, IDM_MENU3, MF_BYCOMMAND | MF_UNCHECKED)
count = (count +1)% 3
CheckMenuItem (HMENU) wParam, IDM_MENU1 + count, MF_BYCOMMAND | MF_CHECKED)
Wndproc=False
case WM_PAINT
(hdc = BeginPaint (hWnd, ps
(TextOut hdc, 10, 10, Mes,len(Mes
(EndPaint (hWnd,ps
WndProc=False
case WM_DESTROY
PostQuitMessage (0
WndProc=False
Case Else
(Wndproc=DefWindowProc (hWnd, iMessage, wParm,lParam
End Select
Exit Function