I've finished making some code for a Gui that is borderless + always sits on top.
Problem: when I click on the program icon on the taskbar it minimises.
It's impossible to get back. What can I do?
Same happens when I press Windows + D - to minimise all windows.
EDIT I remove the borderless. Then I remove always ontop. I minimise. It pops back into place. I minimise again. It pops back into place. Then I minimise again and it dissapears. I can see a green AHK icon on the top right, but can't do anything to get back.
Grrrr!
Help!
Thanks.
Trouble minimising borderless always on top Gui
Re: Trouble minimising borderless always on top Gui
Maybe post your code? It could help!
Re: Trouble minimising borderless always on top Gui
@wolf_II i found the problem: Guisize
when i have this, it gives unwanted behaviour.
i removed different bits of code until i found the problem.
see the code further below. press minimise (you might need to press 2 or 3 times) and you will see the screen goes out of screen and you can't bring back.
for my code, there seems to be other odd behaviour, but i deduced everything comes from this code.
i used the code to put my window on the top right hand side of the screen.Actually this line of code is what causes the problem: gui, show, % "x" A_ScreenWidth - GuiWidth " y" 0 " w" Guiwidth " h" GuiHeight
just experimenting, if i use just: gui,show - no problems
is this a bug?
when i have this, it gives unwanted behaviour.
i removed different bits of code until i found the problem.
see the code further below. press minimise (you might need to press 2 or 3 times) and you will see the screen goes out of screen and you can't bring back.
for my code, there seems to be other odd behaviour, but i deduced everything comes from this code.
i used the code to put my window on the top right hand side of the screen.
Code: Select all
#SingleInstance, force
Gui, Add, Text,, Some sample text goes here
Gui, Add, Button, w200 gExitAction,Exit
Gui, Show
Return
ExitAction:
ExitApp
Return
Guisize:
guiheight := A_guiheight
guiwidth := A_guiwidth
gui, show, % "x" A_ScreenWidth - GuiWidth " y" 0 " w" Guiwidth " h" GuiHeight
Return
just experimenting, if i use just: gui,show - no problems
is this a bug?
Re: Trouble minimising borderless always on top Gui
Try this:
I hope that helps.
I don't think there is a bug. There is however a known problem with GuiSize being called unreliably during Auto-Execute.
IIRC: Auto-Execute is a critical thread, meaning no other thread should be able to interrupt it.
Problem comes with GUISize: this is a thread which will be called during Auto-Execute, and sometimes is allowed to run, sometimes not allowed (still Critical Auto-Exec).
I have only superficial knowledge and little experience, but Sleep, -1 will be useful for directing flow of control , ... bla bla ..., I don't know more.
Code: Select all
#SingleInstance, force
WinX := A_ScreenWidth - 220
Gui, Add, Text,, Some sample text goes here
Gui, Add, Button, w200 gExitAction,Exit
Gui, Show, x%WinX% y0
Return
ExitAction:
ExitApp
Return
I don't think there is a bug. There is however a known problem with GuiSize being called unreliably during Auto-Execute.
IIRC: Auto-Execute is a critical thread, meaning no other thread should be able to interrupt it.
Problem comes with GUISize: this is a thread which will be called during Auto-Execute, and sometimes is allowed to run, sometimes not allowed (still Critical Auto-Exec).
I have only superficial knowledge and little experience, but Sleep, -1 will be useful for directing flow of control , ... bla bla ..., I don't know more.
Re: Trouble minimising borderless always on top Gui
Also, the size - 220 is 200px for buttonwidth, 10 extra for each margin left, right.
Also, I did not mention: Gui, Show is the place where inside the AUTOEXEC GuiSize gets called.
Also, I did not mention: Gui, Show is the place where inside the AUTOEXEC GuiSize gets called.
Re: Trouble minimising borderless always on top Gui
@wolf_II i've done what u have said. works nicely.
i would prefer not to have to set the width myself.
instead... just let it be whatever it is.
i can't find anyway of JUST getting the width after showing.
any ideas?
i would prefer not to have to set the width myself.
instead... just let it be whatever it is.
i can't find anyway of JUST getting the width after showing.
any ideas?
Re: Trouble minimising borderless always on top Gui
Is this still of interest?omar wrote:i can't find anyway of JUST getting the width after showing.
any ideas?
Try this:
Code: Select all
#SingleInstance, Force
Gui, Add, Text,, Some sample text goes here
Gui, Add, Button, w200 gExitAction, Exit
Gui, Show, Hide
Critical, Off
Sleep, -1
Gui, Show, % "y0 x" A_ScreenWidth - GuiWidth
Return
ExitAction:
ExitApp
Return
Guisize:
GuiWidth := A_GuiWidth
Return
Who is online
Users browsing this forum: NinjoOnline and 212 guests