Bonjour à tous,
Je suis à la recherche de fonctions qui donnent des informations sur l'ordinateur sur lequel s'exécute le programme. Par exemple : système d'exploitation, nom du processeur, fréquence, disque dur, quantité de mémoire vive, etc.
Merci![]()








Bonjour à tous,
Je suis à la recherche de fonctions qui donnent des informations sur l'ordinateur sur lequel s'exécute le programme. Par exemple : système d'exploitation, nom du processeur, fréquence, disque dur, quantité de mémoire vive, etc.
Merci![]()
en voici quelques - unes, pour Windows s'entend :
Machine + OS
Disques durs :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 GetComputerName Retrieves the NetBIOS name of the local computer. GetComputerNameEx Retrieves the NetBIOS or DNS name of the local computer. GetComputerObjectName Retrieves the local computer's name in a specified format. GetCurrentHwProfile Retrieves the current hardware profile for the local computer. GetKeyboardType Retrieves information about the current keyboard. GetNativeSystemInfo Retrieves information about the current system for an application running under WOW64. GetSysColor Retrieves the current color of a display element. GetSystemDirectory Retrieves the path of the system directory. GetSystemInfo Retrieves information about the current system. GetSystemMetrics Retrieves system metrics and configuration settings. GetSystemWindowsDirectory Retrieves the path of the shared Windows directory on a multi-user system. GetSystemWow64Directory Retrieves the path of the system directory used by WOW64. GetUserName Retrieves the user name of the current thread. GetUserNameEx Retrieves the name of the user or other security principal associated with the calling thread. You can specify the format of the returned name. GetVersion Retrieves the version number of the operating system. GetVersionEx Retrieves the version of the current operating system. GetWindowsDirectory Retrieves the path of the Windows directory. IsProcessorFeaturePresent Determines whether a processor feature is supported by the current computer.
Mémoire :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3GetDiskFreeSpace Retrieves information about the specified disk, including the amount of free space on the disk. GetDiskFreeSpaceEx Retrieves information about the specified disk, including the amount of free space on the disk. GetDriveType Determines whether a disk drive is a removable, fixed, CD-ROM, RAM disk, or network drive.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 GlobalMemoryStatus Obtains information about the system's current usage of both physical and virtual memory. GlobalMemoryStatusEx Obtains information about the system's current usage of both physical and virtual memory.
sous Linux, il y a notamment le fichier /proc/cpuinfo qui donne des informations sur ton CPU








Merci pour vos indications.
jfgq> Ou as tu eu ces informations ? En général, comment emploie-t-on ces fonctions ? Par exemple :
Est-ce que c'est valide ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 char nom[50] ; nom = GetComputerName() ; printf("%s", nom) ;
merci.
voici un lien avec bcp de fonction Get* qui répondent à ta demande (je pense) avec des explications type MSDN : http://leb.net/wine/WinDoc/funcIndex-local.html
Nas'
On peut aussi taper GetComputerName sur Google et on tombe sur le MSDN en ligne. C'est très pratique.








Merci à tous pour vos réponses.
Partager