Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get hardware information
Message
 
 
À
14/11/2002 19:39:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00723017
Message ID:
00723056
Vues:
10
>I want to write a program to get the hardware information of computers. For example, how many memory, how many hard disks and how big each.
>
>Does anyone to know how to do this?
>
>
>Thanks

To show System Info dialog:
#define HKEY_LOCAL_MACHINE	0x80000002
#define gREGKEYSYSINFO		"SOFTWARE\Microsoft\Shared Tools\MSINFO"
#define gREGVALSYSINFO		"PATH"
#define SW_NORMAL			1

DECLARE LONG ShellExecute IN SHELL32.DLL ;
    LONG nWinHandle, STRING cOperation,;
    STRING cFileName, STRING cParameters,;
    STRING cDirectory, INTEGER nShowWindow

Local lcSysInfoPath

* Try To Get System Info Program Path\Name From Registry...
oReg = NewObject("registry", "libs\registry.prg")
lcSysInfoPath = oReg.ReadRegistryString(HKEY_LOCAL_MACHINE, gREGKEYSYSINFO, gREGVALSYSINFO)

If ShellExecute(0, "open", lcSysInfoPath, "", "", SW_NORMAL) <= 32
	MessageBox("System Information Is Unavailable At This Time")
endif
registry is a class by Rick Strahl. The code is taken from Hussars team Desktop application.

>
>
>Jim
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform