Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Cornwall, England
    Posts
    393
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to start an application from VB6

    Can anyone tell me which is the best way to launch an application from within a VB application please.
    I have so far always used the Shell command but am now aware of the API function WinExec. Are there circumstances where one is better than the other or should one be adopted as the norm ? <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to start an application from VB6

    Well, the *BEST* way is neither of those. <img src=/S/brainwash.gif border=0 alt=brainwash width=15 height=15>

    Look into:

    Public 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

    It's all I use to start web sites, apps, etc. Fast, reliabe, no mess, no fuss. I forget now why I abandoned Shell, but it didn't cut it for something I was doing.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Cornwall, England
    Posts
    393
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to start an application from VB6

    OK
    just learning about using api functions...
    what parameters need / should be sent to ShellExecute for what results. I guess you can get things to run in the back ground too? Can you get code processing to stop/wait until the application completes (like a batch file)?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •