Click here to Skip to main content
12,399,799 members (51,579 online)
Click here to Skip to main content

Stats

73.4K views
1.8K downloads
170 bookmarked
Posted

ProSysLib: Dissecting the Process

, 22 Nov 2010 CPOL
Access detailed information about the current process the easiest way.
ProcessInfo.exe
ProSysLib.dll
Interop.ProSysLib.dll
Interop.ProSysLib.dll
ProcessInfo.exe
ProSysLib.dll
PSL64v0.9.dll
Interop.ProSysLib.dll
ProcessInfo.exe
PSL32v0.9.dll
ProSysLib_v0.9
Bin
PSL32v0.9.dll
PSL64v0.9.dll
Help
Samples
C#2008
ProcessInfo
Properties
ProcessViewer
Properties
VB6
CPUInfo.exe
CPUInfo.frm
CPUInfo.frx
CPUInfo.vbp
CPUInfo.vbw
VC2008
Deployment
Src
mssccprj.scc
ProSysLib.def
ProSysLib.rgs
ProSysLib.vcproj.vspscc
ProSysLib.vssscc
PSLSystem.rgs
PSLv0.5Setup.exe
PSLv0.7Setup.exe
///////////////////////////////////////////////////
// This C++ example illustrates simple use and
// deployment for the ProSysLib component.
//
// The sample retrieves property "Caption" from
// WMI class "Win32_OperatingSystem", and then
// prints the value on the screen.
///////////////////////////////////////////////////

#include "stdafx.h"

// File from which we import the type library (just for compilation);
#define PSL_FILE "../../../Bin/PSL32v0.9.dll"

#include "../PSLDeploy.h"	// Header that simplifies ProSysLib
							// component's deployment;

void main()
{
	CPSLDeploy PSLDeploy;

	LPCTSTR sPSLPath = _T("../../../../../Bin/PSL32v0.9.dll");

	if(sizeof(void*) == 8) // If process is 64-bit;
		sPSLPath = _T("../../../../../Bin/PSL64v0.9.dll");

	if(!PSLDeploy.Initialize(sPSLPath))
		return; // Failed to initialize the library;

	// Initializing COM - only because we use WMI interface below,
	// because generally it is not needed when using ProSysLib;
	::CoInitialize(NULL);

	ProSysLib::IPSLSystemPtr sys = PSLDeploy.CreateInstance(); // Creating ProSysLib root namespace;

	_bstr_t OSCaption = sys->Tools->WMI->GetValue(_T(""), _T("Win32_OperatingSystem"), _T("Caption"));
	
	_tprintf(OSCaption); // Display full name of the OS on the screen;
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Vitaly Tomilov
Software Developer (Senior) Sibedge IT
Ireland Ireland
My online CV: cv.vitalytomilov.com

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160721.1 | Last Updated 22 Nov 2010
Article Copyright 2008 by Vitaly Tomilov
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid