dialog box common related message mapping functions:
First, the dialog initialization message:
1. wm_create: General window Initialization message
The window has not yet been displayed, only the parent window, the child window has not yet been created
2, Wm_initdialog: Dialog window Special message
Child windows are all created and can be called and manipulated.
Second, the dialog box closes the process message:
1. Wm_syscommand: Manage system Menu and System button messages
including maximizing, minimizing, moving, resizing, and closing
2, Wm_close: is a dedicated closed branch of the WM_SYSCOMMAND message
This shutdown task can be canceled during this message processing
3, idcancel button message: Not only for the button callback message, is also the system button to close the window callback execution really close the dialog function EndDialog, this message processing can cancel this shutdown task
4, Wm_destroy: Universal window Destruction Message
The window has disappeared from the screen, but the controls within its own window and window can also be called
This shutdown task can be canceled during this message processing
Second, non-modal dialog box
1, when the call EndDialog function is closed, the Non-modal dialog box is only hidden and not really closed;
2, when the call DestroyWindow function closed, just hide not really close;
3. The DestroyWindow function is a function of the universal window, suitable for dialog boxes, controls, frames, views, etc.
Third, CWnd member functions
1, DestroyWindow
2. Create and CreateEx
3. Get the Window handle
A) pwnd->m_hwnd; It's better to judge if the pointer is empty before calling it directly.
b) operator HWND (); Automatic type conversion, converting an object to a handle
c) GetSafeHwnd (); A method that can be avoided because the pointer is empty causing the software to crash
Four, window operation
a) ShowWindow; Change window display status, including Maximize, minimize, hide, and more
b) EnableWindow; Activating or disabling a window
c) MoveWindow; Move the window (the parent window is based on the coordinate system for the screen coordinate system, if the child window coordinate system is the parent window client area)
d) CenterWindow; Center window
e) SetWindowPos; Can simultaneously modify the x, Y, Z axis of the window, often used for the development of front-end display function
Windows Programming (iv)