Try
CharsBar!
Add your own characters to a docked, autohiding toolbar.
Change the settings in the top of the script.
Skrommel
;CharsBar.ahk
; Add your own characters to a docked, autohiding toolbar
;Skrommel @ 2008
chars=abcdefghijklmnopqrstuvwxyzæøåß|ðÞ™
font=Arial
weight=1000
color=000000 ;RRGGBB
size=12
buttonw=20
buttonh=20
xspace=0
yspace=0
dock=top ; top left right bottom
#NoEnv
#SingleInstance,Force
SetBatchLines,-1
SetWinDelay,0
SetControlDelay,0
SendMode,Input
SetWorkingDir,%A_ScriptDir%
CoordMode,Mouse,Screen
Gui,+LastFound
guiid:=WinExist()
DllCall( "RegisterShellHookWindow", UInt,guiid )
MsgNum := DllCall( "RegisterWindowMessage", Str,"SHELLHOOK" )
OnMessage( MsgNum, "ShellMessage" )
building=1
Gui,+AlwaysOnTop +ToolWindow -Resize -Border -Caption
Gui,Margin,0,0
Gui,Font,S%size% W%weight% C%color%,%font%
Loop,% StrLen(chars)
{
char:=SubStr(chars,A_Index,1)
ascii:=Asc(char)
Gui,Add,Button,% "GCLICK W" buttonw " H" buttonh,% char
}
Gui,Show
building=0
Gosub,BUILD
SetTimer,MOUSE,100
SetTimer,HIDE,3000
Return
ShellMessage( wParam,lParam )
{
Global activeid
Global guiid
If ( wParam = 4 ) ; HSHELL_WINDOWACTIVATED=4 ;HSHELL_WINDOWCREATED=1
{
If (lParam<>guiid And lParam<>0)
{
activeid:=lParam
}
}
}
MOUSE:
MouseGetPos,mx,my,mid,mctrl
IfWinExist,ahk_id %guiid%
WinGetPos,guix,guiy,guiw,guih,ahk_id %guiid%
If (mx>=guix And mx<=guix+guiw And my>=guiy And my<=guiy+guih)
{
If hiding=1
SetTimer,HIDE,Off
hiding=0
}
Else
{
If hiding=0
SetTimer,HIDE,1000
hiding=1
}
If ((my<=monitorTop And dock="top") Or (my>=monitorBottom-1 And dock="bottom") Or (mx<=monitorLeft And dock="left") Or (mx>=monitorRight+1 And dock="right"))
{
SetTimer,HIDE,Off
WinShow,ahk_id %guiid%
hiding=0
}
Return
HIDE:
SetTimer,HIDE,Off
WinHide,ahk_id %guiid%
Return
CLICK:
If A_GuiEvent In Normal,DoubleClick
{
WinActivate,ahk_id %activeid%
Send,%A_GuiControl%
; ControlSendRaw,,%A_GuiControl%,ahk_id %activeid%
}
Return
GuiSize:
If building=1
Return
If ErrorLevel=1 ;minimized
Return
Gosub,BUILD
Return
BUILD:
building=1
Sysget,primary,MonitorPrimary
Sysget,monitor,MonitorWorkArea,%primary%
If dock=top
WinMove,ahk_id %guiid%,,% monitorLeft,% monitorTop,% monitorRight-monitorLeft,% buttonh+yspace
If dock=bottom
WinMove,ahk_id %guiid%,,% monitorLeft,% monitorBottom-buttonh-yspace,% monitorRight-monitorLeft,% buttonh+yspace ;%
If dock=left
WinMove,ahk_id %guiid%,,% monitorLeft,% monitorTop,% buttonw+xspace,% monitorBottom-monitorTop
If dock=right
WinMove,ahk_id %guiid%,,% monitorRight-buttonw-xspace,% monitorTop,% buttonw+xspace,% monitorBottom-monitorTop
WinGet,controls,ControlList
x:=xspace
y:=yspace
Loop,Parse,controls,`n
{
GuiControl,MoveDraw,%A_LoopField%,X%x% Y%y%
x:=x+buttonw+xspace-1
If (x>A_GuiWidth-buttonw-xspace)
{
x:=xspace
y:=y+buttonh+yspace-1
}
}
building=0
Return