2019/08

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