Comment faire pourprendre les informations(config) d'un PC

Pilotex - 31 juil. 2001 à 12:57
Thomas Anderson Messages postés 8 Date d'inscription lundi 17 janvier 2005 Statut Membre Dernière intervention 1 février 2005 - 17 janv. 2005 à 14:39
Salut a tous. Je voudrais savoir comment faire pour prendre des informations (processeur, mémoires et résolution de l'écran) d'un ordinateur.

Merci

@+

3 réponses

Regarde les fonctions API suivantes:

Information sur la mémoire:

Public Declare Sub GlobalMemoryStatus Lib "kernel32" Alias "GlobalMemoryStatus" (lpBuffer As MEMORYSTATUS)

Public Type MEMORYSTATUS
dwLength As Long
dwMemoryLoad As Long
dwTotalPhys As Long
dwAvailPhys As Long
dwTotalPageFile As Long
dwAvailPageFile As Long
dwTotalVirtual As Long
dwAvailVirtual As Long
End Type

Information sur l'ordinateur

Public Declare Sub GetSystemInfo Lib "kernel32" Alias "GetSystemInfo" (lpSystemInfo As SYSTEM_INFO)

Public Type SYSTEM_INFO
dwOemID As Long
dwPageSize As Long
lpMinimumApplicationAddress As Long
lpMaximumApplicationAddress As Long
dwActiveProcessorMask As Long
dwNumberOrfProcessors As Long
dwProcessorType As Long
dwAllocationGranularity As Long
dwReserved As Long
End Type

Résolution de l'écran:

Utilise la fonction suivante

LargeurEcran = Screen.Width / Screen.TwipsPerPixelX
HauteurEcran = Screen.Height / Screen.TwipsPerPixelY
0
Merci de m'avoir répondu Pace.
Je sais pas pourquoi mais quand je lance il ne se passe rien. Voilà ce que j'ai fait:
j'ai copier tes deux codes dans un module. Puis dans la form je met:

Private Sub Command1_Click()
MsgBox SystemInfo
MsgBox MEMORYSTATUS

End Sub

Quand je lance le programme et que je clique sur le bouton y a des messages box avec rien dedans.

Comment fait ton pour qu'il y a les informations ???

Merci
0
Thomas Anderson Messages postés 8 Date d'inscription lundi 17 janvier 2005 Statut Membre Dernière intervention 1 février 2005
17 janv. 2005 à 14:39
Il faut que tu mette SYSTEM_INFO.[nom de la variable qui contient l'information]
De plus, avant il faut appeller les fonction que tu a déclarée :

GetSystemInfo
MsgBox SYSTEM_INFO.dwActiveProcessorMask
0
Rejoignez-nous