Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WINAPI Access to window
Message
From
10/10/2011 09:21:03
 
 
To
10/10/2011 08:30:16
Marcus Hüneke
Heidelberger Druckmaschinen
Wiesloch, Germany
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Miscellaneous
Thread ID:
01525955
Message ID:
01525961
Views:
71
>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

Since I can't see all your codes, so here is my guest:
You forgot to send Ctrl+A keystroke before Ctrl+C, so clipboard buffer will empty because there is no character was selected.

CMIIW.
Regards,
Ony
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform