Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP & Email
Message
General information
Forum:
Visual FoxPro
Category:
Internet applications
Title:
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP1
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01135275
Message ID:
01135652
Views:
12
Hey Anatolyi,

Thanks Very Much !

Now it's working perfectly using the code below for Outlook Express:
#define SW_HIDE             0
#define SW_SHOWNORMAL       1
#define SW_SHOWMINIMIZED    2
#define SW_SHOWMAXIMIZED    3
#define SW_SHOWNOACTIVATE   4
#define SW_SHOW             5
#define SW_MINIMIZE         6
#define SW_SHOWMINNOACTIVE  7
#define SW_SHOWNA           8
#define SW_RESTORE          9

DECLARE INTEGER ShellExecute IN shell32;
	INTEGER hWindow, STRING lpOperation,;
	STRING lpFile, STRING lpParameters,;
	STRING lpDirectory, INTEGER nShowCmd

LOCAL lcMail
lcMail = "mailto:buddy1@somewhere.com" +;
	"?CC=buddy2@somewhere.com&Subject=Meet for lunch" +;
	"&Body=Please join me for a sandwich at noon."

= ShellExecute(0, "open", lcMail, "", "", SW_SHOWNORMAL)

DECLARE INTEGER FindWindow IN user32; 
    STRING lpClassName,; 
    STRING lpWindowName  
 
nRet = 0
DO WHILE nRet = 0
	Ret = FindWindow(NULL, "Meet for lunch")
ENDDO 

oShell=CREATEOBJECT("Wscript.Shell")
oShell.SendKeys("%IA")
oShell.SendKeys("c:\autoexec.bat")
oShell.SendKeys("{TAB}{TAB}{ENTER}")

*   *!* To send automatically change the
*   *!* ShellExecute SW_SHOWNORMAL to SW_HIDE and add:
*   oShell.SendKeys ("%s")
*   Messagebox ("Message with attachment sent.")
Is there a simple way to "SendKeys" using API ?
I've seen some examples in your site, like this http://www.news2news.com/vfp/?function=-1&example=26 (working with the Win Calculator), but did not find something about sending complete strings.

I made it work using "keybd_event" and "VkKeyScan" only simulating one key at a time.
Is there a "smarter" way to do that using API instead of Scripting ?

Anyway, thank you very much, it's working perfectly the way I showed above.

Best Regards

Cesar Chalom
Previous
Reply
Map
View

Click here to load this message in the networking platform