[Original] About event

Source: Internet
Author: User

As we know, MFC, WPF, or any mature application development framework, they provide xx_click, xx_doubleclick for either whole view/form or any controls to let us easily add our event handler. but a fact shocould be known is that: all such events don't exist on Windows OS! The only primitive events related to mouse shocould be: lbutton_down, lbutton_up, rbutton_down, rbutton_up like. For example:

A left mouse click event shocould be composed of: lbutton_down + lbutton_click + lbutton_up.

B. Double Click Event shocould be composed of: lbutton_down + lbutton_up + lbutton_down + lbutton_doubleclick + lbutton_up

(Above is not that exact, just use it to perform strate the real world of Event)

Take the tricky application event handling for example (it may be a MFC application which internally uses managed code to fire and finally handle events ):

0. User click in the application window area.

1. MFC view will receive a lbutton_down + lbutton_click + lbutton_up event.

2. mycview will use its interopview which is written by C ++/CLI to get the Managed Application written by C # to fire the event to managed code:

Interopview-> application-> eventmanager-> firemouseevent ().

Note: As we can't receive MFC wrapped event like button_click, button_doubleclick while just primitive events, so we need to judge by ourselves whether it's a real click or double click.

 

 

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.