Reputation: 6697
I have a code that triggers PASTING to any 3rd party application by sending ctrl+v (see below), but this does not seem to work with CITRIX. is there any other method to trigger ctrl+v than keyb simulation?
keybd_event(VK_CONTROL, Lo(MapVirtualKey(VK_CONTROL,0)), 0,0);
keybd_event(86, Lo(MapVirtualKey(86,0)), 0,0);
keybd_event(86, Lo(MapVirtualKey(86,0)), KEYEVENTF_KEYUP,0);
Upvotes: 0
Views: 776
Reputation: 21640
Ah, the nice problems with Citrix!
Upvotes: 1
Reputation: 15548
I think the critical statement here is -- with CITRIX.
My experience with inter-communication with citrix applications is that many things which work fine on a normal desktop, fail when run in a citrix environment. I would first try to send a WM_PASTE message as Gamecat suggested, and if that fails you might want to make sure that your clients are running your application thru a citrix desktop, NOT by running the applications directly from a shortcut on their desktop. When a citrix application is launched from an external shortcut, it gets a different session than when it is launched from an internal shortcut on the citrix desktop.
Upvotes: 0
Reputation: 4037
You can try PostKeyEx32
I Wrote a article in Portuguese, but you can read the code, it is simple.
http://www.cesarromero.com.br/simulando-keypress-com-postkeyex32/
You can send CTRL + Vm like this:
PostKeyEx32(Ord('V'), [ssCtrl], False);
Upvotes: 0