AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Remove titlebar icon without using -SysMenu or +ToolWindow

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
jballi



Joined: 01 Oct 2005
Posts: 385
Location: Texas, USA

PostPosted: Mon Jul 14, 2008 3:59 pm    Post subject: Remove titlebar icon without using -SysMenu or +ToolWindow Reply with quote

Custom GUI: Does anyone know how to get rid of the titlebar icon without using -SysMenu or +ToolWindow. I want the components of the titlebar (min button, max button, close button), I just don't want the icon. The system menu is not a requirement.

Thanks in advance for your help.
Back to top
View user's profile Send private message Send e-mail
SKAN



Joined: 26 Dec 2005
Posts: 6264

PostPosted: Mon Jul 14, 2008 4:45 pm    Post subject: Reply with quote

An ugly workaround is to set your own 16x16 transparent icon ...

Last edited by SKAN on Sat Sep 13, 2008 12:48 pm; edited 1 time in total
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 6264

PostPosted: Mon Jul 14, 2008 4:54 pm    Post subject: Reply with quote

.. borrowing a transparent icon from Shell32.dll .. Ugly!

Code:
hModule := DllCall( "GetModuleHandle", Str,"Shell32.dll" )
hIcon := DllCall( "LoadIcon", UInt,hModule, Int,51 )

Gui, +LastFound
SendMessage, 0x80, 0, hIcon   ; Titlebar Icon
; SendMessage, 0x80, 1, hIcon ; Alt+Tab Icon
Gui, Show, w640 h480
Return

GuiEscape:
GuiClose:
 ExitApp


Smile
_________________
Back to top
View user's profile Send private message
jballi



Joined: 01 Oct 2005
Posts: 385
Location: Texas, USA

PostPosted: Mon Jul 14, 2008 5:01 pm    Post subject: Reply with quote

SKAN wrote:
.. borrowing a transparent icon from Shell32.dll .. Ugly!

Not bad. You're right, it's a bit on the ugly side because the title is shifted and there is no icon on the taskbar. But as they say, it's better than a kick in the head or a poke in the eye. I'll think on it.

Thanks for your feedback. I appreciate it!
Back to top
View user's profile Send private message Send e-mail
drb



Joined: 13 Apr 2008
Posts: 6

PostPosted: Sat Sep 13, 2008 2:44 am    Post subject: Reply with quote

jballi wrote:
SKAN wrote:
.. borrowing a transparent icon from Shell32.dll .. Ugly!

Not bad. You're right, it's a bit on the ugly side because the title is shifted and there is no icon on the taskbar. But as they say, it's better than a kick in the head or a poke in the eye. I'll think on it.

Thanks for your feedback. I appreciate it!


Can I use a some generic icon with this command above? Or just for a blank?
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 6264

PostPosted: Sat Sep 13, 2008 2:49 am    Post subject: Reply with quote

drb wrote:
Can I use a some generic icon with this command above?


You may! Setting GUI icons dynamically (taskbar and ALT+TAB list) posted by Chris

Also related: Crazy Scripting : Include an Icon in your script posted by SKAN

Smile
Back to top
View user's profile Send private message
Serenity



Joined: 07 Nov 2004
Posts: 1276

PostPosted: Sat Sep 13, 2008 12:42 pm    Post subject: Reply with quote

SKAN wrote:
.. borrowing a transparent icon from Shell32.dll


On my system (2k sp4) this is a monochrome version of the magnifying glass/file.
_________________
"Anything worth doing is worth doing slowly." - Mae West
Back to top
View user's profile Send private message Visit poster's website
SKAN



Joined: 26 Dec 2005
Posts: 6264

PostPosted: Sat Sep 13, 2008 1:28 pm    Post subject: Reply with quote

There are transparent Icons in other DLL's too and can be discovered with my IconEx v1.0 - Icon Explorer/Extractor
.. and to create a transparent icon from the script is easy too:

Code:
IconDataHex := "28G001G0002GG10001GG008GGGGGGGGGGG000FFFFFFGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG"
  . "GG00FFFFGFFFFGFFFFGFFFFGFFFFGFFFFGFFFFGFFFFGFFFFGFFFFGFFFFGFFFFGFFFFGFFFFGFFFFGFFFFG"
StringReplace,IconDataHex,IconDataHex,G,0000, All
VarSetCapacity( IconData,( nSize:=StrLen(IconDataHex)//2) )
Loop %nSize% ; MCode by Laszlo Hars: http://www.autohotkey.com/forum/viewtopic.php?t=21172
  NumPut( "0x" . SubStr(IconDataHex,2*A_Index-1,2), IconData, A_Index-1, "Char" )   
hICon := DllCall( "CreateIconFromResourceEx", UInt,&IconData, UInt,0, Int,1, UInt,196608
                , Int,16, Int,16, UInt,0 ), IconDataHex := ""
; www.autohotkey.com/forum/viewtopic.php?t=33955             
Gui, +LastFound
SendMessage, 0x80, 0, hIcon   ; Titlebar Icon
SendMessage, 0x80, 1, hIcon   ; Alt+Tab Icon
Gui, Show, w640 h480
Return


Smile
Back to top
View user's profile Send private message
Serenity



Joined: 07 Nov 2004
Posts: 1276

PostPosted: Sat Sep 13, 2008 2:09 pm    Post subject: Reply with quote

You could also create and load a blank cursor as an icon:

Code:
VarSetCapacity( AndMask, 32*4, 0xFF ), VarSetCapacity( XorMask, 32*4, 0 )
hIcon := DllCall("CreateCursor", Uint,0, Int,0, Int,0, Int,32, Int,32, Uint,&AndMask, Uint,&XorMask )
Gui, +LastFound
SendMessage, 0x80, 0, hIcon   ; Titlebar Icon
SendMessage, 0x80, 1, hIcon   ; Alt+Tab Icon
Gui, Show, w640 h480
Return

_________________
"Anything worth doing is worth doing slowly." - Mae West
Back to top
View user's profile Send private message Visit poster's website
SKAN



Joined: 26 Dec 2005
Posts: 6264

PostPosted: Sat Sep 13, 2008 2:21 pm    Post subject: Reply with quote

Shorter!.. and a fine piece of code.. *Bookmarked* Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group