Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get hardware information
Message
 
 
To
14/11/2002 19:39:43
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00723017
Message ID:
00723056
Views:
9
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform