>DO WHILE Checkwin('Password') > WAIT WINDOW "Cursor is flashing in textbox of password window" NOWAIT >ENDDO >RETURN > >FUNCTION CheckWin >PARAMETER tcTitle > >* Routine which sees if an application is active by looking for its >* Window title >* expC1 Window title > >DECLARE INTEGER FindWindow IN Win32API AS FindWindow STRING, STRING > >lnwindow = FindWindow(0,tcTitle) >IF lnwindow > 0 > #DEFINE WM_KEYDOWN 0x0100 > #DEFINE WM_SYSCOMMAND 0x0112 > #DEFINE WM_COMMAND 0x00110818 > #DEFINE WM_KEYUP 0x0101 > #DEFINE WM_SETFOCUS 0x0007 > > DECLARE SHORT PostMessage IN user32; > INTEGER hWnd,; > INTEGER Msg,; > STRING @wParam,; > INTEGER lParam > > hwnd = lnwindow > cmessage = 'password'+CHR(13)+CHR(0) > ReturnValue = PostMessage(hwnd,WM_SETFOCUS,0,0) > ReturnValue = PostMessage(hwnd,WM_KEYDOWN, @cmessage,0) > ReturnValue = PostMessage(hwnd,WM_KEYUP, @cmessage,0) > RETURN .T. >ELSE > RETURN .F. >ENDIF >>
>>>DO WHILE CheckWin('Password') >>> *--This will display until I close the password window as it should >>> WAIT WINDOW "Found the password window" NOWAIT >>>ENDDO >>>RETURN >>> >>>FUNCTION CheckWin >>>PARAMETER tcTitle >>> >>>lnwindow = FindWindow(0,tcTitle) >>>IF lnwindow > 0 >>> #DEFINE WM_KEYDOWN 0x0100 >>> DECLARE SHORT SendMessage IN user32; >>> INTEGER hWnd,; >>> INTEGER Msg,; >>> STRING @ wParam,; >>> INTEGER lParam >>> >>> hwnd = lnwindow >>> cmessage = 'password'+CHR(13) >>> ReturnValue = SendMessage(hwnd, WM_KEYDOWN, @cmessage, 0) >>> RETURN .T. >>>ELSE >>> RETURN .F. >>>ENDIF >>>>>>