sendinput API to background process ?
sendinput API to background process ?
sendinput API to background process ?
sendinput API to background process ?
sendinput API to background process ?
sendinput API to background process ? sendinput API to background process ? sendinput API to background process ? sendinput API to background process ? sendinput API to background process ? sendinput API to background process ? sendinput API to background process ? sendinput API to background process ?
sendinput API to background process ? sendinput API to background process ?
sendinput API to background process ?
Go Back  Xtreme Visual Basic Talk > > > sendinput API to background process ?


Reply
 
Thread Tools Display Modes
  #1  
Old 09-17-2011, 08:29 AM
bobsmith bobsmith is offline
Newcomer
 
Join Date: Sep 2011
Posts: 10
Question sendinput API to background process ?


Hey everyone ,

I'm using sendinput to send keystrokes to external applications launched from my main application. However , the only way I have been able to get it to work is by focusing the external application then sending input. I want to know how to use sendinput to send keys to a background process without giving it focus. Anyone have any examples ? Thanks for any help.
Reply With Quote
  #2  
Old 09-17-2011, 09:31 AM
AtmaWeapon's Avatar
AtmaWeaponsendinput API to background process ? AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,500
Default

You can't. It's a security feature of Windows that only the foreground window has keyboard focus. Otherwise I could write an application that logs keys, detects when you've logged in to a website, then uses a hidden IE window to do all manner of bad things without the user's knowledge.

The closest you can come only works if you're writing the app you want to receive keystrokes in the background. To make a long story short, the hotkey API more or less lets you sign up for "raise this event whenever a user presses one specific key".

It's really strange to need to send keys to a hidden application. Generally the kind of application intended for automation like that has an automation API. Maybe this is the case for you?
__________________
.NET Resources
My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
sendinput API to background process ?
sendinput API to background process ?
sendinput API to background process ? sendinput API to background process ?
sendinput API to background process ?
sendinput API to background process ?
sendinput API to background process ? sendinput API to background process ? sendinput API to background process ? sendinput API to background process ? sendinput API to background process ? sendinput API to background process ? sendinput API to background process ?
sendinput API to background process ?
sendinput API to background process ?
 
sendinput API to background process ?
sendinput API to background process ?
 
-->