Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Send a keystroke to a hwnd window
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00889676
Message ID:
00889732
Views:
23
Well the below should work, but nothing gets put in the password window.
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
Yet if I run that loop the wait window displays nonstop (as it should) until I close the password window. Once I do that, it exits the loop because lnwindow returns false. So everything is working EXCEPT sending the keystrokes to taht password window... Sheesh, you'd think it was Friday! :o()
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform