blah blah blah is here! blah blah » Close
hi with the SendKeys.Send("{ENTER}"); i send the enter key i wand to send the key using the keynumber not the name...any idea?
If by key number you mean the virual key code (13 in the case of ENTER), then the easiest way is to use the API function keybd_event:
using System.Runtime.InteropServices;// declarations[DllImport("user32.dll")]static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, UIntPtr dwExtraInfo);const uint KEYEVENTF_EXTENDEDKEY = 0x01;const uint KEYEVENTF_KEYUP = 0x02;const byte VK_RETURN = 0x0D;// send ENTER key withkeybd_event( VK_RETURN, 0x45, KEYEVENTF_KEYUP, UIntPtr.Zero );
answered 2 years ago by:
Got feedack? Found a bug? report it here.
1 answers
If by key number you mean the virual key code (13 in the case of ENTER), then the easiest way is to use the API function keybd_event:
There's a list of virtual keycodes here.
answered 2 years ago by:
17279