|
-
Oct 22nd, 2003, 05:30 PM
#1
Thread Starter
Fanatic Member
Pass Text To Any App
I want to sent text (using one button in VB) to any app that the app text box had the last focus.
I have already figured out how to find the app. But I can not get text to the app on a consistant basis.
I have Sendkeys working "^ & Chr(118)"
But it does not always work, especially in Word97.
Any help would be appreciated!
Thanks
ePixelman
-
Oct 22nd, 2003, 11:14 PM
#2
Fanatic Member
First off I would like for you to share with me how you find the app ... I always thought sendkeys worked on the app and textbox currently in focus.
Which could explain why yours dosn't work consistantly .. if what I just said is true maybe your app isn't in focus sometimes and thus the reason it dosn't work.
-
Oct 22nd, 2003, 11:19 PM
#3
To set focus to it, you can use the AppActivate method (or a mess of API's if you really wanted to ). MSDN has good info on it (http://msdn.microsoft.com/vbasic/).
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
-
Oct 23rd, 2003, 05:39 AM
#4
Thread Starter
Fanatic Member
StevenHickerson,
I simply use a "Task Manager" type routine. Except my routine finds the app that is on top of zorder and takes the title name of the app.
It finds the window title, and the app stays the active app, but does not always recieve the sendkeys or something.
This is how is goes...
My VB form is topmost but hidden from the "TaskSwitch" routine.
I click a "Pass Text" button on my VB form. It first finds the app that is topmost (Say Word97) then copies text from a RTF box then it Sendkeys to app (say Word97)
Thanks
Last edited by epixelman; Oct 23rd, 2003 at 05:51 AM.
-
Oct 23rd, 2003, 08:01 PM
#5
Try putting a DoEvents after the 'task switch' routine and before the SendKeys statement. If that doesn't work, post your code and we'll see what we can do with it.
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
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
|