Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Smulating Mouse Double Click via sending message , problem

2,103 views
Skip to first unread message

Ebadat A.R.

unread,
Oct 30, 2001, 5:00:17 PM10/30/01
to
Dear Friend,
I want to simulate mouse double click in windows. First of all, I try it on
my RichEdit component (in my program). I uses the following command to
sending double click message to windows shell:

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.


Yorai Aminov (TeamB)

unread,
Oct 30, 2001, 12:37:03 PM10/30/01
to
On Tue, 30 Oct 2001 14:00:17 -0800, "Ebadat A.R." <are...@yahoo.com>
wrote:

>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.)

Charles Hacker

unread,
Oct 30, 2001, 6:10:58 PM10/30/01
to
"Ebadat A.R." wrote:
>
> I want to simulate mouse double click in windows. First of all, I try it on
> my RichEdit component (in my program). I uses the following command to
> sending double click message to windows shell:

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

0 new messages