Click here to Skip to main content
15,880,651 members
Articles / Programming Languages / VBScript

ProSysLib: Dissecting the Process

Rate me:
Please Sign up or sign in to vote.
4.84/5 (69 votes)
22 Nov 2010CPOL12 min read 127.9K   2.6K   174  
Access detailed information about the current process the easiest way.
#pragma once

typedef unsigned __int3264 ABIG;
typedef unsigned __int64 BIG64;

class CPSLUtilities
{
public:

	//////////////////////////////////////////////////
	// Method GetVariantBig;
	//
	// Attempts extraction of ABIG from a Variant,
	// optionally indicating whether there was an error
	// during extraction;
	static ABIG GetVariantBig(LPVARIANT pVar, bool * pError = NULL);


	//////////////////////////////////////////////////
	// Method SetVariantBig;
	//
	// Sets a 64-bit long value into the variant when
	// in 64-bit mode, and 32-bit when in 32-bit mode;
	static void SetVariantBig(LPVARIANT pVar, ABIG Value);


	///////////////////////////////////////////////////
	// Method SetVariant64Bit;
	//
	// Sets 64-bit long value into the variant when the
	// current OS is not Windows 2000, or 32-bit when it
	// is Windows 2000.
	//
	// This method handles the automation problem that
	// variant types VT_I8 and VT_UI8 are not supported
	// on Windows 2000;
	static void SetVariant64Bit(LPVARIANT pVar, BIG64 Value);


	//////////////////////////////////////////////////
	// Method GetLongFilePathDetails;
	//
	// Takes a full file path, presumably in the short
	// form, converts it into the long form and then
	// extracts three parameters from it: full path,
	// directory and the file name;
	static void GetLongFilePathDetails(LPCTSTR sPath, _bstr_t & filePath, _bstr_t & fileDir, _bstr_t & fileName);


	/////////////////////////////////////////////////
	// Method FixSysPath;
	//
	static void FixSysPath(tstring & path);

private:

	static tstring s_SystemFolder;
};

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)


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

Comments and Discussions