GetCursorPos(MyPoint);
SendMessage(MyHwnd, WM_LBUTTONDOWN, MK_LBUTTON , MakeLParam(
MyPoint.x, MyPoint.y ));
SendMessage(MyHwnd, WM_LBUTTONUP, MK_LBUTTON , MakeLParam(
MyPoint.x, MyPoint.y ));
SendMessage(MyHwnd, WM_LBUTTONDBLCLK, MK_LBUTTON , MakeLParam(
MyPoint.x, MyPoint.y ));
SendMessage(MyHwnd, WM_LBUTTONUP, MK_LBUTTON , MakeLParam(
MyPoint.x, MyPoint.y ));
I read before that , these message with this order will simulate double
click in windows. First for windows which have mouse event , second for
windows bellow mouse cursor and finally for windows shell. But I think , I
have mistake in my sending message. I want to simulate mouse double click
to select text bellow mouse . Please tell me how can I simulate double click
by sending message or other ways.
Thank you ,
Ebadat A.R.
>I want to simulate mouse double click in windows.
Use the mouse_event function to simulate to clicks (left button down,
up, down, and up again). Make sure to position the mouse cursor
accordingly first (using SetCursorPos).
---
Yorai Aminov (TeamB)
(TeamB cannot answer questions received via email.)
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);
--
Charles Hacker
Lecturer in Electronics and Computing
School of Engineering
Griffith University - Gold Coast
Australia