.NET

    GetClassName - Window의 Class이름 구하기

    GetClassName은 지정된 Window의 Class이름을 가져오는 함수입니다. Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Integer, ByVal lpClassName As String, ByVal nMaxCount As Integer) As Integer - VB.NET 선언 [DllImport("user32")] public static extern int GetClassName(int hwnd, StringBuilder lpClassName, int nMaxCount); - C# 선언 선언 GetClassName함수의 첫번째 인수는 Class이름을 구할 Window의 Handle을 넘겨줍니다...

    GlobalMemoryStatus - 현재 Memory상태 구하기

    GlobalMemoryStatus는 현재 Memory상태에 관한 정보를 반환하는 함수입니다. Declare Sub GlobalMemoryStatus Lib "kernel32" Alias "GlobalMemoryStatus" (ByRef lpBuffer As MEMORYSTATUS)> - VB.NET 선언 Structure MEMORYSTATUS Public ilength As Integer Public iusepsent As Integer Public iphymem As Integer Public iphymem_avail As Integer Public ipage As Integer Public ipage_avail As Integer Public ivirmem As Integer Public ivirm..

    GetSystemTime - 현재 System의 날짜및 시간구하기

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

    CreateDirectory - Directory의 생성

    CreateDirectory함수는 Disk에 새로운 Folder를 생성하는 함수입니다. Declare Function CreateDirectory Lib "kernel32" Alias "CreateDirectoryA" (ByVal lpPathName As String, ByRef lpSecurityAttributes As SECURITY_ATTRIBUTES) As Integer - VB.NET 선언 [DllImport("kernel32")] public static extern int CreateDirectory(string lpPathName, ref SECURITY_ATTRIBUTES lpSecurityAttributes); - C# 선언 CreateDirectory함수의 첫번째 인수는 생성할 Fol..

    GetDriveType - Disk Drive 유형 판단

    GetDriveType함수는 지정한 Disk가 어떤 형태의 저장소인지를 판단합니다. Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Integer - VB.NET 선언 [DllImport("kernel32")] public static extern int GetDriveType(string nDrive); - C# 선언 GetDriveType함수호출시 확인하고자 하는 Drive의 최상위 경로만 지정해 주면 해당 Drive의 Type을 반환합니다. 예를 들어 C Drive의 유형을 파악하고자 한다면 다음처럼 호출될 수 있습니다. GetDriveType("C:\") - VB.NET 호출 ..

    SetSysColor - Windows System 색상 설정

    Private Declare Function SetSysColors Lib "user32.dll" (ByVal nChanges As Integer, ByRef lpSysColor As ieSystemColor, ByRef lpColorValues As Integer) As Integer - VB.NET 선언 Public Enum ieSystemColor As Integer iScrollBar = 0 iBackGround = 1 iActiveCaption = 2 iInactiveCaption = 3 iMenu = 4 iWindow = 5 iWindowFrame = 6 iMenuText = 7 iWindowText = 8 iCaptionText = 9 iActiveBorder = 10 iInactiveBor..

    MoveFile - File의 이동및 복사수행

    MoveFile함수는 지정한 File을 다른 곳으로 이동시키고 원래 File은 삭제하는 동작을 수행합니다. Declare Function MoveFile Lib "kernel32" Alias "MoveFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String) As Integer - VB.NET 선언 [DllImport("kernel32")] public static extern int MoveFile(string lpExistingFileName, string lpNewFileName); - C# 선언 MoveFile함수의 첫번째 인수는 이동시킬 대상 File을, 두번째 인수에는 복사해 넣을 위치를 지정합니다. 예를 들어 'C:\..

    IsWindowVisible - 특정 Window가 현재 화면에 보이는지 여부를 판단

    IsWindowVisible함수는 인수로 지정한 Window가 현재 화면에 나타나고 있는 상태인지를 판단합니다. 이는 다른 Window에 의해 해당 Window가 가려져 있는 경우도 포함됩니다. Declare Function IsWindowVisible Lib "user32" Alias "IsWindowVisible" (ByVal hwnd As Integer) As Integer - VB.NET 선언 [DllImport("user32")] public static extern int IsWindowVisible(int hwnd); - C# 선언 예를 들어 Form1 Window가 현재 화면이 보여지고 있는 상태인지를 판단하려면 IsWindowVisible함수는 다음과 같이 호출될 수 있습니다. IsWin..