[SOLVED] How to remove GUI title bar icon

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

[SOLVED] How to remove GUI title bar icon

07 Feb 2014, 06:11

How I can remove the Gui title bar icon in an about-gui like here?

Image
Last edited by jNizM on 10 Feb 2014, 02:19, edited 2 times in total.
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
Jstjacques
Posts: 8
Joined: 06 Feb 2014, 16:50

Re: How to remove GUI title bar icon

07 Feb 2014, 09:03

Gui, -border
You can get a good look at a steak by looking up the cow's rear end but wouldn't you rather take the butchers word for it?
User avatar
fischgeek
Posts: 435
Joined: 29 Jan 2014, 21:39

Re: How to remove GUI title bar icon

07 Feb 2014, 09:23

Gui -Caption would be more accurate. Try this out:

Code: Select all

Gui, Color, White
Gui, +ToolWindow -Caption +Border
Gui, Font, s15, Segoe UI
Gui, Add, Text,, About Gui
Gui, Show, w350 h200
Sleep, 2000
ExitApp
Just quickly slapped together, but you get the idea.
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: How to remove GUI title bar icon

07 Feb 2014, 09:28

@fishgeek...
Ill hope you see the difference ^^
Image

this is what i got so far
Image

Code: Select all

Gui, 2: -0x20000 -0x10000
Last edited by jNizM on 07 Feb 2014, 09:31, edited 1 time in total.
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
User avatar
TLM
Posts: 1608
Joined: 01 Oct 2013, 07:52
Contact:

Re: How to remove GUI title bar icon

07 Feb 2014, 09:28

jNizM, this is going to seem totally counterintuitive,
because I'm essentially adding the ToolWindow ExStyle ( as the option ),
and then removing it again ( with the ExStyle code ).

Code: Select all

Gui, +hwndguihwnd +ToolWindow -MinimizeBox -MaximizeBox
Gui, Show, x-9999 w300 h300 ; remove/change the size but keep the xposition!

GuiSize: ; applies exstyle, places window at default position
WinWait % "ahk_id " guihwnd
WinSet, ExStyle, -0x00000080
WinMove, % (A_ScreenWidth-A_GuiWidth)/2
	    , % (A_ScreenHeight-A_GuiHeight)/2
Return

GuiClose:
ExitApp
Image
IME there are a lot of fancy/semi complete approaches to this,
however none of them seem to remove the icon in the same manner as the example you posted.
User avatar
fischgeek
Posts: 435
Joined: 29 Jan 2014, 21:39

Re: How to remove GUI title bar icon

07 Feb 2014, 09:48

Misunderstood. Sorry.
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: How to remove GUI title bar icon

07 Feb 2014, 09:52

@fishgeek
np =)

@TLM
Too bad that there is nothing finished
but thx so far

btw stop use ghost mode and edit your post every minute :D
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
User avatar
TLM
Posts: 1608
Joined: 01 Oct 2013, 07:52
Contact:

Re: How to remove GUI title bar icon

07 Feb 2014, 09:55

jNizM wrote:@TLM
Too bad that there is nothing finished
but thx so far

btw stop use ghost mode and edit your post every minute :D
Your welcome but I'm not sure I understand what you mean by "nothing finished"
and I'm working on/testing some forum issues at the same time while I'm posted.

The version you see there now is final,
my apologize.
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: How to remove GUI title bar icon

07 Feb 2014, 09:59

like -MinimizeBox (-0x20000) for Icon in Gui
Last edited by jNizM on 07 Feb 2014, 10:06, edited 2 times in total.
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
User avatar
TLM
Posts: 1608
Joined: 01 Oct 2013, 07:52
Contact:

Re: How to remove GUI title bar icon

07 Feb 2014, 10:03

Well, this is speculation
but it seems that it would probably be difficult to add seeing as there is no Extended Window Style for this:
http://msdn.microsoft.com/en-us/library ... 85%29.aspx

If you ask lexikos ( nicely ),
he will probably explain things in much better detail for you.
Who knows, he may even add it for you ; )
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: How to remove GUI title bar icon

07 Feb 2014, 10:06

WS_SYSMENU (0x80000) - but its without close icon -.-
Image
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
User avatar
TLM
Posts: 1608
Joined: 01 Oct 2013, 07:52
Contact:

Re: How to remove GUI title bar icon

07 Feb 2014, 10:08

