Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Obtain an object reference to 3rd party dialog box.
Message
De
27/07/2000 14:05:31
 
 
À
27/07/2000 13:06:14
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00397494
Message ID:
00397760
Vues:
12
>>
>>I did have another thought - if you know the text for the dialog box's caption, you might try using the Windows FindWindow API call to search for the hWnd of the dialog box, and then directly address the dialog box via it's hWnd using SendMessage() or PostMessage() to send keystrokes to that window - it's less haphazard than trying to find the right window knowing only the IE COM reference.
>
>I wasn't aware that you could send keystrokes with sendmesage and postmessage. I'll take a look at that. Do you think this will be less temperamental than my current solution of using the WSH to pass keystrokes?
>

Since you can address a specific Window rather than just the activated app, yes. Once you have the hWnd of a Window, you can send keystrokes to that Window using PostMessage() to send WM_KEYDOWN followed by WM_KEYUP messages for the virtual key that represents the keystroke; PostMessage() is preferable here because it queues the Windows message in the message queue without waiting on it to be processed, where SendKey() waits until the other app responds to the specified Windows message. A WM_KEYDOWN followed by a WM_KEYUP for a given virtual key actually generates the keystroke (the message queue sees a WM_KEYDOWN, a WM_CHAR, and a WM_KEYUP as a result) - other related APIs include keybd_event() and SendInput(), which synthesize keystrokes but do not provide the ability to direct the messages to specific hWnd objects.

BTW, in most instances, each control has its own hWnd, a child of the Window that contains it - with a bit of playing around, you can force messages to a specific control in an application Window.

>I've spoken to my client... I'm afraid we won't be sending the bag of USD to your backdoor just yet. Between you and me I have found that there is a team here who downloads these files to a shared drive everyday anyway, so I could use these, but I thought this is a good opportunity to play around with IE for a while.
>

I'll accept gold bullion, diamonds, Euros, or tickets to Yankees home games are OK, too. No lire, rubles, pesos, air travel miles, or amazon.com stock, though.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform