Windows API

    CreateCaret - Caret 생성

    CreateCaret함수는 새로운 Caret를 생성하는 함수입니다. Caret은 Textbox등에서 깜빡이는 일종의 Keyboard Cursor모양정도로 생각하시면 되겠습니다. Declare Function CreateCaret Lib "user32" Alias "CreateCaret" (ByVal hwnd As Integer, ByVal hBitmap As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer) As Integer ▶VB.NET 선언 CreateCaret(Handle, Bitmap, 가로크기, 세로크기) ▶VB.NET 호출 [DllImport("user32.dll")] public static extern int CreateCaret(..

    GetComputerName - Computer Name 보기

    Computer의 Network이름을 알아내는 API입니다. 이 API대신 다음 .NET Class Library를 사용하십시오. 이 Code는 Computer의 이름을 반환합니다. System.Windows.Forms.SystemInformation.ComputerName ▶VB.NET/C#

    SetFocus - Window Form및 Control Focus 설정

    SetFocus함수는 Window Form또는 특정 Control에 Focus가 위치하도록 합니다. Declare Function SetFocus Lib "user32" Alias "SetFocus" (ByVal hwnd As Integer) As Integer ▶VB.NET 선언 SetFocus(Handle) ▶VB.NET 호출 [DllImport("user32.dll")] private static extern int SetFocus(int hwnd); ▶C# 선언 SetFocus((int)Handle); ▶C# 호출 SetFocus함수 호출시 인수로 전달하는 값은 Focus를 줄 Window Form의 handle이나 Control의 handle값을 넘겨 주면 됩니다. 만일 함수의 인수로 정수가 아..

    RegisterHotKey - Windows Hotkey 설정

    RegisterHotKey함수는 특정 Key의 조합으로 Hotkey를 설정하여 특정 Process나 Software에 설정한 Hotkey를 활용할 수 있도록 합니다. Declare Function RegisterHotKey Lib "user32" Alias "RegisterHotKey" (ByVal hwnd As Integer, ByVal id As Integer, ByVal fsModifiers As Integer, ByVal vk As Integer) As Integer ▶VB.NET 선언 RegisterHotKey(handle, id, mod_key, key) ▶VB.NET 호출 [DllImport("user32.dll")] private static extern int RegisterHotKey(..

    UnregisterHotKey - 설정한 Hotkey의 해제

    UnregisterHotKey함수는 RegisterHotKey함수로 설정한 Hotkey를 더이상 사용하지 않도록 해제하는 함수입니다. Declare Function UnregisterHotKey Lib "user32" Alias "UnregisterHotKey" (ByVal hwnd As Integer, ByVal id As Integer) As Integer ▶VB.NET 선언 UnregisterHotKey(handle, id) ▶VB.NET 호출 [DllImport("user32.dll")] private static extern int UnregisterHotKey(int hwnd, int id); ▶C# 선언 UnregisterHotKey(handle, id); ▶C# 호출 함수의 인수중 hand..

    SetActiveWindow - Windows 최상위 활성화

    SetActiveWindow함수는 인수로 전달한 Handle의 Windows Form을 최상위로 이동시켜 활성화 합니다. Declare Function SetActiveWindow Lib "user32" Alias "SetActiveWindow" (ByVal hwnd As Integer) As Integer ▶VB.NET 선언 SetActiveWIndow(Handle) ▶VB.NET 호출 [DllImport("user32.dll")] private static extern int SetActiveWindow(int hwnd); ▶C# 선언 SetActiveWindow((int)handle); ▶C# 호출 SetActiveWindow함수의 인수로는 활성화하고자 하는 Form의 handle을 기술하시면 됩니다.

    OemKeyScan - OEM Ascii Code의 OEM Scan Code변환

    OemKeyScan함수는 0 ~ 255까지 OEM Ascii code를 기준으로 해당 값을 Scan code로 변환합니다. Declare Function OemKeyScan Lib "user32" Alias "OemKeyScan" (ByVal wOemChar As Integer) As Integer ▶VB.NET 선언 OemKeyScan(x) ▶VB.NET 호출 [DllImport("user32.dll")] private static extern int OemKeyScan(int wOemChar); ▶C# 선언 OemKeyScan(x); ▶C# 호출 x 에 0 ~ 255 까지의 OEM Ascii Code를 기술하면 해당 값을 OEM Scan Code로 변환합니다. OEM Scan Code는 Keyboar..

    MapVirtualKey - Virtual Keycode와 Scan Code의 상호 변환

    MapViraualKey함수는 Virtual Keycode를 Scan Code로 변환하거나 Scan Code를 Virtual Keycode로 변환하도록 합니다. Declare Function MapVirtualKey Lib "user32" Alias "MapVirtualKeyA" (ByVal wCode As Integer, ByVal wMapType As Integer) As Integer ▶VB.NET 선언 MapVirtualKey(code, type) ▶VB.NET 호출 [DllImport("user32.dll")] private static extern int MapVirtualKey(int wCode, int wMapType); ▶C# 선언 MapVirtualKey(code, type); ▶C# ..