.NET/Windows API for .NET

    MoveToEx - 특정 시작점 이동

    MoveToEx함수는 그리기 위치의 시작점을 재설정하고 기존 위치값을 획득하는 함수입니다. Declare Function MoveToEx Lib "gdi32" Alias "MoveToEx" (ByVal hdc As Integer, ByVal x As Integer, ByVal y As Integer, ByRef lpPoint As POINTAPI) As Integer ▶VB.NET 선언 [DllImport("gdi32")] public static extern int MoveToEx(int hdc, int x, int y, ref POINTAPI lpPoint); ▶C# 선언 MoveToEx함수의 첫번째 인수는 시작점을 설정할 Device Context를 지정해야 합니다. [Windows API for ..

    Rectangle - 사각형 그리기

    Rectangle함수는 지정된 Device Context에 사각형 모양의 그림을 그립니다. Declare Function Rectangle Lib "gdi32" Alias "Rectangle" (ByVal hdc As Integer, ByVal x1 As Integer, ByVal y1 As Integer, ByVal x2 As Integer, ByVal y2 As Integer) As Integer ▶VB.NET 선언 [DllImport("gdi32")] public static extern int Rectangle(int hdc, int x1, int y1, int x2, int y2); ▶C# 선언 Rectangle의 첫번째 인수는 실제 사각형이 그려질 Object의 Device Context를 기..

    RoundRect - 모서리가 둥근 사각형 그리기

    RoundRect함수는 모서리가 둥근 사각형을 그리는 함수입니다. Declare Function RoundRect Lib "gdi32" Alias "RoundRect" (ByVal hdc As Integer, ByVal x1 As Integer, ByVal y1 As Integer, ByVal x2 As Integer, ByVal y2 As Integer, ByVal x3 As Integer, ByVal y3 As Integer) As Integer ▶VB.NET 선언 [DllImport("gdi32")] public static extern int RoundRect(int hdc, int x1, int y1, int x2, int y2, int x3, int y3); ▶C# 선언 RoundRect함수의..

    BitBlt - 지정된 영역을 Bitmap복사

    BitBlt함수는 인수로 지정된 해당 Device Context의 특정 영역을 Bitmap으로 복사하는 함수입니다. Declare Function BitBlt Lib "gdi32" Alias "BitBlt" (ByVal hDestDC As Integer, ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hSrcDC As Integer, ByVal xSrc As Integer, ByVal ySrc As Integer, ByVal dwRop As Integer) As Integer ▶VB.NET 선언 [DllImport("gdi32")] public static extern int B..

    ShowCursor - Mouse Cursor의 숨김/해제

    ShowCursor함수는 전달된 인수에 따라 Mouse Cursor를 숨기거나 숨김을 해제하는 함수입니다. Declare Function ShowCursor Lib "user32" Alias "ShowCursor" (ByVal bShow As Boolean) As Integer ▶VB.NET 선언 ShowCursor(False/True) ▶VB.NET 호출 [DllImport("user32.dll")] public static extern int ShowCursor(bool bShow); ▶C# 선언 ShowCursor(false/true); ▶C# 호출 인수가 false이면 숨김, true이면 숨김해제 입니다. 또한 ShowCursor함수에 의해 Mouse Cursor가 숨겨진 상태라 하더라도 Mous..

    StretchBlt - 지정된 영역을 Bitmap복사

    StretchBlt함수는 지정된 Device Context영역을 Bitmap복사합니다. 이 기능은 BitBlt함수와 같지만 StretchBit함수는 복사된 Bitmap을 늘이거나 축소하고 좌우대칭을 바꾸는등의 추가적인 작업이 가능합니다. Declare Function StretchBlt Lib "gdi32" Alias "StretchBlt" (ByVal hdc As Integer, ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hSrcDc As Integer, ByVal xSrc As Integer, ByVal ySrc As Integer, ByVal nSrcWidth As In..

    GetLocalTime - System상의 지역과 관련된 날짜및 시간구하기

    GetLocalTime함수는 현재 Windows System상에 설정된 지역에 따른 날짜및 시간을 반환하는 함수입니다. Declare Sub GetLocalTime Lib "kernel32" Alias "GetLocalTime" (ByRef lpSystemTime As SYSTEMTIME) ▶VB.NET 선언 [DllImport("kernel32")] public static extern void GetLocalTime(ref SYSTEMTIME lpSystemTime); ▶C# 선언 SYSTEMTIME는 반환되는 날짜및 시간을 저장할 구조체를 의미합니다. 이 구조체는 8개의 Member로 다음과 같이 선언되어야 합니다. Public Structure SYSTEMTIME Public wYear As Sh..

    DeleteFile - File삭제

    DeleteFile함수는 지정한 File을 삭제하는 함수입니다. Declare Function DeleteFile Lib "kernel32" Alias "DeleteFileA" (ByVal lpFileName As String) As Integer ▶VB.NET 선언 [DllImport("kernel32")] public static extern int DeleteFile(string lpFileName); ▶C# 선언 DeleteFile함수는 삭제할 File의 이름과 경로를 인수로 지정하면 됩니다. 예를 들어 C Dirve의 aaa.txt File을 삭제하려면 함수를 다음과 같이 호출할 수 있습니다. DeleteFile("C:\aaa.txt") ▶VB.NET 호출 DeleteFile("C:\\aaa.t..