Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SendKey
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Miscellaneous
Thread ID:
01135717
Message ID:
01135719
Views:
28
This message has been marked as the solution to the initial question of the thread.
Hi Cesar,

I wrote the following module a while back for some simple SENDKEYS type useage. It's pretty simple to understand and you can extend it as you need. Hope this helps.
*************************************************************************************************
* Program/Function: SendKeys()
* Author: Ben Santiago
* Last Revision: 10/12/04
* Description:
*		Send keyboard events to buffer.
*************************************************************************************************
LPARAMETERS pcCommands

****************************************************
* Declare API's
****************************************************
DECLARE keybd_event IN Win32API INTEGER KeyCode, INTEGER Scan, LONG dwFlags, LONG dwExtraInfo
#DEFINE KEYDOWN	0
#DEFINE KEYUP	1

****************************************************
* Initialize Variables
****************************************************
LOCAL lcCommands

****************************************************
* Default Values
****************************************************
lcCommands = UPPER(pcCommands)

****************************************************
* Process Commands
****************************************************
DO CASE
	CASE lcCommands == "{ENTER}"
		keybd_event(13, 0, KEYDOWN, 0)
	OTHERWISE
		keybd_event(ASC(lcCommands), 0, KEYDOWN, 0)
ENDCASE
________________________
Ben Santiago, MCP & A+
Programmer Analyst (SQL, FoxPro, VB, VB.Net, Java, HTML, ASP, JSP, VBS)
Eastern Suffolk BOCES - Student Data Services


Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
-Rich Cook
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform