I am new to C, hope someone could help me here.

I need to implement a keystroke, for example, i need to programatically implement the 'return key'.

As in if someone is pressing the 'return key' from the keyboard. but here, the user will not even touch the keyboard. the return key will be automatically executed by the code. How do i write the code for this. i have spent days googling this but i failed finding a solution. can someone please tell me how this could be implemented.

What operating system?

I am using Windows Vista, the IDE is Visual Studio 2008, and visual C++ project.

Clicky .

hello again, it works in a console application, but i want to create a DLL out of my class so i creates a basic library application and i get the following error; any clue

1>testapp.obj : error LNK2028: unresolved token (0A000299) "extern "C" void __stdcall keybd_event(unsigned char,unsigned char,unsigned long,unsigned long)" (?keybd_event@@$$J216YGXEEKK@Z) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
1>testapp.obj : error LNK2019: unresolved external symbol "extern "C" void __stdcall keybd_event(unsigned char,unsigned char,unsigned long,unsigned long)" (?keybd_event@@$$J216YGXEEKK@Z) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
1>C:\Users\Admin\Documents\Visual Studio 2008\Projects\detect\Debug\detect.dll : fatal error LNK1120: 2 unresolved externals

Edited 5 Years Ago by localp: n/a

Are you properly linking with the User32 library?

What did you mean by that, i am new to C, and MS visual studio. :(


Answering to your question i found out that user32.lib, is in the project under additional dependencies.

Edited 5 Years Ago by localp: n/a

This article has been dead for over six months. Start a new discussion instead.