Jump to content



Photo

$WS_EX_TOPMOST-Window does'nt stay ontop.


  • Please log in to reply
9 replies to this topic

#1 Raik

Raik

    Adventurer

  • Active Members
  • PipPip
  • 117 posts

Posted 15 February 2012 - 09:43 PM

#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 & Phase5Firefox Addons by me (resizable Textarea 0.1d) (docked JS-Console 0.1.1)







#2 Aipion

Aipion

    Prodigy

  • Active Members
  • PipPipPip
  • 191 posts

Posted 15 February 2012 - 10:17 PM

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

In Development - Setup Fusion

Library - Page Menu Control

Antonio Do Rosario

#3 JTravolta

JTravolta

    Seeker

  • New Members
  • 2 posts

Posted 15 February 2012 - 10:57 PM

you are right will follow you@ )

#4 JTravolta

JTravolta

    Seeker

  • New Members
  • 2 posts

Posted 16 February 2012 - 12:17 AM

yes that's very interesting..

#5 Raik

Raik

    Adventurer

  • Active Members
  • PipPip
  • 117 posts

Posted 16 February 2012 - 04:26 AM

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, 16 February 2012 - 04:28 AM.

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

#6 Aipion

Aipion

    Prodigy

  • Active Members
  • PipPipPip
  • 191 posts

Posted 16 February 2012 - 06:40 PM

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.

In Development - Setup Fusion

Library - Page Menu Control

Antonio Do Rosario

#7 Raik

Raik

    Adventurer

  • Active Members
  • PipPip
  • 117 posts

Posted 18 February 2012 - 10:51 AM

to know if it works first i have to catch the moment, when it "dissapears". WinGetState() will always tell "Window is visible". :)
AutoIt-Syntaxsheme for Proton & Phase5Firefox Addons by me (resizable Textarea 0.1d) (docked JS-Console 0.1.1)

#8 Aipion

Aipion

    Prodigy

  • Active Members
  • PipPipPip
  • 191 posts

Posted 18 February 2012 - 07:07 PM

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

In Development - Setup Fusion

Library - Page Menu Control

Antonio Do Rosario

#9 Raik

Raik

    Adventurer

  • Active Members
  • PipPip
  • 117 posts

Posted 18 February 2012 - 08:11 PM

another idea: if i read pixelcolor at coordinates of the window, i can detect, if it is the windowcolor. :)
but may take a while to reproduce the event again, i call back then.
AutoIt-Syntaxsheme for Proton & Phase5Firefox Addons by me (resizable Textarea 0.1d) (docked JS-Console 0.1.1)

#10 Raik

Raik

    Adventurer

  • Active Members
  • PipPip
  • 117 posts

Posted 08 March 2012 - 03:44 PM

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 & Phase5Firefox Addons by me (resizable Textarea 0.1d) (docked JS-Console 0.1.1)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users