?
Solved

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

Posted on 2004-05-01
5
Medium Priority
?
388 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 1200 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 300 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

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…
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

752 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