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:
00889724
Views:
21
I was hoping something like the below would work, but even though I can grab the window, postmessage does not work.
DECLARE INTEGER FindWindow IN Win32API AS FindWindow STRING, STRING

lnwindow = FindWindow(0,tcTitle)
IF lnwindow > 0
   #DEFINE WM_KEYDOWN  0x0100

    DECLARE SHORT PostMessage IN user32; 
      INTEGER   hWnd,; 
      INTEGER   Msg,; 
      STRING  @ wParam,; 
      INTEGER   lParam 
 
	hwnd = lnwindow
	cmessage = 'password'+CHR(13)
	ReturnValue = PostMessage(hwnd, WM_KEYDOWN, @cmessage, 0)
	RETURN .T.
ELSE
	RETURN .F.
ENDIF
.·*´¨)
.·`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