Windows Programming (III)

Source: Internet
Author: User

MFC has more than 200 packaging classes, but in MFC's internal technology is not just a simple package

MFC has a total of six key technologies within the framework of the entire MFC development platform

I. Six key technologies of MFC include:

a). Initialization process for MFC programs

b). Message mapping mechanism

c). Run-Time type identification (RTTI)

d). Dynamic creation

e). Permanent Save

f). Message delivery

The six key technologies are designed to improve development efficiency, and developers can handle most of the window's things simply by making simple changes locally.

Two. Functions of the SendMessage and PostMessage functions

a). Ability to send window messages to the specified window. Can be either in this process window or in other processes

b). Both system internal messages can be sent, the range of message numbers is: 1-wm_user-1)

Example: Wm_lbuttondown, wm_mousemove, etc.

c). Can also send non-system messages (developer-defined messages), the range number is: WM_USER-0X7FFF

D). Under MFC non-system message mapping, when using a macro definition On_message

Three. The difference between the SendMessage and PostMessage functions is:

a). SendMessage is a blocking function, and the PostMessage function is a non-blocking function

The SendMessage is used to invoke the internal program of the specified window until the window program finishes processing and returns

PostMessage is returned immediately after a message is sent to a message queue in a window

b). Two functions with different return values

Lresul SendMessage (HWND hwnd,uint msg,wparam wparam,lparam LPARAM);

BOOL PostMessage (HWND hwnd,uint msg,wparam wparam,lparam LPARAM);

The return value of the SendMessage is the numeric value produced by the message processing result, depending on the message handler function

The return value of the PostMessage is either a success or failure, and generally seldom fails unless the window does not exist

c). To send messages across threads or across processes, it is recommended to use the PostMessage function

Windows Programming (III)

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.