Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WINAPI Access to window
Message
De
10/10/2011 08:30:16
Marcus Hüneke
Heidelberger Druckmaschinen
Wiesloch, Allemagne
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
WINAPI Access to window
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Divers
Thread ID:
01525955
Message ID:
01525955
Vues:
118
Hello,
hope somebody can help me to solve me problem.
Try to send keystrokes to an external application (window , CITRIX)). I am using WINAPI functions.
I can find the window !
With “SwitchToThisWindow “ I can bring it on the top.
After that I try to send keystokes with the keyb_event function like:
= keybd_event(VkKeyScan(Asc("A")), 0, 0, 0)
= keybd_event(VkKeyScan(Asc("A")), 0, KEYEVENTF_KEYUP, 0)
But this window ignores all keystroke inputs like that. If I type the characters manually I see that I’m in the window and that I have the focus on it. The only thing the window accepts is if I put some characters in the clipboard and send a:

Store "92976972" To _Cliptext

= keybd_event(VK_CONTROL, 0, 0, 0)
= keybd_event(VkKeyScan(Asc("V")), 0, 0, 0)
= keybd_event(VkKeyScan(Asc("V")), 0, KEYEVENTF_KEYUP, 0)
= keybd_event(VK_CONTROL, 0, KEYEVENTF_KEYUP, 0)

What I need is the content of an input field in this mask. The following code does not succeed:

= keybd_event(VK_CONTROL, 0, 0, 0)
= keybd_event(VkKeyScan(Asc("C")), 0, 0, 0)
= keybd_event(VkKeyScan(Asc("C")), 0, KEYEVENTF_KEYUP, 0)
= keybd_event(VK_CONTROL, 0, KEYEVENTF_KEYUP, 0)



Also the api function movewindow has no effect
e.g.(MoveWindow(hwindow,-4,-4,400,400,.t.) has no effect on the window

Any help is appreciated.
Thanks in advance

Marcus
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform