Kernel32.dll

SourceCoders

Member
Joined
Sep 25, 2003
Messages
22
Location
Germany, Erfurt
Who can tell me what functions this dll supports ?

I need a function which tells me the total physical memory.
And I need a hint how can I use this functions and how i bind it in my code.

Please fast, is it urgent !!!!!

Or where I can find a complete list of the dll functions.

Thanks
 
www.allapi.net contains the most commonly used API declarations and a description for them.
For memory you could try using the GlobalMemoryStatusEx API.
Remeber: That site contains declarations for VB6 so you have to change all declarations As Long to As Integer because VB6s Long is equal to .NETs Integer.
 
Code:
Private objCS As ManagementObjectSearcher
Private objMgmt As ManagementObject
Public m_strTPM As String

Public Sub memory()
        objCS = New ManagementObjectSearcher("SELECT * FROM Win32_ComputerSystem")
        For Each objMgmt In objCS.Get
            m_strTPM = objMgmt("totalphysicalmemory").ToString() 
        Next
End Sub

I hope this help.
Bye
 
You need to go to the Project menu -> References, and add a
reference to the System.Management DLL in your project.
 
Originally posted by SourceCoders
That ive tried to , but there is no class System.Management

Searched also in System.Environment... but also false !

Sorry friend :( I forgot to say you to add a reference to the correct dll.
Sorry again
 
THX a lot my friends.... it works....

i am just a beginner in VB .NET

but with your help i will learn it to be better ....


Now my last question:

Wer i can find a listing of all these infos

SELECT * FROM Win32_ComputerSystem
objMgmt("totalphysicalmemory").ToString()

Why do you know that the TotalMemory is written in WIN32_ComputerSystem and there in "totalphysicalmemory" ???

is there a list or something ?
 
Naaaaaa im not the best! Simply i have looked for this informations a week before you :D

Good coding !
 
Back
Top