-
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).]
-
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
-
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]