 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
jballi
Joined: 01 Oct 2005 Posts: 385 Location: Texas, USA
|
Posted: Mon Jul 14, 2008 3:59 pm Post subject: Remove titlebar icon without using -SysMenu or +ToolWindow |
|
|
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 |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6264
|
Posted: Mon Jul 14, 2008 4:45 pm Post subject: |
|
|
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 |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6264
|
Posted: Mon Jul 14, 2008 4:54 pm Post subject: |
|
|
.. 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 |
 _________________
 |
|
| Back to top |
|
 |
jballi
Joined: 01 Oct 2005 Posts: 385 Location: Texas, USA
|
Posted: Mon Jul 14, 2008 5:01 pm Post subject: |
|
|
| 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 |
|
 |
drb
Joined: 13 Apr 2008 Posts: 6
|
Posted: Sat Sep 13, 2008 2:44 am Post subject: |
|
|
| 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 |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6264
|
|
| Back to top |
|
 |
Serenity
Joined: 07 Nov 2004 Posts: 1276
|
Posted: Sat Sep 13, 2008 12:42 pm Post subject: |
|
|
| 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 |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6264
|
Posted: Sat Sep 13, 2008 1:28 pm Post subject: |
|
|
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 |
 |
|
| Back to top |
|
 |
Serenity
Joined: 07 Nov 2004 Posts: 1276
|
Posted: Sat Sep 13, 2008 2:09 pm Post subject: |
|
|
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 |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6264
|
Posted: Sat Sep 13, 2008 2:21 pm Post subject: |
|
|
Shorter!.. and a fine piece of code.. *Bookmarked*  |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|