|
-
Feb 2nd, 2005, 08:44 AM
#1
Thread Starter
Fanatic Member
Focus problem [RESOLVED]
In my program, in the Form_Unload event, I use shell to open another application, the problem is that the application open but stay in the taskbar. How can I give the focus to this application ?
Last edited by Gensor; Feb 2nd, 2005 at 09:08 AM.
-
Feb 2nd, 2005, 08:48 AM
#2
Use ShellExecute Instead Of Shell
VB Code:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Const SW_SHOWNORMAL = 1
Private Sub Command1_Click()
ShellExecute Me.hwnd, vbNullString, "YourFileName", vbNullString, "C:\", SW_SHOWNORMAL
End Sub
-
Feb 2nd, 2005, 09:05 AM
#3
-
Feb 2nd, 2005, 09:07 AM
#4
Thread Starter
Fanatic Member
Re: Focus problem
Thanks, it is working!
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
|