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
|
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK WndProc2(HWND, UINT, WPARAM, LPARAM);
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow )
{
MSG msg ;
WNDCLASS wc = {0};
wc.lpszClassName = TEXT( "Menu 1" );
wc.hInstance = hInstance ;
wc.hbrBackground = GetSysColorBrush(COLOR_3DFACE);
wc.lpfnWndProc = WndProc ;
wc.hCursor = LoadCursor(0, IDC_ARROW);
RegisterClass(&wc);
CreateWindow( wc.lpszClassName, TEXT("Menu 1"),
WS_OVERLAPPEDWINDOW | WS_VISIBLE,
550, 150, 270, 350, 0, 0, hInstance, 0);
while( GetMessage(&msg, NULL, 0, 0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return (int) msg.wParam;
MSG msg1 ;
WNDCLASS wc1 = {0};
wc1.lpszClassName = TEXT( "Menu 2" );
wc1.hInstance = hInstance ;
wc1.hbrBackground = GetSysColorBrush(COLOR_3DFACE);
wc1.lpfnWndProc = WndProc ;
wc1.hCursor = LoadCursor(0, IDC_ARROW);
RegisterClass(&wc1);
CreateWindow( wc1.lpszClassName, TEXT("Menu 2"),
WS_OVERLAPPEDWINDOW | WS_VISIBLE,
550, 150, 300, 350, 0, 0, hInstance, 0);
while( GetMessage(&msg1, NULL, 0, 0)) {
TranslateMessage(&msg1);
DispatchMessage(&msg1);
}
return (int) msg1.wParam;
}
|