S
S
sddvxd2019-03-05 12:03:53
Windows
sddvxd, 2019-03-05 12:03:53

How to simulate double click with winapi?

Good afternoon
There was a task - to remotely send a double click on the desktop. I figured out how to set the coordinates of the cursor, but I don’t quite understand about it in which direction to dig. Tell me please

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sddvxd, 2019-03-07
@sddvxd

INPUT input[2]{0};

    input[0].type = INPUT_MOUSE;
    input[0].mi.dwFlags = MOUSEEVENTF_LEFTDOWN;

    input[1].type = INPUT_MOUSE;
    input[1].mi.dwFlags = MOUSEEVENTF_LEFTUP;

    while(1){
        for(int i = 0; i < 2; ++i)
            SendInput(2, input, sizeof(INPUT));
        Sleep(1000);
    }

R
Radjah, 2019-03-05
@Radjah

Something like that in theory.
SendMessage function https://docs.microsoft.com/en-us/windows/desktop/a...
Message WM_LBUTTONDBLCLK https://docs.microsoft.com/en-us/windows/desktop/i...
Other https ://docs.microsoft.com/en-us/windows/desktop/i...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question