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.

Recommended Answers

All 7 Replies

What operating system?

What operating system?

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

Clicky.

thanks man!

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

Are you properly linking with the User32 library?

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.