|
-
Oct 16th, 2000, 03:50 PM
#1
Thread Starter
Member
How can I have my app open an EXE file?
-
Oct 16th, 2000, 03:56 PM
#2
_______
<?>
You can have it run a file using Shell
'
'using Shell
Shell ("C:\myApp.exe")
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Oct 16th, 2000, 04:01 PM
#3
That will load it, but not always give it focus.
Code:
Shell "App.exe", vbNormalFocus
And the constants are:
Code:
vbHide
0
Window is hidden and focus is passed to the hidden window.
vbNormalFocus
1
Window has focus and is restored to its original size and position.
vbMinimizedFocus
2
Window is displayed as an icon with focus.
vbMaximizedFocus
3
Window is maximized with focus.
vbNormalNoFocus
4
Window is restored to its most recent size and position. The currently active window remains active.
vbMinimizedNoFocus
6
Window is displayed as an icon. The currently active window remains active.
-
Oct 16th, 2000, 04:22 PM
#4
Better yet, there is an api function that is better than the Shell function called ShellExecute. Use it .
Code:
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
Public Const SW_SHOWNORMAL = 1
Public Const SW_ShowMinimized = 2
Public Const SW_SHOWMAXIMIZED = 3
Public Const SW_Hide = 0
Public Const SW_MAX = 10
Public Const SW_MAXIMIZE = 3
Public Const SW_MINIMIZE = 6
Public Const SW_NORMAL = 1
ShellExecute Me.hwnd, vbNullString, "C:\file.exe", _
vbNullString, "c:\", SW_SHOWNORMAL
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
|