Solved

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

Posted on 2004-05-01
5
366 Views
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 :)
0
Comment
Question by:QuantumJimbo
5 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 400 total points
ID: 10970380
See SendInput and keybd_event API.
0
 
LVL 2

Expert Comment

by:enkimute
ID: 10970765
I would sujest using the clipboard instead ..
0
 
LVL 8

Assisted Solution

by:plq
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.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/userinput/keyboardinput/keyboardinputreference/keyboardinputmessages/wm_keyup.asp
0
 
LVL 2

Expert Comment

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

Author Comment

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

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
no14 challenge 14 67
bigHeights  challenge 13 62
Problem to event 3 96
recursion example 16 126
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…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.

772 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