Jump to content

$WS_EX_TOPMOST-Window does'nt stay ontop.


Raik
 Share

Recommended Posts

#NoTrayIcon
GUICreate('', 200, 19,@DesktopWidth-255,0,$WS_POPUP,BitOr($WS_EX_TOPMOST,$WS_EX_CONTROLPARENT,$WS_EX_TOOLWINDOW))

after longer time this window "disappears" (lost his "ontop"-state) and is hidden behind the other windows.

i dont know how to recognize this and i have no idea what to check.

any ideas, why it looses "ontop"-state and how to fix this?

AutoIt-Syntaxsheme for Proton & Phase5 * Firefox Addons by me (resizable Textarea 0.1d) (docked JS-Console 0.1.1)

Link to comment
Share on other sites

Since you are not showing how to get this bug going again i would suggest you to use the WinSetOnTop ( "title", "text", flag ) function.

exactly thats the problem. after start the window remains ontop for hours and i cant stare the whole time on it, while doing other things on the computer. until now i have not managed, to catch the moment and even if i could, that would not help to see the reason. i switch between all the windows, but it does not occur on a specific window at the first moment. maybe after many switches of a specific window, but i have not managed to catch the moment. :)

Does WinSetOnTop work different to $WS_EX_TOPMOST ? Does'nt set the same Bit?

Edited by Raik

AutoIt-Syntaxsheme for Proton & Phase5 * Firefox Addons by me (resizable Textarea 0.1d) (docked JS-Console 0.1.1)

Link to comment
Share on other sites

exactly thats the problem. after start the window remains ontop for hours and i cant stare the whole time on it, while doing other things on the computer. until now i have not managed, to catch the moment and even if i could, that would not help to see the reason. i switch between all the windows, but it does not occur on a specific window at the first moment. maybe after many switches of a specific window, but i have not managed to catch the moment. :)

I agree with your statement "i cant stare the whole time on it".

Does WinSetOnTop work different to $WS_EX_TOPMOST ? Does'nt set the same Bit?

They do pretty much the same thing which is just to set the window to stay on top.

Did it work for you?

If you did not try it out yet, please try it then feedback.

Link to comment
Share on other sites

Here use this function to find out if the window is OnTop.

;===============================================================================
;
; Function Name:   _WinIsOnTop
; Description::    Gets the OnTop State of a window
; Parameter(s):    $WindowHandle : Handle or Title of Window
; Requirement(s):  WinAPI.au3
; Return Value(s): Window OnTop: True, otherwise False
; Author(s):       Prog@ndy
;
;===============================================================================
;
Func _WinIsOnTop($WindowHandle)
    Local $long = DllCall("User32.dll", "int", "GetWindowLong", "hwnd", WinGetHandle($WindowHandle), "int", -20)
    Return BitAND($long[0],8)=8 ; $WS_EX_TOPMOST = 8
EndFunc
Link to comment
Share on other sites

  • 3 weeks later...

OK, found a solution for it, but not the cause of the behavior.

Opt("PixelCoordMode",0)
    If $COLOR<>'0x'&Hex(PixelGetColor(1,1,$GUI),6) Then
  Beep(500,50)
     WinSetOnTop($GUI,"",0) 
     WinSetOnTop($GUI,"",1)
    EndIf

($COLOR is the color of a progressbar at this position, witch changes frequently.)

because i have to disable "ontop" first, to reenable it, i think, the $WS_EX_TOPMOST style is not lost, but windows does not consider it by any case.

My fix works for me, but i have no idea, how to track down this bug(?).

AutoIt-Syntaxsheme for Proton & Phase5 * Firefox Addons by me (resizable Textarea 0.1d) (docked JS-Console 0.1.1)

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...