[C#] CapsLock 상태 확인하는 방법
[DllImport("user32.dll")] public static extern short GetKeyState(int keyCode); [DllImport("User32.dll")] public static extern void keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo); if ((Win32API.GetKeyState((int)Keys.CapsLock) & 0xffff) != 0) { Win32API.keybd_event((byte)Keys.CapsLock, (byte)0, 0, 0); Win32API.keybd_event((byte)Keys.CapsLock, (byte)0, 2, 0); } 설명 : Win32 API 함수 중에..
C#
2008. 12. 29. 10:41