Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Stuffing the keyboard buffer
Message
De
03/06/1999 14:16:33
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00225979
Message ID:
00226125
Vues:
26
>>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.
>
>Hi Mark,
>
>Are you using the MESSAGEBOX() function, or a dialog of your own design? I really don't think that you can automate this from within VFP if you're using MESSAGEBOX() since the dialog is modal to the application. However, if you're not using MESSAGEBOX(), all you have to do is use the KEYBOARD command, to make it look as if the default command button was pressed.


Hi George.
I'm running an external application, via CreateProcess(). Unfortunately the scope of the KEYBOARD command is limited to within the VFP application.

What I'm doing is merging a .REG file by calling REGEDIT.EXE and passing it the name of the reg file. It works fine under Win'95 but under '98 the user is presented with a YES/NO prompt to merge the reg file. I want to keyboard an ENTER to automate clicking the YES button. ( the default button)

If you know of any API functions for merging a REG file as an alternative to running REGEDIT that would even be better. If it were only a few registry settings I'd write to the registry manually but there are too many to do that way.
"The most beautiful experience we can have is the mysterious ; it is the fundamental emotion which stands at the cradle of true art and true science." - Albert Einstein
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform