DLL/API that allows you to output "from the keyboard"?

Does anyone here know of a DLL with a command or a Windows API that lets you output text to whatever the active program is, giving the illusion that the text is coming from the keyboard. I'm trying to write a program (in BBC Basic for Windows) that outputs the currently playing song from winamp to any program :)
QuantumJimboAsked:
Who is Participating?
 
AlexFMCommented:
See SendInput and keybd_event API.
0
 
enkimuteCommented:
I would sujest using the clipboard instead ..
0
 
plqCommented:
Get the HWND of the running program, using findwindow or getmodulehandle etc etc.

Then send it WM_KEYDOWN and WM_KEYUP messages using sendmessage or postmessage.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/userinput/keyboardinput/keyboardinputreference/keyboardinputmessages/wm_keyup.asp
0
 
enkimuteCommented:
hmm that's not gonna do it for all apps .. some respond on WM_CHAR ..
0
 
QuantumJimboAuthor Commented:
Thanks folks!
keybd_event worked, but the website plq gave told me the syntax on another page.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.