Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WScript.Shell SendKeys to close a DOS window
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00474022
Message ID:
00474206
Vues:
23
>>Can you use sendkeys to close a DOS window that was started using:
>>
>>oShell = CREATEOBJECT('WScript.Shell')
>>oShell.Run('postal "customer"')
>>
>>The DOS window is asking for Ctrl+C to close the window. I was trying this instead of the run postal "customer" so that I can close the window programatically.
>>
>>Per the MSDN I tried
>>
>>oshell.SendKeys "^c"
>>
>>and
>>
>>oshell.SendKeys "%{F4}"
>>
>>I'm getting a syntax error.
>>
>>Regards,
>>
>Steve
>
>Is the code you're executing within Fox and as shown above? If so, you need parameters to pass the key codes.

What's the syntax for that? I also tried this from the MSDN with no success:

From MSDN: The parameter passed AppActivate is the caption of the recipient program's main window.

oShell.AppActivate("postal") && This is the caption of the DOS window.
I get unknown name error code.

From MSDN: The SendKeys syntax is
WshShell.SendKeys (bstrKeys As String, [pvarWait])

Tried this, too.

oSHell.sendkeys("^C")
oSHell.sendkeys("^C",.f.)
Steve McMahon
ZDI
San Diego
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform