Results 1 to 2 of 2

Thread: Problems with 'Shell'

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 1999
    Posts
    26

    Post

    I have a small programme used as a launch for a number of other programmes. Mostly it works fine starting the programmes with
    Shell "c:\progpath\progname.exe", 1
    But one programme fails to start properly.
    It starts OK from 'Start programmes ..', from Windows Explorer and from the DOS prompt.
    I have checked starting using
    retval = Shell("c:\progpath\progname.exe", 1)
    if retval=0 etc
    no obvious problem.

    Anyone any ideas please

    Peter Brown

  2. #2
    Addicted Member
    Join Date
    May 1999
    Location
    Californ-I- A
    Posts
    207

    Post

    I'd look into using the ShellExcecute API.

    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_HIDE = 0
    Public Const SW_MAX = 10
    Public Const SW_MAXIMIZE = 3
    Public Const SW_MINIMIZE = 6
    Public Const SW_NORMAL = 1
    Public Const SW_SHOW = 5
    Public Const SW_SHOWDEFAULT = 10
    Public Const SW_SHOWMAXIMIZED = 3
    Public Const SW_SHOWMINIMIZED = 2
    Public Const SW_SHOWNORMAL = 1

    Dim lResult as long
    lResult = ShellExecute(hwnd, "Open", "C:\Program Files\MyProg\Program.exe", 0&,0&, SW_SHOWNORMAL)

    I don't know why, But I always find that to work more consitantly than just shell.


    ------------------
    Micah Carrick
    http://micah.carrick.com
    [email protected]
    ICQ: 53480225


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