c# - how to send control + L and control + C to another application? -


I am working on the Win application using C #, I have control + L and control + C when Firefox is active Identify the accessless bar and copy the URL and get the information from the clipboard. I am trying to do this. But I'm capable

How can I do this? Activate the Firefox window, send Ctrl + L (activates the address bar), Ctrl + C and the clipboard to send (, per selection, i.e. the URL on the clipboard.)

[return:. MarshalAs (UnmanagedType.Bool)] [DllImport ("user32.dll", SetLastError = true)] Fixed Execution bool PostMessage (IntPtr hwnd, uint message, integer wParam, integer lParam);

  Personal constants uint VK_CONTROL = 0x11; Private Cant UIT VK_L = 0x4C; Private Contact UIT VK_C = 0x43; If (hwndfirfox == Process.GetProcessesByName ("Firefox") [0] .MainWindowTitle) hwndfirfox = Process.GetProcessesByName ("Firefox") [0] .MainWindowHandle; If (hwndfirfox! = Null) {PostMessage (hwndfirfox, VK_CONTROL, VK_L, 0); Post Message (HDFFerFox, VK-Block, VKN, 0); }  

This code is giving error, help me.

I saw a post that states that it did not use PostMessage to emulate keyboard input Should I or should you use it for


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -