WM_SYSCOMMAND SC_MOVE eats up mouse events and mouse up is not fired
"tommy_h_tam" <[email protected]> Thu, 16 Aug 2012 03:13:44 -0000
| Newsgroups | gmane.comp.windows.wtl |
|---|---|
| Message-ID | <[email protected]> |
My program is a chromeless window and I want to move the window when
user drag any part of my dialog. Once WM_SYSCOMMAND is used, all
subsequent mouse events are lost.
First I wrote a program to capture the mouse events and all working fine
with WTL.
BEGIN_MSG_MAP(CMainDlg) MSG_WM_LBUTTONUP(OnMouseUp)
MSG_WM_LBUTTONDOWN(OnMouseDown) .... LRESULT OnMouseDown ( UINT uKeys,
CPoint pt ) { print ("on mouse down"); return 0; } LRESULT
OnMouseUp ( UINT uKeys, CPoint pt ) { print ("on mouse up");
return 0; }
Then I change onMouseDown above to,
LRESULT OnMouseDown ( UINT uKeys, CPoint pt ) { print ("on mouse
down"); this->SendMessageW(WM_SYSCOMMAND, SC_MOVE|0x0002);
return 0; }
The drag is working and the windows move along with the mouse. However,
OnMouseUp event is no longer fired.
Tried many different approach using WM_NCHITTEST, or ProcessMessage
setHandled to true/false without success.
Much appreciate if anyone has any suggestions [Smile | :)]
[Non-text portions of this message have been removed]
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/wtl/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/wtl/join
(Yahoo! ID required)
<*> To change settings via email:
[email protected]
[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/