분류 전체보기

    GetWindowRect - Window의 위치및 크기 반환

    GetWindowRect함수는 화면상의 특정 Window에 대한 위치및 크기를 반환하는 함수입니다. Declare Function GetWindowRect Lib "user32" Alias "GetWindowRect" (ByVal hwnd As Integer, ByRef lpRect As RECT) As Integer - VB.NET 선언 [DllImport("user32")] public static extern int GetWindowRect(int hwnd, ref RECT lpRect); - C# 선언 선언 GetWindowRect함수의 첫번째 인수는 위치및 크기를 얻고자 하는 Window의 Handle을 지정하고 두번째 인수에 실제 위치와 크기에 대한 값이 저장될 구조체를 지정합니다. 여기서 사..

    DrawText - 화면에 Text문자열 출력

    DrawText는 화면상에 지정한 Text 내용을 출력합니다. Declare Function DrawText Lib "user32" Alias "DrawTextA" (ByVal hdc As Integer, ByVal lpStr As String, ByVal nCount As Integer, ByRef lpRect As RECT, ByVal wFormat As Integer) As Integer - VB.NET 선언 [DllImport("user32")] public static extern int DrawText(int hdc, string lpStr, int nCount, ref RECT lpRect, int wFormat); - C# 선언 DrawText함수의 첫번째 인수는 문자열을 표시할 장치의 H..

    DestroyCursor - Cursor의 제거

    DestroyCursor 함수는 지정한 Handle의 Mouse Cursor를 제거합니다. Declare Function DestroyCursor Lib "user32" Alias "DestroyCursor" (ByVal hCursor As Integer) As Integer - VB.NET 선언 DestroyCursor(Handle) - VB.NET 호출 [DllImport("user32.dll")] public static extern int DestroyCursor(int hCursor); - C# 선언 DestroyCursor(Handle); - C# 호출 DestroyCursor함수의 인수에는 제거하고자 하는 Cursor의 Handle을 지정합니다. 단, SystemCursor처럼 특정 Prog..

    DrawFrameControl - Frame Control 그리기

    DrawFrameControl함수는 인수로 지정한 다양한 형태의 Control을 그려 표시합니다. Declare Function DrawFrameControl Lib "user32" Alias "DrawFrameControl" (ByVal hDC As Integer, ByRef lpRect As RECT, ByVal un1 As Integer, ByVal un2 As Integer) As Integer - VB.NET 선언 [DllImport("user32")] public static extern int DrawFrameControl(int hDC, ref RECT lpRect, int nu1, int un2); - C# 선언 DrawFrameControl함수의 첫번째 인수로는 Control을 표시할 ..

    GetWindowDC - 현재 Windows화면의 Device Context 구하기

    GetWindowDC는 지정된 Windows화면에 대한 Device Context를 구하는 함수입니다. Declare Function GetWindowDC Lib "user32" Alias "GetWindowDC" (ByVal hwnd As Integer) As Integer - VB.NET 선언 [DllImport("user32")] public static extern int GetWindowDC(int hwnd); - C# 선언 GetWindowDC(handle) - VB.NET 호출 GetWindowDC(handle); - C# 호출 GetWindowDC함수의 인수로는 해당 Device Context를 구할 Windows화면의 Handle을 넘겨주면 됩니다. 이때 만일 현재 화면에 대한 Devic..

    GetDesktopWindow - 현재 Windows 화면의 Handle구하기

    GetDesktopWindow함수는 현재 표시된 Windows화면의 Handle을 반환합니다. Declare Function GetDesktopWindow Lib "user32" Alias "GetDesktopWindow" () As Integer - VB.NET 선언 [DllImport("user32")] public static extern int GetDesktopWindow(); - C# 선언 GetDesktopWindow() - VB.NET 호출 GetDesktopWindow(); - C# 호출 GetDesktopWindow함수가 성공적으로 실행되면 해당 Handle값을 반환하지만 그렇지 않으면 0을 반환합니다.

    GetDC - Window및 Control의 Device Context 구하기

    GetDC함수는 인수로 전달한 특정 Window나 Control의 Device Context 값을 반환합니다. Declare Function GetDC Lib "user32" Alias "GetDC" (ByVal hwnd As Integer) As Integer - VB.NET 선언 [DllImport("user32")] public static extern int GetDC(int hwnd); - C# 선언 함수의 인수로는 Device Context값을 구할 Window나 Control의 Handle을 지정하면 됩니다. 예를 들어 Program에서 실행할 Form의 Device Context를 구하는 경우라면 다음과 같이 함수를 호출할 수 있습니다. Dim idc As Integer idc = GetD..

    ClipCursor - Mouse의 이동영역 제한

    ClipCursor 함수는 Mouse Cursor를 움직일 수 있는 영역을 제한하는 함수 입니다. Declare Function ClipCursor Lib "user32" Alias "ClipCursor" (ByRef lpRect As Rectangle) As Integer - VB.NET 선언 Dim m_point As Rectangle = New Rectangle(Left, Top, Width, Height) ClipCursor(m_point) - VB.NET 호출 [DllImport("user32.dll")] public static extern int ClipCursor(ref Rectangle lpRect); - C# 선언 Rectangle m_point = new Rectangle(Left, ..