Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stuffing the keyboard buffer
Message
From
03/06/1999 11:45:16
 
 
To
03/06/1999 11:41:26
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00225979
Message ID:
00226014
Views:
32
>>>Does anybody know the correct syntax in VFP to declare and call
>>>the "keybd_event" API function?
>>>
>>>I'm running an external application which when it runs presents the user with a Yes and No button, with the Yes button set as the default. I am trying to automate the execution of this external function as much as possible and want to programmatically press the Enter key to trigger the Yes button and conclude the process.
>>
>>I think you're going to need to use several API calls to do this, at a minimum, you'll need to know the hWnd of the messagebox so that you can call SetFocus() to point the keyboard focus to the target window, and then issue a keybd_event, since keybd_event doesn't set the context that the keystroke is processed in.
>
>
>I have the hWnd of the called function because I'm running the function via
>CreateProcess(). The function has the keyboard focus just after I open it so I'm pretty sure my simulated keyboard event will hit it. I just need the syntax of the declare dll statement and the syntax to call the function.


No need of all that. Download my ocx - SENDKEYZ.ocx from the files section of this thread, and send keystrokes to ANY windoze app. Easy to use and best of all- Free!

Bernard
Previous
Reply
Map
View

Click here to load this message in the networking platform