.NET/Windows API for .NET

    RemoveDirectory - 지정한 Folder 삭제

    RemoveDirectory함수는 특정 Folder를 삭제합니다. Declare Function RemoveDirectory Lib "kernel32" Alias "RemoveDirectoryA" (ByVal lpPathName As String) As Integer ▶VB.NET 선언 [DllImport("kernel32")] public static extern int RemoveDirectory(string lpPathName); ▶C# 선언 함수의 인수로는 삭제할 Folder의 위치만 건네주면 됩니다. 예를 들어 'C:\'의 'AAA' Folder를 삭제하려면 RemoveDirectory 함수를 다음과 같이 선언합니다. RemoveDirectory("C:\aaa") ▶VB.NET 호출 Remove..

    GetSystemDirectory - Windows System Directory

    GetSystemDirectory함수는 Windows System Directory경로명을 반환합니다. 이 API대신 다음 .NET Class Library를 사용하십시오. Imports System.Environment SystemDirectory ▶VB.NET using System; Environment.SystemDirectory ▶C#

    SetWindowPos - Window종류및 크기와 표시 Level변경

    SetWindowPos함수는 Window의 형태, 크기, 표시Leve등 Window의 속성을 변경하는 함수입니다. Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos" (ByVal hwnd As Integer, ByVal hWndInsertAfter As Integer, ByVal x As Integer, ByVal y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer) As Integer ▶VB.NET 선언 [DllImport("user32")] public static extern int SetWindowPos(int hwnd, int hWndInser..

    GetSysColor - System 설정 색상정보

    Declare Function GetSysColor Lib "user32" Alias "GetSysColor" (ByVal nIndex As Integer) As Integer ▶VB.NET 선언 GetSysColor(X) ▶VB.NET 호출 [System.Runtime.InteropServices.DllImport("user32.dll")] private static extern int GetSysColor(int nIndex); ▶C# 선언 GetSysColor(X).ToString(); ▶C# 호출 인수값 반환값 0 윈도우 스크롤바 색상 1 윈도우 배경색상 2 윈도우 타이틀바 색상(활성화된 경우) 3 윈도우 타이틀바 색상(비활성화된 경우) 4 윈도우 메뉴 색상 5 윈도우 색상 6 - 7 메뉴의 텍스..

    SetParent - 부모 Window변경

    SetParent함수는 특정 Window의 부모 Window를 변경하는 함수입니다. Declare Function SetParent Lib "user32" Alias "SetParent" (ByVal hWndChild As Integer, ByVal hWndNewParent As Integer) As Integer ▶VB.NET 선언 [DllImport("user32")] public static extern int SetParent(int hWndChild, int hWndNewParent); ▶C# 선언 SetParent함수의 첫번째 인수는 변경할 대상 Window의 Handle을 두번째 인수에는 대상 Window에서 설정할 부모 Window의 Handle을 지정합니다. SetParent(Handle..

    ReleaseDC - Device Context 초기화

    ReleaseDC함수는 다른 함수에 의해 열린 Device Context를 닫고 초기화 시키는 함수입니다. Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Integer, ByVal hdc As Integer) As Integer ▶VB.NET 선언 [DllImport("user32")] public static extern int ReleaseDC(int hwnd, int hdc); ▶C# 선언 ReleaseDC 함수의 첫번째 인수는 Device Context와 관련된 Handle을 기술하며 두번째 인수에 초기화 하고자 하는 Device Context를 작성하도록 합니다. 예를 들어 현재 Window Desktop의 Device Context를 초기화 ..

    GetSystemInfo - System 정보조회

    GetSystemInfo함수는 Computer System의 각종 정보를 알아내는 API함수입니다. Declare Sub GetSystemInfo Lib "kernel32" Alias "GetSystemInfo" (ByRef SystemInfo As _SYSTEMINFO) Structure _SYSTEMINFO Public iOem As Integer Public iPgSize As Integer Public iApp_min_addr As Integer Public iApp_max_addr As Integer Public iActive_prs_mak As Integer Public iPrs_number As Integer Public iPrs_type As Integer Public iGranularit..

    ExitWindowsEx - System종료및 Logoff 하기

    ExitWindowsEx함수는 현재 System을 종료하거나 Logoff하는 함수입니다. Declare Function ExitWindowsEx Lib "user32" Alias "ExitWindowsEx" (ByVal uFlags As Integer, ByVal dwReserved As Integer) As Integer ▶VB.NET 선언 [DllImport("user32")] public static extern int ExitWindowsEx(int uFlags, int dwReserved); ▶C# 선언 ExitWindowsEx함수의 첫번째 인수는 함수가 어떤 동작을 수행할지 지정하는 Flag로서 다음 상수를 사용할 수 있습니다. 상수 값 설명 EWX_LOGOFF 0 Logoff 합니다. EWX..