Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting Treeview to respond to keystrokes
Message
De
12/08/2002 10:26:02
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Titre:
Getting Treeview to respond to keystrokes
Divers
Thread ID:
00688584
Message ID:
00688584
Vues:
47
I am working on a self running demo for our program that we will use for application testing and I have hit a snag. I have recorded macros to add new customers to the system and enter various data for each. When I get to a treeview that is dropped on a form, the macro stops working. I mean that the arrow keys are ignored by the treeview control.

After a little research I started looking ate WSH SendKeys(). I got this to send the keystrokes to the treeview but I still have a problem. Our demo has a macro set up on CTRL+ALT+F1, then the next on CTRL+ALT+F2 ...etc. At the end of each macro, the keystroke to call the next macro is entered so we can string them together. The way we do this is check a registry key to see if we are in demo mode, the in our application object's init, we set up On Key Labels for each macro that call it's corresponding function in a prg file.

Hang with me, so when we hit CTRL+ALT+F1, the function AddCustomer is called which contains the command PLAY MACRO addcustomer. Then at the end of that macro it contains CTRL+ALT+F2 and so on. The problem is getting the macros to continue after the function that creates the shell object finishes. I've tried using Sendkeys() to call the next macro, I've called the next macro manually, I've put in =sleeps() and nothing seems to work.

Finally, here's what I'm seeing. If I call DO AddCustomer2 at the end of the funtion that does the SendKeys(), then the keystrokes are ignored and the treevies just sits there. If I take out the call to the next macro, the SendKeys() works and the treeview is expanded and then I'm stopped. I think the may have something to do with the "strange" way that VFP handles pending macros. It plays them in reverse order. Does VFP look on down the line to future function calls that contain the PLAY MACRO command and try to play them first?

I know this is long and kind of hard to explain, but any suggestions would be appreciated.
Répondre
Fil
Voir

Click here to load this message in the networking platform