|
-
Feb 22nd, 2000, 03:55 AM
#1
Thread Starter
Hyperactive Member
I'm using Sendkeys to send foreign characters to MS Word Eg:
Private Sub cmdj_Click()
AppActivate "Microsoft Word"
SendKeys Chr$(251), True
End Sub
But what I really want is for this to work with any Win 9x/NT app that happens to be open NOT just MS Word.
Any ideas anyone 
Simon
-
Feb 22nd, 2000, 06:04 AM
#2
Frenzied Member
Well, just pass the title of the window you want to send the keys to!
To get the title, use GetWindowText function to get the title bar text. You need to know the window's handle for this. If you don't know the handle, use EnumWindows to get handles of all top-level windows. You can then either SendKeys to each window using a loop, or search for a particular class or title of window, or use GetForegroundWindow function to send the keys to the window the user is currently working with.
Hope this helped a little.
Go to:
http://www.vbapi.com/ref/funcc.html#windowclasses
for details on most common APIs dealing with windows.
~seaweed
-
Mar 31st, 2000, 01:12 AM
#3
Lively Member
I've been working on this hopelessly for weeks now ;(
Does anyone have any code that will do what seaweed suggest - particularly using the GetForegroudWindow function.
Basically, I suppose I need a variable that I can replace "Microsoft Word" with.
Eg:
Private Sub cmdj_Click()
AppActivate currentforegroundapp
SendKeys Chr$(251), True
End Sub
Hope someone can help
Simon
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|