CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    Join Date
    Dec 2007
    Location
    Australia
    Posts
    151

    Start a process?

    How do I start a process?

    Cheers

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Start a process?

    See CreateProcess function in Msdn.

  3. #3
    Join Date
    Dec 2007
    Location
    Australia
    Posts
    151

    Re: Start a process?

    Thanks

  4. #4
    Join Date
    Apr 2008
    Posts
    111

    Re: Start a process?

    You can also use the CreateProcessEx function..

  5. #5
    Join Date
    Jan 2005
    Location
    germany
    Posts
    160

    Re: Start a process?

    MS preferes developers to use

    ShellExecute / ShellExecuteEx

    The advantage is, that you can make use of AppPaths registration and similar services of the Shell.

    regards
    HoM

  6. #6
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Start a process?

    Where do you find it documented that MS prefer this?

  7. #7
    Join Date
    Jan 2005
    Location
    germany
    Posts
    160

    Re: Start a process?

    I remember this from several documents MS released about their "LOGO" programms. The last document like this I read when "Win2k Logo" was en vogue.

    :-) I admit this is long time back. But ... some things do not change.

    This ( http://www.microsoft.com/msj/0899/logo/logo.aspx ) is the only reference I found having a quick view into the internet.

    I think you can do almost anything with ShellExecute(Ex), one can do with CreateProcess, with the benefit of some extra services (ShellExecute does FindExecutable(), resolves AppPaths registrations, sets extra search of the AppPaths registration, works with documents instead of .exe ...).

    Maybe one thing it can not: I think the "alternate search path" for dlls is not supported ...

    regards
    HoM

  8. #8
    Join Date
    Jan 2008
    Location
    India
    Posts
    408

    Re: Start a process?

    Quote Originally Posted by Icyculyr
    How do I start a process?

    Cheers
    This FAQ page might be helpful for you.

    http://www.codeguru.com/forum/showthread.php?t=302501

    Bharani
    Rate the posts which you find useful

  9. #9
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Start a process?

    Quote Originally Posted by HoM
    I remember this from several documents MS released about their "LOGO" programms. The last document like this I read when "Win2k Logo" was en vogue.

    :-) I admit this is long time back. But ... some things do not change.

    This ( http://www.microsoft.com/msj/0899/logo/logo.aspx ) is the only reference I found having a quick view into the internet.

    I think you can do almost anything with ShellExecute(Ex), one can do with CreateProcess, with the benefit of some extra services (ShellExecute does FindExecutable(), resolves AppPaths registrations, sets extra search of the AppPaths registration, works with documents instead of .exe ...).

    Maybe one thing it can not: I think the "alternate search path" for dlls is not supported ...

    regards
    HoM
    I started using CreateProcess so long ago, ShellExecuteEx didn't exist at the time. I've been using cp ever since, but it looks like ShellExecuteEx is a good alternative. Thanks.

  10. #10
    Join Date
    Jun 2002
    Location
    Colorado, U.S.A.
    Posts
    980

    Re: Start a process?

    One very useful thing that ShellExecute does, in the Vista era, is prompt the user for elevation if necessary.

    Kelly

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

Featured