Windows API

    MapVirtualKeyEx - Virtual Keycode와 Scan Code의 상호 변환(Keyboard 설정)

    MapVirtualKeyEx는 Virtual Keycode를 Scan Code로 또는 Scan Code를 Virtual Keycode로 상호 변환하여 주는 함수 입니다. 이 함수는 MapVirtualKey함수와는 달리 Keycode값을 변환해 주는 동작방식은 같지만 마지막 인수에 Keyboard배열을 지정하여 해당 Keyboard의 Scan Code및 언어설정에 따라 Code를 변환하여 준다는 차이점이 있습니다. Declare Function MapVirtualKeyEx Lib "user32" Alias "MapVirtualKeyExA" (ByVal uCode As Integer, ByVal uMapType As Integer, ByVal dwhkl As Integer) As Integer ▶VB.NET..

    GetKeyboardLayoutList - System의 Keyboard Layout목록 반환

    GetKeyboardLayoutList는 Windows System에 설치된 모든 Keyboard의 Layout목록을 반환합니다. Declare Function GetKeyboardLayoutList Lib "user32" Alias "GetKeyboardLayoutList" (ByVal nBuff As Integer, ByRef lpList As Integer) As Integer ▶VB.NET 선언 Dim kbl(255) As Integer GetKeyboardLayoutList(254, kbl(0)) ▶VB.NET 호출 [System.Runtime.InteropServices.DllImport("user32.dll")] private static extern int GetKeyboardLayoutL..

    GetKeyNameText - Keyboard의 Key명칭 반환

    GetKeyNameText함수는 인수로 전달한 값에서 Scan Code에 해당하는 Bit와 맞는 key값을 토대로 Key의 명칭을 반환합니다. Declare Function GetKeyNameText Lib "user32" Alias "GetKeyNameTextA" (ByVal lParam As Integer, ByVal lpBuffer As String, ByVal nSize As Integer) As Integer ▶VB.NET 선언 Dim iKey As Integer Dim sName As String = Space(10) iKey = 30 * 65536 GetKeyNameText(iKey, sName, 10) sName ▶VB.NET 호출 [System.Runtime.InteropServices...

    IsWindowEnabled - Window 또는 Control의 입력가능 여부

    IsWindowEnabled 함수는 인수로 지정한 handle의 Window나 특정 Control이 Mouse또는 Keyboard의 입력을 받을 수 있는지에 대한 여부를 반환합니다. Declare Function IsWindowEnabled Lib "user32" Alias "IsWindowEnabled" (ByVal hwnd As Integer) As Integer ▶VB.NET 선언 IsWindowEnabled(Me.Handle) ▶VB.NET 호출 [DllImport("user32.dll")] private static extern int IsWindowEnabled(IntPtr hwnd); ▶C# 선언 IsWindowEnabled(this.Handle); ▶C# 호출 인수로 전달한 Window나 ..

    GetAsyncKeyState - 현재 Key상태 확인

    GetAsyncKeyState() 함수는 함수가 호출될때 함수의 인수에 지정한 Key가 눌려진 상태인지 혹은 눌려진 상태가 아닌지에 대한 값을 반환합니다. 또한 처음 GetAsyncKeyState()함수가 호출된 이 후 다시 GetAsyncKeyState()함수가 호출될때까지 해당 Key가 눌려진 상태에서 단 한번도 떨어지지 않았는가에 대한 여부도 판단할 수 있습니다. Declare Function GetAsyncKeyState Lib "user32" Alias "GetAsyncKeyState" (ByVal vKey As Integer) As Integer ▶VB.NET 선언 GetAsyncKeyState(16) '16인수는 Shift Key Code ▶VB.NET 호출 [System.Runtime.In..

    GetKeyState - 해당 Key가 눌려졌는지에 대한 상태값 반환

    GetKeyState 함수는 인수로 전달된 값에 해당하는 Key가 눌려졌는지의 여부를 Toggle 유형의 값으로 반환합니다. Declare Function GetKeyState Lib "user32" Alias "GetKeyState" (ByVal keyCode As Integer) As Short ▶VB.NET 선언 GetKeyState(65) ▶VB.NET 호출 [System.Runtime.InteropServices.DllImport("user32.dll")] private static extern short GetKeyState(int keyCode); ▶C# 선언 GetKeyState(65); ▶C# 호출 위 예제에서 함수를 호출할때 인수로 전달한 65는 'A' Key에 해당하는 Ascii Co..

    GetVersionEx - 운영체제 정보조회

    GetVersionEx는 운영체제의 Main Version및 Sub Version전, FlatForm정보등을 알아내는 API함수입니다. 이 함수대신 같은 기능을 수행하는 다음의 .NET Classes Library를 사용하십시오. System.Environment.OSVersion System.Environment.OSVersion.Platform '플렛폼명 System.Environment.OSVersion.Version.Major '주버전 System.Environment.OSVersion.Version.Minor '부버전 System.Environment.OSVersion.Version.Revision '수정버전 System.Environment.OSVersion.Version.Build '빌드번호..

    GetKeyboardState - Keyboard Key및 Mouse Button상태확인

    GetKeyboardState() 함수는 Keyboard의 Key입력이나 Mouse Button의 누름상태를 반환합니다. Private Declare Function GetKeyboardState Lib "user32" Alias "GetKeyboardState" (ByVal pbKeyState() As Byte) As Integer ▶VB.NET 선언 Private VirKey(256) As Byte GetKeyboardState(VirKey) VirKey(X) ▶VB.NET 호출 [System.Runtime.InteropServices.DllImport("user32.dll")] private static extern int GetKeyboardState(byte[] pbKeyState); ▶C# 선..