Jump to content

Always show on the desktop


nend
 Share

Recommended Posts

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

 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)")
EndIf
Second 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..  :evil:

[size="2"][font="Lucida Sans Unicode"][b][/b][/font][/size]

Link to comment
Share on other sites

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)")
EndIf
Second 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..  :evil:

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...