solved  Trying to simulate a double click but turns out different function

jcylam (104)   Link to this post
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
void Double_click (LONG pGT_X, LONG pGT_Y)
{
	DWORD GTEvent;

	for (int j = 0; j < 2; j++)
	{
		GTEvent = MOUSEEVENTF_LEFTDOWN;

		mouse_event (GTEvent, pGT_X, pGT_Y, 0, 0);

//Return status of mouse click to normal		
		Sleep (100);
		GTEvent = MOUSEEVENTF_LEFTUP;	//simulate left click up
	}
	
}


is it the sleep timer not long enough?
Dissimulation (6)   Link to this post
mouse_event (GTEvent, pGT_X, pGT_Y, 0, 0);
if that executes the "GTEvent" then you would need to run it again after line 13. right?
Grey Wolf (1607)   Link to this post
1
2
3
4
5
6
7
void Double_click (LONG pGT_X, LONG pGT_Y)
{
    mouse_event (MOUSEEVENTF_LEFTDOWN, pGT_X, pGT_Y, 0, 0);
    mouse_event (MOUSEEVENTF_LEFTUP, pGT_X, pGT_Y, 0, 0);
    mouse_event (MOUSEEVENTF_LEFTDOWN, pGT_X, pGT_Y, 0, 0);
    mouse_event (MOUSEEVENTF_LEFTUP, pGT_X, pGT_Y, 0, 0);		
}
jcylam (104)   Link to this post
its in a "for" loop that runs 2 times, but my result is that it clicks and holds. ie i can select and drag to another location instead of opening the folder or program.
firedraco (2609)   Link to this post
You aren't simulating a MOUSEEVENTF_LEFTUP.
jcylam (104)   Link to this post
ohhhhh. i missed it ... oops

thx

This topic is archived - New replies not allowed.