The solution was to
declare the applications window handle as a global variable
when I active the application.
With
PUBLIC gnwnd
DECLARE INTEGER GetActiveWindow IN Win32API
gnwnd = GetActiveWindow()
Then I just changed the line in is_run32 to:
from:
lnhwnd = GetActiveWindow()
to:
lnhwnd = gnwnd
Thanks would have never gotten anywhere without the function!!