2019/08

    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안에서 구현하고자 할때마다 편리하고도 간단하게..

    GetFocus - 현재 Focus에 있는 Form또는 Control의 handle값 반환

    GetFocus는 현재 Focus상태에 있는 Control이나 Form의 handle값을 반환하는 함수 입니다. Declare Function GetFocus Lib "user32" Alias "GetFocus" () As Integer ▶VB.NET 선언 GetFocus() ▶VB.NET 호출 [System.Runtime.InteropServices.DllImport("user32.dll")] private static extern int GetFocus(); ▶C# 선언 GetFocus() ▶C# 호출 참고로 이 함수는 Form이나 Control의 handle method의 반환값과 같습니다.

    GetActiveWindow - 현재 프로그램의 윈도우 핸들값

    Declare Function GetActiveWindow Lib "user32" Alias "GetActiveWindow" () As Integer ▶VB.NET 선언 GetActiveWindow() ▶VB.NET 호출 [System.Runtime.InteropServices.DllImport("user32.dll")] private static extern int GetActiveWindow(); ▶C# 선언 GetActiveWindow() ▶C# 호출 GetActiveWIndow는 현재 함수를 호출하고 있는 Program(Thread)과 관련된 Windows의 handle값을 반환합니다. 만일 관련된 Windows화면이 존재하지 않는 경우에는 null을 반환합니다.

    ActivateKeyboardLayout - Keyboard 언어별 선택함수

    ActivateKeyboardLayout - Keyboard 언어별 선택함수

    Windows OS에 다음과 같이 Keyboard가 언어별로 설정되어 있을때 ActivateKeyboardLayout 함수는 Keyboard설정중 하나를 선택할 수 있도록 합니다. Declare Function ActivateKeyboardLayout Lib "user32" Alias "ActivateKeyboardLayout" (ByVal HKL As Integer, ByVal flag As Integer) As Integer ▶VB.NET 선언 Private Const HKL_NEXT As Integer = 0 Private Const HKL_PREV As Integer = 1 ActivateKeyboardLayout(HKL_NEXT, 8) ▶VB.NET 호출 [System.Runtime.Intero..

    CopyMemory - Memory 복사

    Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByRef Destination As Char, ByRef Source As Char, ByVal Length As Integer) ▶VB.NET 선언 Dim a As Char = "X" Dim B As Char CopyMemory(B, a, 1) B ▶VB.NET 호출 [System.Runtime.InteropServices.DllImport("kernel32.dll")] public static extern void CopyMemory(ref char Destination, ref char Source, int Length); ▶C# 선언 char a = 'X'; char B = ' '; Co..