.NET

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

    WindowFromPoint - 위치에 따른 Window의 Handle값 취득

    WindowFromPoint함수는 특정 위치에 있는 Window의 Handle을 반환하는 함 수 입니다. Declare Function WindowFromPoint Lib "user32" Alias "WindowFromPoint" (ByVal lpPoint As Point) As Integer ▶VB.NET 선언 [DllImport("user32.dll")] public static extern int WindowFromPoint(Point lpPoint); ▶C# 선언 함수의 인수로는 Handle을 가져올 Window가 있는 위치를 Point로 지정합니다. 아래는 현재 Form의 X, Y위치를 가리키는 예제입니다. Dim ptCursor As Point = New Point() ptCursor.X = ..

    SetSystemTime - System날짜및 시간설정

    SetSystemTime함수는 System의 날짜및 시간을 설정하는 함수입니다. Declare Function SetSystemTime Lib "kernel32" Alias "SetSystemTime" (ByRef lpSystemTime As SYSTEMTIME) As Integer ▶VB.NET 선언 [DllImport("kernel32")] public static extern int SetSystemTime(ref SYSTEMTIME lpSystemTime); ▶C# 선언 함수의 인수로는 변경할 시간이 저장된 SYSTEMTIME구조체를 기술하면 되는데 이 구조체는 다음과 같이 선언될 수 있습니다. Public Structure SYSTEMTIME Public wYear As Short '년도 Pub..

    CopyFile - File복사

    CopyFile함수는 인수로 지정한 File을 복사하는 함수입니다. Declare Function CopyFile Lib "kernel32" Alias "CopyFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal bFailIfExists As Boolean) As Integer ▶VB.NET 선언 [DllImport("kernel32")] public static extern int CopyFile(string lpExistingFileName, string lpNewFileName, bool bFailExists); ▶C# 선언 CopyFile함수의 첫번째 인수는 복사할 File의 위치및 이름을, 두번째 인수에..

    SetFileAttributes - File의 속성설정

    SetFileAttributes함수는 File의 속성을 설정합니다. Declare Function SetFileAttributes Lib "kernel32" Alias "SetFileAttributesA" (ByVal lpFileName As String, ByVal dwFileAttributes As Integer) As Integer ▶VB.NET 선언 [DllImport("kernel32")] public static extern int SetFileAttributes(string lpFileName, int dwFileAttributes); ▶C# 선언 SetFileAttributes함수의 첫번째 인수는 속성을 설정할 File이 있는 경로와 이름을 지정하고 두번째 인수에서는 File에 설정할 속성..