|
-
Jul 27th, 2000, 06:31 AM
#1
Thread Starter
Addicted Member
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 !
-
Jul 27th, 2000, 06:38 AM
#2
Addicted Member
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)
-
Jul 27th, 2000, 06:38 AM
#3
Addicted Member
Why don't you ask the chicken?
Visual Basic 6 Enterprise Edition + SP4
-
Jul 27th, 2000, 06:47 AM
#4
Thread Starter
Addicted Member
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 !
-
Jul 27th, 2000, 07:03 AM
#5
Addicted Member
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
-
Jul 27th, 2000, 07:28 AM
#6
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|