728x90
반응형
728x170
■ keybd_event API 함수를 선언하는 방법을 보여준다.
▶ 예제 코드 (C#)
using System;
using System.Runtime.InteropServices;
#region 키보드 이벤트 발생시키기 - keybd_event(virtualKey, scanCode, flag, extraInformationHandle)
/// <summary>
/// 키보드 이벤트 발생시키기
/// </summary>
/// <param name="virtualKey">가상 키</param>
/// <param name="scanCode">스캔 코드</param>
/// <param name="flag">플래그</param>
/// <param name="extraInformationHandle">부가 정보 핸들</param>
[DllImport("user32")]
private static extern void keybd_event(byte virtualKey, byte scanCode, uint flag, IntPtr extraInformationHandle);
#endregion
728x90
반응형
그리드형(광고전용)
'C# > WIN32' 카테고리의 다른 글
[C#/WIN32] GetKeyboardLayoutName API 함수 선언하기 (0) | 2021.10.05 |
---|---|
[C#/WIN32] GetKeyboardState API 함수 선언하기 (0) | 2021.09.15 |
[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] GetSystemMetrics API 함수 선언하기 (0) | 2021.08.28 |
[C#/WIN32] SetWindowPos API 함수 선언하기 (0) | 2021.08.28 |
[C#/WIN32] GetWindowPlacement API 함수 선언하기 (0) | 2021.08.28 |
[C#/WIN32] SetWindowPlacement API 함수 선언하기 (0) | 2021.08.28 |
[C#/WIN32] GetKeyState API 함수 선언하기 (0) | 2021.08.27 |
댓글을 달아 주세요