jNizM wrote:WS_SYSMENU (0x80000) - but its without close icon -.-
http://img5.fotos-hochladen.net/uploads ... yaipde.png
Did you even try my example above ?
It removes the icon, but keeps the close button.
just me
Posts: 9487
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: How to remove GUI title bar icon

08 Feb 2014, 01:49

Hi TLM,

nice trick! 8-)

That's all I need on Win 7:

Code: Select all

#NoEnv
; Main GUI
Gui, Main:+LabelMain
Gui, Main:Margin, 300, 200
Gui, Main:Add, Button, gShowChild, Show Child
Gui, Main:Show, , Main
Return
ShowChild:
; Child GUI w/o icon
Gui, Main: +Disabled
Gui, Child:New, +ToolWindow -MinimizeBox +LabelChild +OwnerMain
Gui, Child:Color, E0E0E0
Gui, Child:Show, w300 h300, Child w/o Icon
Gui, Child:-ToolWindow
Return
MainClose:
ExitApp
ChildClose:
Gui, Main:-Disabled
Gui, Destroy
Return
User avatar
TLM
Posts: 1608
Joined: 01 Oct 2013, 07:52
Contact:

Re: How to remove GUI title bar icon

09 Feb 2014, 03:30

just me wrote:Hi TLM,

nice trick! 8-)
means a lot coming from you
Image

jNizM wrote:How I can remove the Gui title bar icon in an about-gui...
ahh,
I totally overlooked that this was for the child gui..
Well, now it can 'be applied' to parent gui's too so bonus ;)
User avatar
gwarble
Posts: 524
Joined: 30 Sep 2013, 15:01

Re: [SOLVED] How to remove GUI title bar icon

10 Aug 2016, 15:09

Thanks for sharing this trick... I know this is an old topic but a small improvement that allows you to set the window as desired (ie: no icon, with close button) before the Gui, Show to both prevent the visual change to the window after its visible (sometimes with the above you can see the window flash from ToolWindow to -ToolWindow...) and also to fix the window dimension change from ToolWindow to regular window (ie everything shifts down about 5 pixels for me using the above, i assume the difference between the height of a normal caption and a toolwindow caption)

Anyway, this works better for me:

Code: Select all

; Gui, %GuiID%:Show, Hide ;if needed
 Gui, %GuiID%:+Toolwindow
 Gui, %GuiID%:+0x94C80000   ;Winset,   Style, +0x94C80000
 Gui, %GuiID%:-Toolwindow   ;Winset, ExStyle, -0x00000080
; Gui, %GuiID%:+E0x00040000  ;WS_EX_APPWINDOW (Add to taskbar if needed)
 Gui, %GuiID%:Show
About EitherMouse 20160810130926.png
The only thing I can't get working is the same effect on Windows XP (though i'm sure its possible since Notepad or Explorer's about window is like this... and if you create a window using CreateWindowEx and not gui commands you can get "no icon with close button"

Edit: failure of above on XP, but background window is created with CreateWindowEx api and appears correct:
RegisterWindowClassTest.ahk 20160810143028.png
EitherMouse - Multiple mice, individual settings . . . . www.EitherMouse.com . . . . forum . . . .
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: [SOLVED] How to remove GUI title bar icon

28 Feb 2017, 16:47

I remember this trick working (either on Windows XP or Windows 7 or both), it was so good, but I'm testing it now on Windows 7 and it doesn't seem to be working!?

I tried running it in an old version of AHK, and renaming my Lib folders on the off chance that it was that, but still no luck.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: [SOLVED] How to remove GUI title bar icon

06 Mar 2017, 01:54

Another trick that I believe worked, also now seems not to work:

How to remove icon in GUI? - Ask for Help - AutoHotkey Community
https://autohotkey.com/board/topic/7384 ... on-in-gui/

Code: Select all

Gui +LastFound
; WTNCA_NODRAWICON := 2
; WTNCA_NOSYSMENU := 4
DllCall("uxtheme\SetWindowThemeAttribute", "ptr", WinExist()
    , "int", 1, "int64*", 6 | 6<<32, "uint", 8)
Gui Show, W200 H100, Window Title
[EDIT:]
It turns out both methods work, if aero mode is on, and both methods fail, if aero mode is off. I always have aero mode off, because even Notepad's Find dialog is noticeably slower to open, if aero mode is on.

Btw is there a reliable way to check if a title bar button is under the cursor when aero mode is on? Apparently WM_NCHITTEST is unreliable when aero mode is on.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: alawsareps, mikeyww, Rohwedder and 227 guests