![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Dec 2007
Posts: 8
Rep Power: 0
![]() |
Sending keys to a process?
I was wondering if there was anyway to send keys to a process.
For example: Press a hot key and it types something in NotePad.exe with notepad being minimized. Is there any way to do that? Thanks in advance. |
|
|
|
|
|
#2 |
|
Expert Programmer
|
Re: Sending keys to a process?
research "Sendkeys". It's built into the .NET framework, but for vb6 you'll have to make some API calls if I remember correctly.
|
|
|
|
|
|
#3 |
|
Professional Programmer
Join Date: Mar 2005
Location: Glasgow, Scotland
Posts: 317
Rep Power: 4
![]() |
Re: Sending keys to a process?
SendKeys is accessible via the WScript.Shell object too; so in VBScript you can do:
Dim objSH
Set objSH = CreateObject("WScript.Shell")The most interesting methods will be AppActivate (if I remember correctly) and SendKeys. I've never actually used this in VB6, but I'd guess you add a reference and that lets you create an instance of WScript.Shell to use. Edit: just checked; yup, it's AppActivate. Googling for the method names will help.
__________________
"I'm not a genius. Why do I have to suffer?" Last edited by mackenga; Dec 31st, 2007 at 9:24 AM. Reason: Tried out to confirm it worked |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| child process - chdir and execXX | programmingnoob | C | 3 | Feb 6th, 2007 3:08 PM |
| Suspending another process in win32 | coder0xff | C++ | 4 | May 28th, 2006 11:33 AM |
| Process injection | jayme | C++ | 3 | Jan 28th, 2006 6:05 AM |
| Forking process using python/Writing daemons | thinkgeek | Python | 5 | Jul 5th, 2005 11:46 AM |
| Sending a web form as parameter | see07 | C# | 4 | Mar 24th, 2005 9:25 PM |