Code: Select all
F12::
WinSet AlwaysOnTop,On,A
return
Moderators: tmplinshi, arcticir
Code: Select all
F12::
WinSet AlwaysOnTop,On,A
return
Code: Select all
; reference
; https//autohotkey.com/board/topic/94627-button-for-always-on-top/?p=596565
#Persistent
SetTimer, autopinwindows, 200
return
autopinwindows:
IfWinActive, ahk_class Notepad
WinGet, winID,id,A
WinGet, ExStyle, ExStyle, ahk_id %winID%
if (ExStyle & 0x8)
{
return
}
else
{
WinSet, alwaysontop,on,ahk_id %winID%
}
return
Code: Select all
; reference
; https//autohotkey.com/board/topic/94627-button-for-always-on-top/?p=596565
#Persistent
SetTimer, autopinwindows, 200
return
autopinwindows:
IfWinExist, ahk_class Notepad
WinGet, winID,id,A
WinGet, ExStyle, ExStyle, ahk_id %winID%
if (ExStyle & 0x8)
{
return
}
else
{
WinSet, alwaysontop,on,ahk_exe notepad.exe
}
return
Code: Select all
;- start notepad and later charmap , notepad is alwaysontop
#warn
#NoEnv
setworkingdir,%a_scriptdir%
settitlematchmode,2
sc:="ahk_exe notepad.exe"
hd:="Editor"
run,notepad
;WinWait,%hd%,,9 ;- here also ok title contains Editor
WinWait,%sc%,,9 ;- wait maximal 9 seconds / otherwise if OK immediatelly continue
if ErrorLevel
{
MsgBox, 262208, , WinWait timed out for notepad
Exitapp
}
;msgbox, 262208, ,TITLE '%hd%' FOUND
winSet,alwaysOnTop,on,ahk_exe notepad.exe ;- notepad is always ontop
run,charmap ;- run another program > charmap
winwait,ahk_exe charmap.exe
IfWinNotActive ,%sc%,,WinActivate,%sc%
WinWaitActive,%sc%,, ;- activate notepad again
return
;================================================================