| re: Get the selected Text from other Process
Hi Mohammed,
here is the code
....
[DllImport("User32.dll")] private static extern bool
SetForegroundWindow(IntPtr hWnd);
[DllImport("user32.dll", CharSet=CharSet.Auto)]
static public extern IntPtr GetForegroundWindow();
[DllImport("user32.dll")]
static extern void keybd_event(byte bVk, byte bScan, uint dwFlags,
uint dwExtraInfo);
.....
private void SendCtrlC(IntPtr hWnd)
{
uint KEYEVENTF_KEYUP = 2;
byte VK_CONTROL = 0x11;
SetForegroundWindow(hWnd);
keybd_event(VK_CONTROL,0,0,0);
keybd_event (0x43, 0, 0, 0 ); //Send the C key (43 is "C")
keybd_event (0x43, 0, KEYEVENTF_KEYUP, 0);
keybd_event (VK_CONTROL, 0, KEYEVENTF_KEYUP, 0);// 'Left Control Up
}
Regards,
Marcus
"Mohamoss" <mohamed.mossad@egdsc.microsoft.com> wrote in message
news:eTZjUBSsEHA.3252@cpmsftngxa10.phx.gbl...[color=blue]
> HI Marcus
> thaks for the reply , yes sure please share that so any one would make use
> of it while encountraing the same situation
> thanks again
> Mohamed Mahfouz
> MEA Developer Support Center
> ITworx on behalf of Microsoft EMEA GTSC
>[/color] |