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