Results 1 to 13 of 13

Thread: [RESOLVED] Maximise active window

Threaded View

  1. #1

    Thread Starter
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Resolved [RESOLVED] Maximise active window

    Hi Guys,

    Anyone got any idea how to use an API to maximise whatever program currently has focus?
    This is what I have so far:

    vb.net Code:
    1. Private Declare Function GetForeGroundWindow Lib "user32" Alias "GetForegroundWindow" () As IntPtr
    2.  
    3. Private Declare Function ShowWindow Lib "user32" Alias "ShowWindow" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
    4.  
    5. Private Const SW_MAXIMIZE = 3
    Then I'm using it like this:
    vb.net Code:
    1. ShowWindow(GetForeGroundWindow, SW_MAXIMIZE)

    However, that just makes the active window dissapear for some reason... it doesnt close it, the process still remains running but it just hides the window

    Anyone got any better methods or point out what I'm doing wrong?

    Cheers
    Chris
    Last edited by chris128; Aug 1st, 2008 at 09:38 AM.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


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