Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sendkeys
Message
From
31/07/2000 09:56:08
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Sendkeys
Miscellaneous
Thread ID:
00398761
Message ID:
00398761
Views:
39
Hi All,

I'm trying to use the sendkeys api to emulate user keystrokes to a specific window.

But for some reason, the code isn't working. Can anyone see why this code isn't working?

Thanks

Mace
The Code....

LOCAL lcWindow

lcWindow = "Save As"

=RestoreWindow( lcWindow)
=SendKey( "M", lcWindow)


*****************************************************************
FUNCTION SendKey
LPARAMETERS tcKeyStroke, tcWindowTitle

DECLARE INTEGER SendMessage IN WIN32API INTEGER, INTEGER, INTEGER, INTEGER

=SendMessage( GetWindowHandle( tcWindowTitle), 256, ASC( tcKeyStroke), 0)
=SendMessage( GetWindowHandle( tcWindowTitle), 257, ASC( tcKeyStroke), 0)

RETURN


**************************************************************
FUNCTION GetWindowHandle
LPARAMETERS tcWindowTitle
LOCAL lnReturn

*-- Make this into a generic function later...
DECLARE INTEGER FindWindow IN WIN32API INTEGER, STRING

lnReturn = FindWindow( 0, tcWindowTitle)

RETURN lnReturn
Next
Reply
Map
View

Click here to load this message in the networking platform