분류 전체보기

    SetForegroundWindow - 작업 Window설정

    SetForegroundWindow함수는 지정한 Window를 최상위로 끌어올려 Window작업을 Foreground로 전환합니다. Declare Function SetForegroundWindow Lib "user32" Alias "SetForegroundWindow" (ByVal hwnd As Integer) As Integer - VB.NET 선언 [DllImport("user32")] public static extern int SetForegroundWindow(int hwnd); - C# 선언 SetForegroundWindow함수는 작업을 전환하고자 하는 Window의 Handle을 인수로 전달하여 호출합니다. SetForegroundWindow(Handle) - VB.NET 호출 SetFo..

    DrawEdge - 테두리 그리기

    DrawEdge은 Window에 4각형 모양의 테두리를 그리는 함수 입니다. Declare Function DrawEdge Lib "user32" Alias "DrawEdge" (ByVal hdc As Integer, ByRef qrc As RECT, ByVal edge As Integer, ByVal grfFlags As Integer) As Integer - VB.NET 선언 [DllImport("user32")] public static extern int DrawEdge(int hdc, ref RECT qrc, int edge, int grfFlags); - C# 선언 DrawEdge의 첫번째 인수는 테두리를 그릴 Window창이나 화면의 Device Context를 기술합니다. [Windows ..

    LineTo - Line 그리기

    LineTo는 Window나 Control에 직선을 그리는 함수입니다. Declare Function LineTo Lib "gdi32" Alias "LineTo" (ByVal hdc As Integer, ByVal x As Integer, ByVal y As Integer) As Integer - VB.NET 선언 [DllImport("gdi32")] public static extern int LineTo(int hdc, int x, int y); - C# 선언 LineTo함수의 첫번째 인수는 Line을 그릴 Window나 Control의 Device Context가 기술되어야 합니다. [Windows API for .NET] - GetDC - Window및 Control의 Device Context ..

    IsIconic - Window의 최소화 여부 판단

    IsIconic함수는 지정한 Window가 현재 최소화 되어 있는지 여부를 판단합니다. Declare Function IsIconic Lib "user32" Alias "IsIconic" (ByVal hwnd As Integer) As Integer - VB.NET 선언 [DllImport("user32")] public static extern int GetWindowTextLength(int hwnd); - C# 선언 IsIconic함수의 인수로는 최소화 여부를 판단하고자 하는 Window의 Handle을 기술합니다. 예를 들어 Form2 Window가 최소화 되어 있는지 판단하려면 IsIconic함수는 다음과 같이 호출될 수 있습니다. IsIconic(Form2.Handle) - VB.NET 호출 ..

    GetWindow - 지정한 Window와의 관계 Window찾기

    GetWindow함수는 지정한 특정 Window로 부터 관계된 Window의 Handle을 반환합니다. Declare Function GetWindow Lib "user32" Alias "GetWindow" (ByVal hwnd As Integer, ByVal wCmd As Integer) As Integer - VB.NET 선언 [DllImport("user32")] public static extern int GetWindow(int hwnd, int wCmd); - C# 선언 GetWindow함수의 첫번째 인수는 관계 Window를 찾을 주 Window의 Handle을 지정하고 두번째 인수에서 지정한 Window와 어떤 관계에 있는 Window를 찾을 것인지를 지정합니다. 이때 어떤 관계의 Wind..

    FillRect - 채워진 사각형 그리기

    FillRect함수는 안이 채워진 사각형을 그리는 함수입니다. Declare Function FillRect Lib "user32" Alias "FillRect" (ByVal hdc As Integer, ByRef lpRect As RECT, ByVal hBrush As Integer) As Integer - VB.NET 선언 [DllImport("user32")] public static extern int FillRect(int hdc, ref RECT lpRect, int hBrush); - C# 선언 FillRect함수의 첫번째 인수는 실제 사각형을 그릴 Object의 Device Context를 지정해야 합니다. [Windows API for .NET] - GetDC - Window및 Contr..

    CreateSolidBrush - Solid형 Line을 그리는 Brush생성

    CreateSolidBrush함수는 다른 API를 통해 Graphic를 그릴때 사용되는 Solid Brush를 생성하고 생성된 해당 Brush의 Handle을 반환합니다. Declare Function CreateSolidBrush Lib "gdi32" Alias "CreateSolidBrush" (ByVal crColor As Integer) As Integer - VB.NET 선언 [DllImport("gdi32")] public static extern int CreateSolidBrush(int crColor); - C# 선언 CreateSolidBrush는 말 그대로 그림을 그릴 수 있는 붓을 생성하는데 이때 붓의 색상을 CreateSolidBrush함수의 인수로 전달해야 합니다. 예를 들어 파..

    GetTickCount - Windows가동 시간알아내기

    GetTickCount함수는 Windows OS가 처음 Booting된 이후 현재까지 작동된 시간을 1/00초단위로 반환합니다. Declare Function GetTickCount Lib "kernel32" Alias "GetTickCount" () As Integer - VB.NET 선언 [DllImport("kernel32")] public static extern int GetTickCount(); - C# 선언 다음은 MessageBox를 통해 GetTickCount함수의 반환값을 확인하는 예제입니다. MessageBox.Show(GetTickCount()) - VB.NET 호출 MessageBox.Show(GetTickCount().ToString()); - C# 호출