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:
Then I'm using it like this:vb.net Code:
Private Declare Function GetForeGroundWindow Lib "user32" Alias "GetForegroundWindow" () As IntPtr Private Declare Function ShowWindow Lib "user32" Alias "ShowWindow" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long Private Const SW_MAXIMIZE = 3
vb.net Code:
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





Reply With Quote