Theory:
#1 FilePath_Name.s gets set from a read of an INI file
#2 The first segment of the loop starts reading all windows that are open and gives them to Temp.s
Code: Select all
Temp.s=WindowsEnum()
If Temp=""
Break
EndIf
Code: Select all
AutoFocusRead.s = Temp+" "+HandleToFileName(GetHandle(Temp))
AutoFocusResult.l = CountString(AutoFocusRead.s, FilePath_Name.s)
Code: Select all
If AutoFocusresult = >1 or 1
Temp = HandleOn.s
Break
EndIf
#5 Set the Foreground Window to the name of the window HandleOn.s
Code: Select all
ForegroundWindowSet(HandleOn.s)
Code: Select all
FilePath_Name.s = IniRead("C:\File.ini","FilePath","Name")
Repeat
Temp.s=WindowsEnum()
If Temp=""
Break
EndIf
AutoFocusRead.s = Temp+" "+HandleToFileName(GetHandle(Temp))
AutoFocusResult.l = CountString(AutoFocusRead.s, FilePath_Name.s)
If AutoFocusresult = >1 or 1
Temp = HandleOn.s
Break
EndIf
ForEver
ForegroundWindowSet(HandleOn.s)
Big thanks to anyone that does.