You need to know about the easy-to-dust interface library.

Source: Internet
Author: User
Article Blog http://www.extgui.com/post/edust_message_learn.html from the land 1. Hook menu events The hook command event and menu selection event are collectively referred to as the hook menu event. These messages are sent through wm_command. For example, if a button is clicked, a menu item is clicked. 2. Any window message of a hook event can be handled by a hook event. For example, wm_size is changed, and wm_painting is disabled by wm_close. 3. Mount component events Some components have their own scaling events, such as "select change" in the selection box. In early windows, notification events were also sent through wm_command. However, wm_command cannot meet the requirements. Therefore, some notification events are sent through the wm_notify message. Both types of events are handled by attaching a notification event. 4. Rolling events Currently, this event is unique to the scroll bar and slider bar. You can also handle the event wm_hscroll wm_vscroll. Of course, mounting a rolling event or mounting event certainly does not conform to the object-oriented design philosophy. You can also inherit a class and overwrite the rolling event () method for processing. (Figure 1) rolling event Method prototype 5. event processing sequence. You can attach multiple handlers to the same event. Program . The call sequence is followed by the first call of the link. If an event is to be ignored and is not first attached with a processing subroutine, you can use event. Skip () to ignore it. The Return Value of the event function is logical. If the return value is true, the event is sent to the window processing process. If the return value is false, the message does not need to be processed by the default window process. 6. Message filtering. Any message belonging to the component has the highest priority to process it. This processing method is implemented in the message preprocessing () of the object. If you want to prioritize the processing of messages belonging to the component itself, the best solution is to do this in message preprocessing. When the system obtains a message from the message queue, it first determines which component or window it belongs to, and then calls its message preprocessing () method, if this method returns false, the message does not need to be distributed. If the returned message is true, it calls the message preprocessing () method of the parent window of the event component until the message is processed. If you need to filter queue messages, this is the highest priority. Of course, some non-queue messages cannot be processed here. For example, wm_paint. Windows to improve the drawing efficiency of windows. For wm_paint and so on, the window process is directly called instead of passing through the message queue. You can inherit a window and overwrite the message process () for filtering. (Figure 2) prototype of message Preprocessing Method

 

 

(Figure 3) prototype of the message process method

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.