Hi there,
Anyone knows how to make an application take focus?
Thanks!
Chicho
Printable View
Hi there,
Anyone knows how to make an application take focus?
Thanks!
Chicho
do you mean another application?
if so, try appactivate()
here's what the help file says:
This example illustrates various uses of the AppActivate statement to activate an application window. The Shell statements assume the applications are in the paths specified.
Dim MyAppID, ReturnValue
AppActivate "Microsoft Word" ' Activate Microsoft
' Word.
' AppActivate can also use the return value of the Shell function.
MyAppID = Shell("C:\WORD\WINWORD.EXE", 1) ' Run Microsoft Word.
AppActivate MyAppID ' Activate Microsoft
' Word.
' You can also use the return value of the Shell function.
ReturnValue = Shell("c:\EXCEL\EXCEL.EXE",1) ' Run Microsoft Excel.
AppActivate ReturnValue ' Activate Microsoft
' Excel.
Mark,
I meant my application.
I used appActivate and the application will start blinking
on the TaskBar is there any way I can make it show? Ive tried me.show but it wont worked;
Thanks!
Chicho
Try maximizing your application.
something like applicationname.maximize
Try using the SetForegroundWindow api function.
Code:Public Declare Function SetForegroundWindow _
Lib "user32" (ByVal hwnd As Long) As Long
Usage:
SetForegroundWindow Me.hwnd