






















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!























LRESULT CALLBACK WindowProc
(
HWND hwnd, // handle to window UINT uMsg, // WM_COMMAND WPARAM wParam, // notification code and identifier LPARAM lParam // handle to control (HWND)
);
The wParam parameter of Window Procedure contains the notification code and control identifier.
Objectives of Child windows
application
Window management functions-II
HWND GetDlgItem ( HWND hDlg, // handle to dialog box int nIDDlgItem // control identifier );
HWND FindWindow
(
LPCTSTR lpClassName, // class name LPCTSTR lpWindowName // window name
);
wc.lpfnWndProc = popupWindowProc;
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wc.hCursor = LoadCursor(NULL, IDC_HELP);
wc.lpszClassName = "PopupWindowClass";
Creating windows
hWndMain = CreateWindow("MainWindowClass", "Virtual University", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 100, 100, 400, 300, NULL, NULL, hInstance, NULL);
hWndPopup = CreateWindow("PopupWindowClass", "Popup Window", WS_POPUP | WS_CAPTION | WS_VISIBLE, 250, 250, 300, 250, hWndMain, NULL, hInstance, NULL);
Main window’s WndProc
case WM_COMMAND: wControlID = LOWORD(wParam); wNotificationCode = HIWORD(wParam); if(wNotificationCode == BN_CLICKED) { switch(wControlID) { case 5: SendMessage(hWndPopup, ?, wparam, ???); break; ... ... ...
User defined messages
WINUSER.H contains Window messages
#define WM_LBUTTONDOWN 0x0201 (513) #define WM_DESTROY 0x0002 (2) #define WM_QUIT 0x0012 (18) #define WM_USER 0x0400 (1024)
#define WM_DRAW_FIGURE WM_USER+