Solved

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

Posted on 2004-05-01
5
357 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
ShiftLeft challenge 21 66
seriesUp challenge 7 107
java continue statement 10 73
Non-recursive backtracking, using a stack 1 49
Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

705 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

18 Experts available now in Live!

Get 1:1 Help Now