Maximize

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Charles A. Lackman

    #1

    Maximize

    Hello,

    I have an application that starts notepad.exe from a button click in VB.NET.
    I am looking for a way to make the window maximize or minimize from the vb
    app.

    Any suggestions (if at all possible, detailed) will be greatly appeciated,

    Thanks,

    Chuck



  • David

    #2
    Re: Maximize

    Yo must use the ProcessStartInf o

    System.Diagnost ics.ProcessStar tInfo myProc = new
    System.Diagnost ics.ProcessStar tInfo();
    myProc.FileName = "Notepad.ex e";
    myProc.WindowSt yle = System.Diagnost ics.ProcessWind owStyle.Maximiz ed;
    System.Diagnost ics.Process.Sta rt(myProc);




    "Charles A. Lackman" <Charles@Create ItSoftware.net> escribió en el mensaje
    news:uZtBD1j1EH A.1124@tk2msftn gp13.phx.gbl...[color=blue]
    > Hello,
    >
    > I have an application that starts notepad.exe from a button click in[/color]
    VB.NET.[color=blue]
    > I am looking for a way to make the window maximize or minimize from the vb
    > app.
    >
    > Any suggestions (if at all possible, detailed) will be greatly appeciated,
    >
    > Thanks,
    >
    > Chuck
    >
    >
    >[/color]


    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: Maximize

      "Charles A. Lackman" <Charles@Create ItSoftware.net> schrieb:[color=blue]
      > I have an application that starts notepad.exe from a button click in
      > VB.NET. I am looking for a way to make the window maximize or minimize
      > from the vb app.[/color]

      For example:

      \\\
      Call Shell("notepad" , AppWinStyle.Max imizedFocus)
      ///

      - or -

      \\\
      Dim psi As New ProcessStartInf o
      With psi
      .FileName = "notepad"
      .WindowStyle = ProcessWindowSt yle.Maximized
      End With
      Process.Start(p si)
      ///

      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

      Comment

      • Charles A. Lackman

        #4
        Re: Maximize

        Hello,

        Thanks for the info, what about maximizing an app like notepad.exe if it is
        already running?

        Thanks
        Chuck


        "Charles A. Lackman" <Charles@Create ItSoftware.net> wrote in message
        news:uZtBD1j1EH A.1124@tk2msftn gp13.phx.gbl...[color=blue]
        > Hello,
        >
        > I have an application that starts notepad.exe from a button click in
        > VB.NET. I am looking for a way to make the window maximize or minimize
        > from the vb app.
        >
        > Any suggestions (if at all possible, detailed) will be greatly appeciated,
        >
        > Thanks,
        >
        > Chuck
        >
        >
        >[/color]


        Comment

        • Herfried K. Wagner [MVP]

          #5
          Re: Maximize

          "Charles A. Lackman" <Charles@Create ItSoftware.net> schrieb:[color=blue]
          > Thanks for the info, what about maximizing an app like notepad.exe if it
          > is already running?[/color]

          If you have the according 'Process' object, you can use p/invoke on
          'ShowWindow' + the desired window state
          (<URL:http://pinvoke.net/default.aspx/user32.ShowWind ow>). The handle can
          be taken from the 'Process' object's 'MainWindowHand le' property.

          --
          M S Herfried K. Wagner
          M V P <URL:http://dotnet.mvps.org/>
          V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

          Comment

          Working...