Restore Window

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Thom Little

    #1

    Restore Window

    Using C# 3.5 (including using System.Runtime. InteropServices ) ...

    .... if the window is Minimized (IsIconic) ... I would like to ...

    If the window was Normal and then Minimized I would like to return it to
    Normal.
    If the window was Maximized and then Minimized I would like to return it to
    Maximized

    How can I determine for any window that is minimized if it was previously
    normal or previously maximized?

    .... Thom
    _______________ _______________ _______________ ______
    Thom Little - www.tlanet.net - Thom Little Associates, Ltd.
  • Thom Little

    #2
    Re: Restore Window

    I found it ... finally ...

    [DllImport("user 32.dll")]
    public static extern bool IsIconic( IntPtr hWnd );

    [DllImport("user 32.dll")]
    public static extern bool ShowWindowAsync (IntPtr hWnd, int nCmdShow );

    public const int SW_RESTORE = 9;

    if ( NativeMethods.I sIconic( hWnd ) )
    NativeMethods.S howWindowAsync( hWnd, NativeMethods.S W_RESTORE );

    .... Thom
    _______________ _______________ _______________ ______
    Thom Little - www.tlanet.net - Thom Little Associates, Ltd.

    Comment

    Working...