Results 1 to 4 of 4

Thread: open EXE files

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2000
    Posts
    37
    How can I have my app open an EXE file?

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    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

  3. #3
    Guest
    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.

  4. #4
    Guest
    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
  •  



Click Here to Expand Forum to Full Width