.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# 선..

    Windows API

    1. API API는 Application Programming Interface의 약자로 Software개발시에 특정기능을 구현하려고 처음부터 새로 Program을 작성하는 것이 아니라 다른 Library에 의해 이미 구현되어 있는 기능을 개발하고자 하는 Software에 손쉽게 추가할 수 있는 것을 말합니다. 예를 들어 영어사전이나 국어사전 Program을 구현하고자 하는 경우 Naver나 Google등에서 제공하는 API를 끌어다 쓰면 단 몇줄 만으로도 훌륭한 사전 Program을 개발할 수 있게 되는 것입니다. 여기서 Windows API는 System에 대한 각종 정보를 알아내거나 운영체제(OS : 여기서는 Windows)의 특정 기능을 Program안에서 구현하고자 할때마다 편리하고도 간단하게..