document updated 16 years ago, on Mar 28, 2008
I'm trying to find a character that doesn't print as a box when put in a window's title, but nonetheless doesn't show anything. Semi-useful things so far:
- chr(32) Fine as a suffix, but as a prefix, it moves the title over
Things that don't work (display as a square box):
- chr(143) (inivisible on 4chan... not sure what specific font is used there)
- chr(8) (backspace)
- chr(13)
- chr(10)
Things to try next:
- You can right-click on the desktop, properties, appearance, advanced, and find out exactly what's configured as the title bar fon.
For me, it's Tahoma. I believe the square boxes are displayed whenever a specific font doesn't have that character defined. So... the questions are:
- are there any zero-width characters defined in Tahoma?
-
#SingleInstance force
nospace := " "
#H::
WinGetActiveTitle,title
if (SubStr(title,-2) == nospace . nospace . nospace)
{
MsgBox,Sorryall maxed out... my species only has three fingers.
}
else if (SubStr(title,-1) == nospace . nospace)
{
WinGet,hwnd,ID,A
AppendTitle(hwnd,nospace)
MsgBox,This is the third time you hit Windows-H for this specific window.
}
else if (SubStr(title,0) == nospace)
{
WinGet,hwnd,ID,A
AppendTitle(hwnd,nospace)
MsgBox,This is the second time you hit Windows-H for this specific window.
}
else if (SubStr(title,0) != nospace)
{
WinGet,hwnd,ID,A
AppendTitle(hwnd,nospace)
MsgBox,This is the first time you hit Windows-H for this specific window.
}
return
; Append a string to a window's title so we know if our code has already run
AppendTitle(hwnd,append)
{
WinGetTitle,title,ahk_id %hwnd%
title := title . append
WinSetTitle,ahk_id %hwnd%,,%title%
}
; Add a prefix to a window's title so we make sure we only make our changes once
PrefixTitle(hwnd, prefix)
{
WinGetTitle,title,ahk_id %hwnd%
title := prefix . title
WinSetTitle,ahk_id %hwnd%,,%title%
}