CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9

Thread: Opening exe's

  1. #1
    Join Date
    Aug 2001
    Location
    United Kingdom
    Posts
    15

    Opening exe's

    I've currently used the code
    Shell ("C:\Program.exe")

    to open exe files, but for some reason they open minimized. How do I get them to open maximizes?

    Jonathon.


  2. #2
    Join Date
    Jun 2001
    Location
    MO, USA
    Posts
    2,868

    Re: Opening exe's

    Try:

    shell("C:\program.exe", vbMaximizedFocus )


  3. #3
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Opening exe's

    You can give one of the following as the second parameter, I think they are selfexplanable

    vbHide
    vbMaximizedFocus
    vbMinimizedFocus <-- This is the default
    vbMinimizedNoFocus
    vbNormalFocus
    vbNormalNoFocus




    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

  4. #4
    Join Date
    Aug 2001
    Location
    United Kingdom
    Posts
    15

    Re: Opening exe's

    That's what I tried in the first page, but you get the error Expected: =

    . What could I do to get it working, or have I just made a BIG mistake somewhere?

    Jonathon.


  5. #5
    Join Date
    Jun 2001
    Location
    MO, USA
    Posts
    2,868

    Re: Opening exe's

    Sorry... since the syntax I used was for a Function (as opposed to a Sub()) the compiler is expecting a return value. You can use either of the following:


    dim dblProcess as double
    dblProcess = Shell("C:\SomeProgram.exe", vbMaximized)




    or


    Shell "C:\SomeProgram.exe", vbMaximized







  6. #6
    Join Date
    Aug 2001
    Posts
    26

    Re: Opening exe's

    just type in the following code

    Shell ("C:\Program.exe"),Vbmaximised
    .

    this will open the exe in maximised form



  7. #7
    Join Date
    Aug 2001
    Location
    United Kingdom
    Posts
    15

    Re: Opening exe's

    I've tried all the suggestions listed so far and none of them seem work. Is there anything I have to enable in the "Project-->Resouses" menu, or prehaps I need to have a certain setting in the properties of the form?

    This is really strange,

    Jonathon.


  8. #8
    Join Date
    Aug 2001
    Posts
    26

    Re: Opening exe's

    u can try with this
    Shell "c:\xxx\xxx.exe", vbMaximizedFocus

    i am using this and it works


  9. #9
    Join Date
    Sep 2003
    Location
    Washington
    Posts
    143
    I have had this similair problem, and I tried using the last example that someone posted. the program i am trying to open is Elma.exe. And when i click the button that is supposed to go to it, it get "ELMA.RES missing!" , even though i can physically see the file, and run elma.exe on it's own.
    -squaK

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