Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SendInput

Status
Not open for further replies.

tokool

Programmer
Nov 6, 2001
40
0
0
US
i am trying to send keyboard messages and mouse events to a client application(eg:acrobat.exe) that i opend from my program. I used CreateProcess to open the client application.
To simulate mouse clicks and keyboard events on the client application window, i use the SendInput function.
//***********************************************
INPUT input[1];
memset(input, 0, sizeof(INPUT));
input[0].type = INPUT_KEYBOARD;
input[0].ki.wVk = 68;
input[0].ki.dwFlags = KEYEVENTF_KEYUP;
input[0].ki.time = GetTickCount();
SendInput(1, input, sizeof(INPUT));
//***********************************************

i have included windows.h and am using VC++ on WIN2K server.
When i complie the program i get the below error.
error C2065: 'INPUT' : undeclared identifier
error C2065: 'input' : undeclared identifier
error C2065: 'INPUT_KEYBOARD' : undeclared identifier
.
.
.
error C2065: 'SendInput' : undeclared identifier

I have user32.lib in the link setting of VC++. Why is this problem throwing up. i even opend the winuser.h file to check if the structures and functions are present, and i found them there..
Im stumped, could somebody throw some light on my problem.
Thanks,
Preetham.
 
Have you included winuser.h AND windows.h?...(sorry just gotta check)...
What ver of VC++ have you??
 
If building on a win 2000 platform, try re-defining _WIN32_WINNT.

For example, in StdAfh.h, or some other included file:

#define _WIN32_WINNT 0x0500

This should fix it.

Hope this works for you!

Todd
tbehr01@yahoo.com
 
Did you solve the problem? if yes, tell me the solution.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top