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

Posted on 2004-05-01
Last Modified: 2006-11-17
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 :)
Question by:QuantumJimbo
LVL 48

Accepted Solution

AlexFM earned 400 total points
ID: 10970380
See SendInput and keybd_event API.

Expert Comment

ID: 10970765
I would sujest using the clipboard instead ..

Assisted Solution

plq earned 100 total points
ID: 10971616
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.

Expert Comment

ID: 10971718
hmm that's not gonna do it for all apps .. some respond on WM_CHAR ..

Author Comment

ID: 10973483
Thanks folks!
keybd_event worked, but the website plq gave told me the syntax on another page.

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
debug as  junit test 4 73
centeredAverage challenge 8 130
sumDigits  challenge 7 74
Advice in Xamarin 21 48
Navigation is an important part of web design from a usability perspective. But it is often a pain when it comes to a developer’s perspective. By navigation, it often means menuing. This is less theory and more practical of how to get a specific gro…
There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now