Results 1 to 6 of 6

Thread: Why a chicken cross the road ?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2000
    Posts
    156

    Unhappy

    answer:cause she want to be on the other side.
    (not funny but u r here)

    i want to get info about my system :
    (freediskspace,globlsize,OperatingSystem,OperatingSysVer,
    VirtualDisks...)

    how can i get all that info by API function.
    The MORE I get to know,
    I realize that I know NOTHING !

  2. #2
    Addicted Member
    Join Date
    Jul 2000
    Location
    Scotland
    Posts
    184
    Several APIs needed, try these:

    I've dumped these here from an app i've developed that gets lots of information for the user. I can give you specific examples but your question was very generic. Ask

    Code:
    Private Declare Function GetDiskFreeSpace Lib "kernel32" Alias "GetDiskFreeSpaceA" _
     (ByVal lpRootPathName As String, lpSectorsPerCluster As Long, _
     lpBytesPerSector As Long, lpNumberOfFreeClusters As Long, _
     lpTotalNumberOfClusters As Long) As Long
    
    
    Public Declare Function NetBios Lib "netapi32.dll" Alias "Netbios" _
            (ByRef pncb As NTWRKCNTRLBLCK) As Byte
    
    Public Declare Function VarPtr Lib "MSVBVM50.DLL" (pVoid As Any) As Long
    
    Public Declare Function GetDiskFreeSpace Lib "kernel32" Alias "GetDiskFreeSpaceA" _
            (ByVal lpRootPathName As String, _
            lpSectorsPerCluster As Long, _
            lpBytesPerSector As Long, _
            lpNumberOfFreeClusters As Long, _
            lpTotalNumberOfClusters As Long) As Long
    
    Public Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" _
            (ByVal nDrive As String) As Long
    
    Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" ( _
              hpvDest As Any, ByVal hpvSource As Long, ByVal cbCopy As Long)
    
    Public Declare Function GetProcessHeap Lib "kernel32" () As Long
    
    Public Declare Function HeapAlloc Lib "kernel32" _
              (ByVal hHeap As Long, ByVal dwFlags As Long, ByVal dwBytes As Long) As Long
    
    Public Declare Function HeapFree Lib "kernel32" (ByVal hHeap As Long, _
              ByVal dwFlags As Long, lpMem As Any) As Long
    
    
    Declare Sub GetSystemInfo Lib "kernel32" (lpSystemInfo As SYSTEM_INFO)
    
    Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" (ByVal hKey As Long, _
        ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, _
        phkResult As Long) As Long
    
    Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" _
        (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, _
        lpType As Long, lpData As Any, lpcbData As Long) As Long
    
    Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
    
    Declare Function GetUserName Lib "advapi32.dll" _
        Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
    
    Declare Function GetComputerName Lib "kernel32" Alias _
        "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
    
    Declare Function GetVolumeInformation Lib "kernel32.dll" _
        Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, _
        ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Integer, _
        lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, _
        lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, _
        ByVal nFileSystemNameSize As Long) As Long
    
    Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" _
       (LpVersionInformation As OSVERSIONINFO) As Long
    
    Declare Sub GlobalMemoryStatus Lib "kernel32" (lpBuffer As _
       MEMORYSTATUS)

  3. #3
    Addicted Member
    Join Date
    Apr 2000
    Location
    Sheffield, England.
    Posts
    136
    Why don't you ask the chicken?

    Visual Basic 6 Enterprise Edition + SP4

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Jun 2000
    Posts
    156
    thanks Steven ,

    i know what API to use but i dont know what r the parameters
    to send.

    for start i want to : get globaldiskspace,freediskspace and the same for the memory.

    lirlir
    The MORE I get to know,
    I realize that I know NOTHING !

  5. #5
    Addicted Member
    Join Date
    Jul 2000
    Location
    Scotland
    Posts
    184
    lirlir

    I've a lot of code that does what you want, email me and I'll return a text file with it. You can hack away at it or ask me smaller questions.

    Steven

  6. #6
    Lively Member
    Join Date
    May 1999
    Location
    Singapore
    Posts
    116
    you can try a soft ware called API-Guide from http://kpdteam.tripod.com/apiguide/agreg.htm

    it is free...it contains 521 APIs for vb. You can try it...it has all the apis that you wouldf need...it has examples, instructions and a quick search tool provided
    YC Sim
    Teenage Programmer
    UIN 37903254



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width