Auto-write words in a form

Hello,

I'm trying to code a program in Dev-C++ for auto complete text in a web form.
I'm using windows.h and mouse_event() function for move cursor position and click buttons, but I need write in a inputs/textarea a text.

How can i do this? Some example?
Thanks.

PD: I don't want use any lib for send a POST data to the form.
This sounds a bit questionable. Anyways you could try sending input. http://msdn.microsoft.com/en-us/library/ms646310%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/ms646304(v=vs.85).aspx

I would also suggest moving it to the "Windows Programming."

giblit: Thanks, but my code dosn't work :(
I'm trying to move the mouse cursor, click a txt file minimized and write 'A' in the txt.
The program output move the cursor and click/open the txt but don't write 'A' key in a txt ....why?


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
int main(int argc, char *argv[])
{
    int x, y;
    
    x = 590;
    y = 710;
    
    SetCursorPos(x,y);
    Sleep(500);

    mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0);
    mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0);
    
    keybd_event(VkKeyScan('A'),0x41,0 , 0);
                      
    
    system("PAUSE");
    return EXIT_SUCCESS;
}


edited: the correct form is:
keybd_event(VkKeyScan('a'),0,0,0);
Last edited on
Topic archived. No new replies allowed.