Trying to simulate a double click but turns out different function

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?
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?
closed account (z05DSL3A)
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);		
}
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.
You aren't simulating a MOUSEEVENTF_LEFTUP.
ohhhhh. i missed it ... oops

thx
Topic archived. No new replies allowed.