Old 06-29-2014, 06:35 AM   #1
Lawrence
Human being with feelings
 
Join Date: Mar 2007
Posts: 21,551
Default Another Win Dev Question

You guys (you experienced dev guys here) know I always tug on your pants when I encounter a problem that I can't solve, so... here's my issue.

I'm trying to simulate a double click using Windows messaging and my Googling has been to date, unproductive. I spy on the application double click and the HITTEST I need to recreate is...
WM_NCHITTEST nHittest:HTCLIENT

...but no matter how I format the message my return always comes back as ...

WM_NCHITTEST nHittest:HTNOWHERE

My code string is ...

SendMessage(hWnd, WM_NCHITTEST, 1, SetCoord(X,Y))
... with the 1 being (supposedly) representative of HTCLIENT. What am I doing wrong there?

P.S. ... WM_LBUTTONDBLClICK doesn't work here which is why I'm trying to recreate the messages I see on Spy after a double click.

Here is what those messages look like in Spy++ with some of the intermediate message removed ...
<00226> 000102F6 S WM_NCHITTEST xPos:783 yPos:272
<00227> 000102F6 R WM_NCHITTEST nHittest:HTCLIENT
<00228> 000102F6 S WM_MOUSEACTIVATE hwndTopLevel:000102F6 nHittest:HTCLIENT uMsg:WM_LBUTTONDOWN

<00306> 000102F6 S WM_SETCURSOR hwnd:000102F6 nHittest:HTCLIENT wMouseMsg:WM_LBUTTONDOWN
<00307> 000102F6 R WM_SETCURSOR fHaltProcessing:True
<00308> 000102F6 P WM_LBUTTONDOWN fwKeys:MK_LBUTTON xPos:121 yPos:89
My code returns this in Spy++ ...
<00226> 000102F6 S WM_NCHITTEST xPos:783 yPos:272
<00227> 000102F6 R WM_NCHITTEST nHittest:HTNOWHERE
<00228> 000102F6 S WM_MOUSEACTIVATE hwndTopLevel:000102F6 nHittest:HTNOWHERE uMsg:WM_LBUTTONDOWN

<00306> 000102F6 S WM_SETCURSOR hwnd:000102F6 nHittest:HTNOWHERE wMouseMsg:WM_LBUTTONDOWN
<00307> 000102F6 R WM_SETCURSOR fHaltProcessing:True
<00308> 000102F6 P WM_LBUTTONDOWN fwKeys:MK_LBUTTON xPos:121 yPos:89
Thanks for helping the truly retarded.

Last edited by Lawrence; 06-29-2014 at 06:48 AM.
Lawrence is offline   Reply With Quote
Old 06-29-2014, 07:06 PM   #2
Amazed
Human being with feelings
 
Amazed's Avatar
 
Join Date: Nov 2009
Location: Perth, W.A.
Posts: 1,708
Default

Maybe this help ..

SetCursorPos(x,y);
// Click One
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
Sleep(10);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
Sleep(10);
// Click Two
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
Sleep(10);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
Amazed is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:28 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.