Onnclbuttonup cannot respond to messages

Source: Internet
Author: User

When onnclbuttondown is used to respond to a message, onnclbuttonup cannot respond to the clicked message, but double-click the message to respond.

I found some information on the Internet, saying that the window manager captured the mouse focus when processing onnclbuttondown, that is, the setcapture function was used. After capturing the mouse focus, the window will not send the wm_nclbuttonup message but will send the wm_lbuttonup message.

Solution:

 

Add the following code to your cxxdialog message processing function onsyscommand () (response to wm_syscommand:

Void cxxxdialog: onsyscommand (uint NID, lparam)
{
If (NID & 0xfff0) = idm_aboutdlg)
{
// Omit...
}
Else
{
// This is the original
Cdialog: onsyscommand (NID, lparam );

// Add the following two rows
If (NID & 0xfff0) = SC _move)
Postmessage (wm_nclbuttonup, NID, lparam );
}
}

After the DLG receives wm_nclbuttondown, the saved defwindowproc will send wm_syscommand, and some messages will be sent and processed when wm_syscommand is processed, so that wm_nclbuttonup will not be received, therefore, after wm_syscommand is returned, a wm_nclbuttonup

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.