분류 전체보기

    SetComputerName - Computer Network 이름 바꾸기

    Declare Function SetComputerName Lib "Kernel32" Alias "SetComputerNameA" (ByVal IpComputerName As String) As Integer ▶C# 선언 If SetComputerName("OpenLab") = 0 Then MessageBox.Show("Computer 이름 바꾸기 실패") Else MessageBox.Show("Computer 이름 바꾸기 성공") End If ▶C# 호출 [System.Runtime.InteropServices.DllImport("Kernel32.dll")] private static extern int SetComputerName(string IpComputerName); ▶VB.NET 선언 if (..

    GetWindowsDirectory - 운영체제 설치경로

    Declare Function GetWindowsDirectory Lib "Kernel32" Alias "GetWindowsDirectoryA" (ByVal Name As String, ByVal Size As Integer) As Integer ▶VB.NET 선언 Dim sName As String = Space(10) GetWindowsDirectory(sName, 11) sName ▶VB.NET 호출 [System.Runtime.InteropServices.DllImport("Kernel32.dll")] private static extern int GetWindowsDirectory(StringBuilder Name, int Size); ▶C# 선언 StringBuilder sName = new ..

    GetUseName - 현재 윈도우 사용자 이름 구하기

    GetUseName는 윈도우 사용자의 이름을 구하는 API함수 입니다. 이 함수대신 다음과 같은 .net Class를 이용하십시오. System.Security.Principal.WindowsIdentity.GetCurrent.Name.Trim() ▶VB.NET System.Security.Principal.WindowsIdentity.GetCurrent().Name.Trim(); ▶C#

    GetkeyboardType - 키보드 관련 정보확인

    Declare Function GetKeyboardType Lib "user32" Alias "GetKeyboardType" (ByVal nTypeFlag As Integer) As Integer ▶VB.NET 선언 GetkeyboardType(0) GetkeyboardType(1) GetkeyboardType(2) ▶VB.NET 호출 [System.Runtime.InteropServices.DllImport("user32.dll")] private static extern int GetKeyboardType(int nTypeFlag); ▶C# 선언 GetKeyboardType(0).ToString(); GetKeyboardType(1).ToString(); GetKeyboardType(2).ToStri..

    SetCaretBlinkTime - Caret깜빡임 속도 지정

    SetCaretBlinkTime함수는 지정한 인수값만큼 Caret의 깜빡임 속도를 지정합니다. Declare Function SetCaretBlinkTime Lib "user32" Alias "SetCaretBlinkTime" (ByVal wMSeconds As Integer) As Integer ▶VB.NET 선언 SetCaretBlinkTime(속도값) ▶VB.NET 호출 [DllImport("user32.dll")] public static extern int SetCaretBlinkTime(int wMSeconds); ▶C# 선언 SetCaretBlinkTime(속도값); ▶C# 호출 SetCaretBlinkTime 함수실행시 인수로는 1/1000초 단위의 정수값을 기재하며 함수실행의 결과값으로 ..

    CopyCursor / CopyIcon - Cursor의 Handle 복사

    CopyCursor는 인수로 지정한 Cursor에 대한 Handle을 다른 Module에서도 사용이 가능하도록 광역 Handle값을 반환합니다. Declare Function CopyCursor Lib "user32" Alias "CopyIcon" (ByVal hcur As Integer) As Integer ▶VB.NET 선언 CopyCursor(handle) ▶VB.NET 호출 [DllImport("user32.dll")] public static extern int CopyIcon(int hcur); ▶C# 선언 CopyIcon(handle); ▶C# 호출 참고로 user32에는 실제 CopyCursor 함수가 존재하지 않습니다. 따라서 CopyIcon함수를 사용하여야 합니다. 이 함수가 성공적으로..

    UnloadKeyboardLayout - 지정한 Keyboard배열제거

    UnloadKeyboardLayout함수는 인수로 지정한 Keyboard언어배열을 현재의 Thread상에서 사용하지 않도록 제거합니다. Declare Function UnloadKeyboardLayout Lib "user32" Alias "UnloadKeyboardLayout" (ByVal HKL As Integer) As Integer ▶VB.NET 선언 UnloadKeyboardLayout(배열값) ▶VB.NET 호출 [DllImport("user32.dll")] public static extern int UnloadKeyboardLayout(int HKL); ▶C# 선언 UnloadKeyboardLayout(배열값); ▶C# 호출 함수의 인수로는 제거하고자 하는 배열번호를 기술하면 됩니다. 현재 ..

    SetSystemCursor - 새로운 Mouse Cursor의 설정

    SetSystemCursor함수는 새로운 Mouse Cursor를 설정하도록 합니다. Declare Function SetSystemCursor Lib "user32" Alias "SetSystemCursor" (ByVal hcur As Integer, ByVal id As Integer) As Integer ▶VB.NET 선언 SetSystemCursor(handle, id) ▶VB.NET 호출 [DllImport("user32.dll")] public static extern int SetSystemCursor(int hcur, int id); ▶C# 선언 SetSystemCursor(handle, id); ▶C# 호출 SetSystemCursor함수는 호출시 전달한 Handle값에 해당하는 Mous..