|
-
Feb 10th, 2000, 01:21 PM
#1
Thread Starter
Addicted Member
How do I make a 3rd party program get the focus?
I think it has something to do with "AppActivate" or something like this. An example would be appreciated, thanks.
Daniel_Christie
[This message has been edited by Daniel_Christie (edited 02-11-2000).]
-
Feb 10th, 2000, 01:33 PM
#2
Try the SetForegroundWindow API, ie.
Code:
Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
Private Sub Command1_Click()
Call SetForegroundWindow(lHwnd)
End Sub
Where lHwnd is the Window Handle of the Application you want to give Focus.
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
Certified AllExperts Expert
-
Feb 10th, 2000, 05:41 PM
#3
Frenzied Member
Or you can use
AppActivate "title",TRUE
eg;
AppActivate "Microsoft Word",TRUE
The TRUE bit means that your program has to have the focus in order to be able to activate the other program - if you make it FALSE your program can activate the other program even when it hasn't got the focus.
------------------
Mark "Buzby" Beeton
VB Developer
[email protected]
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
|