nend Posted December 14, 2009 Share Posted December 14, 2009 I’ve made a widget style program en I want it to make it possible to show it always on the desktop. I’ve already use _WinAPI_SetWindowPos to make sure the widget is always under the other windows. But when I minimize all windows “Show desktop” It will also minimize my widget. Is it possible to detect when they are minimize so I can restore the position. I’ve already been using WinGetState but It will not detect minimize of the window (under Win7) Maybe there is a other way, please help it's driving me mad. Link to comment Share on other sites More sharing options...
ichigo325 Posted December 14, 2009 Share Posted December 14, 2009 It is possible to detect minimized window, i know there are two ways (or more ) .. First example: $State = WinGetState("Untitled - Notepad"); <- you can use window handle, ex: WinGetState($HWnd) If BitAND($State, 16) Then MsgBox(0, "", "Notepad is minimized") ElseIf BitAND($State, 32) Then MsgBox(0, "", "Notepad is maximized") Else MsgBox(0, "", "Notepad is enabled (normal state)") EndIfSecond example: $Pos = WinGetPos("Untitled - Notepad"); <- can also use window handle If $Pos[0] = -32000 And $Pos[1] = -32000 Then MsgBox(0, "", "Notepad is minimized") ElseIf $Pos[0] = -8 And $Pos[1] = -8 Then MsgBox(0, "", "Notepad is maximized") Else MsgBox(0, "", "Notepad is enabled (normal state)") EndIf Hope this help you.. [size="2"][font="Lucida Sans Unicode"][b][/b][/font][/size] Link to comment Share on other sites More sharing options...
nend Posted December 14, 2009 Author Share Posted December 14, 2009 Thanks for your help! It is possible to detect minimized window, i know there are two ways (or more ) .. First example: $State = WinGetState("Untitled - Notepad"); <- you can use window handle, ex: WinGetState($HWnd) If BitAND($State, 16) Then MsgBox(0, "", "Notepad is minimized") ElseIf BitAND($State, 32) Then MsgBox(0, "", "Notepad is maximized") Else MsgBox(0, "", "Notepad is enabled (normal state)") EndIfSecond example: $Pos = WinGetPos("Untitled - Notepad"); <- can also use window handle If $Pos[0] = -32000 And $Pos[1] = -32000 Then MsgBox(0, "", "Notepad is minimized") ElseIf $Pos[0] = -8 And $Pos[1] = -8 Then MsgBox(0, "", "Notepad is maximized") Else MsgBox(0, "", "Notepad is enabled (normal state)") EndIf Hope this help you.. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now