Code: Select all
Let>hWndParent=0
Let>cubpat=Cubase .+
Let>nuepat=Nuendo .+
Let>WIN_REGEX=1
GetWindowHandle>%cubpat%,hWndParent
The window I am looking for is actually open and is called:
"Nuendo Project by Phil Pendlebury"
But using the above regex is picking up a completely separate window that is actually part of Dopus Browser named:
"C:\Users\Phil\AppData\Roaming\Steinberg\Cubase 12_64\Presets" (if I close this the code works fine).
I have struggled with this for years to be honest. I used to use various permutations with and without asterisk etc. Forcing window into focus then getting active window handle. So many things. And just ended up having to make sure that no other windows were ever open that have any part of the name in them, even if not at the start.
But now, realising that regex is possible I thought this would solve it. But no.
Why is "Cubase .+" pattern being allowed to pick up that word that is actually 6 words into the string?
Full code (WIP) for info:
Code: Select all
Let>hWndParent=0
Let>cubpat=Cubase .+
Let>nuepat=Nuendo .+
Let>WIN_REGEX=1
GetWindowHandle>%cubpat%,hWndParent
IF>%hWndParent%<>0
Let>memomsg=Cubase Found...%CRLF%%CRLF%Good to go!
SetDialogProperty>Dialog1,MSMemo1,Text,%memomsg%
SetDialogProperty>Dialog1,Panel69,Color,Green
GOTO>FOUNDYOU
ENDIF
IF>%hWndParent%=0
GetWindowHandle>%nuepat%,hWndParent
IF>%hWndParent%<>0
Let>memomsg=Nuendo Found...%CRLF%%CRLF%Good to go!
SetDialogProperty>Dialog1,MSMemo1,Text,%memomsg%
SetDialogProperty>Dialog1,Panel69,Color,Green
GOTO>FOUNDYOU
ENDIF
ENDIF
IF>%hWndParent%=0
Let>memomsg=No active DAW Host (Cubase or Nuendo) found...%CRLF%%CRLF%Please start your DAW Host and either restart this application or go to the Menu Tab and click DAW to rescan.
SetDialogProperty>Dialog1,MSMemo1,Text,%memomsg%
SetDialogProperty>Dialog1,Panel69,Color,Red
// MSG>No active DAW Host found! (Cubase or Nuendo)...%CRLF%%CRLF%Please start your DAW Host and either restart this application or go to the Menu Tab and click DAW to rescan.
ENDIF