how to check #IfWinActive, if window name starts with space?
how to check #IfWinActive, if window name starts with space?
how to check #IfWinActive, if window name starts with space? i have really backward CAD program and i need some way for AHK to detect window " Text line tfont1.vft". So i basically need: {space} or {wildcard}Text line{wildcard}
Re: how to check #IfWinActive, if window name starts with space?
You can use regex in settitlematchmode
example:
example:
Code: Select all
SetTitleMatchMode, regex
title:=" two_space_in_title"
gui ,+alwaysontop
gui ,show, w200 h200 ,%title%
return
#ifwinactive ^\s\stwo_space
numpad0::
msgbox ok
return
guiclose:
exitapp
Re: how to check #IfWinActive, if window name starts with space?
Alternatively, you can escape the first space or use #If.
Code: Select all
#IfWinActive ` Text line tfont1.vft
#If WinActive(" Text line tfont1.vft")
Re: how to check #IfWinActive, if window name starts with space?
Perhaps obvious, but have you looked at SetTitleMatchMode, 2 for a partial match so you omit the space? (or are there other windows that would then inadvertently match?)
Who is online
Users browsing this forum: Google [Bot] and 132 guests