Jump to content

Gui not staying on top of pinned apps.


Go to solution Solved by Dan_555,

Recommended Posts

Two Screen Shots below. I like to keep the TOS app pinned so it stays on top of other apps. Additionally I want my GUI to cover the white bar of that TOS app because I don't like bright things on my screen. When the app is unpinned the white bar stays hidden behind the Gui. But when it is pinned the white bar shows it's ugly face. I need to have it pinned and hidden at the same time. Have any of my fine people here figured out if there is a way to do this? I've used $WS_EX_TOPMOST and WinSetOnTop($HomeGUI,"",1). Using both in this example. Thanks in advance.

My code simplified...

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Global $HomeGUI = GUICreate("Home", 1920, 30, 0, 0, $WS_POPUP, $WS_EX_TOPMOST)
WinSetOnTop($HomeGUI,"",1)
GUISetBkColor(0x0C0E10)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

 

Gui covering the white bar when the app is unpinned. That part works fine.

image.thumb.png.e75dea2d64cd7c42dbb7f2ca502d4c72.png

 

 

Gui not covering the white bar when the app is pinned. Go away white bar!!!

 

image.thumb.png.e334c8834bb44f5109de856590c80c3a.png

 

Link to comment
Share on other sites

  • Solution
Posted (edited)

I guess that some apps do not accept (or ignore) the topmost settings ...
maybe you should check if the window is activated  and call the WinSetOnTop($HomeGUI,"",1) when it does ?

(i guess the window is setting itself topmost when pinned/unpinned, that's why you may want to set your gui topmost again) 

 

I have made a script to set windows on top. If you like to try it.

Edited by Dan_555

Some of my script sourcecode

Link to comment
Share on other sites

Great idea Dan_555. I failed to mention that with the window pinned I "can" mouse click on the Gui and it covers the white bar. But comes back when I click on the pinned window. So here's what I've done to solve this based on your feedback, although a bit different. 

I've added an AdlibRegister and a function call to set the Gui on top every half a second. So now the white bar only shows for half a second when I click on the pinned window. I supposed I could set it to a smaller time but if you saw this code in it's entirety (3000+ lines) I'm already using lots of processing power. This will work. Thanks very much for your help. 

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Global $HomeGUI = GUICreate("Home", 1920, 30, 0, 0, $WS_POPUP, $WS_EX_TOPMOST)
WinSetOnTop($HomeGUI,"",1)
GUISetBkColor(0x0C0E10)
GUISetState(@SW_SHOW)

AdlibRegister("WhiteBeGone",500)
WhiteBeGone()

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func WhiteBeGone()
    WinSetOnTop($HomeGUI,"",1)
EndFunc
 

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