Windows Programming (IV)

Source: Internet
Author: User

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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.