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.
Printable View
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.
Why don't you ask the chicken?
:)
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)
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
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
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