AlwaysOnTop with some rules question

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Hiney

AlwaysOnTop with some rules question

22 Oct 2017, 06:12

My small program is now set to be alwaysontop but i want if someone is opening another window i dont want my window to block them. So I turned alwaysontop off and now it sends it ALL THE WAY TO THE BACK :(

I spent some time reading here https://autohotkey.com/docs/commands/WinSet.htm but did not find an option for my window to not be sent all the way to the back, just keep it within the layer just like windows does for other programs

any tips?
User avatar
Delta Pythagorean
Posts: 627
Joined: 13 Feb 2017, 13:44
Location: Somewhere in the US
Contact:

Re: AlwaysOnTop with some rules question

23 Oct 2017, 07:35

You can use WinSet, Top to make the window on top but not AlwaysOnTop

[AHK]......: v2.0.12 | 64-bit
[OS].......: Windows 11 | 23H2 (OS Build: 22621.3296)
[GITHUB]...: github.com/DelPyth
[PAYPAL]...: paypal.me/DelPyth
[DISCORD]..: tophatcat

Hiney

Re: AlwaysOnTop with some rules question

23 Oct 2017, 09:43

Delta Pythagorean wrote:You can use WinSet, Top to make the window on top but not AlwaysOnTop
Goal is that when my gui is open and a user makes active another program (say my gui is open and user clicks on his firefox tab or any tab) my gui should not be sent all the way to the back of the stack, when they minimize ff they should see my program

winset, top,, title ... does not do that
Hiney

Re: AlwaysOnTop with some rules question

23 Oct 2017, 10:23

So the effect I want requires me to remove the +ToolWindow

Now i need to try to remove the icon from the taskbar, if i cant it is no big deal but maybe someone can help
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: AlwaysOnTop with some rules question

23 Oct 2017, 13:29

It may be that if you set the window style to include WS_CHILD := 0x40000000, then it will not have a taskbar button.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Hiney

Re: AlwaysOnTop with some rules question

23 Oct 2017, 13:38

jeeswg wrote:It may be that if you set the window style to include WS_CHILD := 0x40000000, then it will not have a taskbar button.
can you share sample code?

I tried adding WS_CHILD := 0x40000000 to the start of the script but it did not get rid of the taskbar icon
Hiney

Re: AlwaysOnTop with some rules question

23 Oct 2017, 13:51

Here is some code and the challenge

This one will not load a taskbar icon but as soon as you overlay it with any other window it gets sent all the way to the back

#NoEnv
#SingleInstance Force
SetWorkingDir %A_ScriptDir%
Gui, -Caption +ToolWindow
Gui Add, Text, x160 y64 w120 h93 +0x200, ESC to close

Gui Show, w481 h381, Window
Return

ESC::ExitApp


---
This one will stay in place when you load a window over it, but it creates a taskbar icon


#NoEnv
#SingleInstance Force
SetWorkingDir %A_ScriptDir%
Gui, -Caption +LastFound
Gui Add, Text, x160 y64 w120 h93 +0x200, ESC to close

Gui Show, w481 h381, Window
Return

ESC::ExitApp
----------------

SO can anyone here make it so that it stays in place and does not load a taskbar icon?

Any creative ways to achieve this what looks like an impossible task?
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: AlwaysOnTop with some rules question

23 Oct 2017, 14:44

To remove the taskbar button, this didn't work:
Gui, -Caption +LastFound +0x40000000
But this did:
Gui, -Caption +LastFound +Owner

See re. +Owner at:
GUI
https://autohotkey.com/docs/commands/Gui.htm#Options
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Hiney

Re: AlwaysOnTop with some rules question

23 Oct 2017, 15:24

jeeswg wrote:To remove the taskbar button, this didn't work:
Gui, -Caption +LastFound +0x40000000
But this did:
Gui, -Caption +LastFound +Owner

See re. +Owner at:
GUI
https://autohotkey.com/docs/commands/Gui.htm#Options
incredible! I searched for days, tried so many things, some claimed it is not possible, thank you so very very much

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Anput, JoeWinograd, mikeyww, Nerafius, RandomBoy, Spawnova and 122 guests