728x90
반응형
728x170
■ GetKeyboardState API 함수를 선언하는 방법을 보여준다.
▶ 예제 코드 (C#)
using System.Runtime.InteropServices;
#region 키보드 상태 구하기 - GetKeyboardState(keyStateByteArray)
/// <summary>
/// 키보드 상태 구하기
/// </summary>
/// <param name="keyStateByteArray">키 상태 바이트 배열</param>
/// <returns>처리 결과</returns>
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("user32")]
private static extern bool GetKeyboardState(byte[] keyStateByteArray);
#endregion
728x90
반응형
그리드형(광고전용)
'C# > WIN32' 카테고리의 다른 글
[C#/WIN32] BitBlt API 함수 선언하기 (0) | 2021.12.05 |
---|---|
[C#/WIN32] GetWindowDC API 함수 선언하기 (0) | 2021.10.05 |
[C#/WIN32] GetClientRect API 함수 선언하기 (0) | 2021.10.05 |
[C#/WIN32] EnableWindow API 함수 선언하기 (0) | 2021.10.05 |
[C#/WIN32] GetKeyboardLayoutName API 함수 선언하기 (0) | 2021.10.05 |
[C#/WIN32] SetForegroundWindow API 함수 선언하기 (0) | 2021.08.30 |
[C#/WIN32] DeviceIoControl API 함수 선언하기 (0) | 2021.08.28 |
[C#/WIN32] LoadCursorFromFile API 함수 선언하기 (0) | 2021.08.28 |
[C#/WIN32] keybd_event API 함수 선언하기 (0) | 2021.08.28 |
[C#/WIN32] GetSystemMetrics API 함수 선언하기 (0) | 2021.08.28 |
댓글을 달아 주세요