Click here to Skip to main content
15,896,557 members
Articles / Desktop Programming / MFC

Process viewer

Rate me:
Please Sign up or sign in to vote.
4.94/5 (104 votes)
9 Mar 2008CPOL9 min read 457.9K   22K   294  
Lists out the details of running processes in a system, loaded drivers, loaded dlls, version of each dll and process, process times, command line, owner, priority, GDI resource usage, privileges, loaded symbols, window heirarchy, autostart app finding and more.
#ifndef _PRIVILEGE_H_
#define _PRIVILEGE_H_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class CPrivilege  
{
   public:
       CPrivilege();
       CPrivilege( const CPrivilege& PrivilegeToCopy );
       const CPrivilege& operator= ( const CPrivilege& PrivilegeToAssign );
       virtual ~CPrivilege();

       bool GetPrivilegeDetails( LPCTSTR lpctszPrivilegeName_i );
       
       // Setter and getter for privilege
       void SetPrivilegeName( LPCTSTR lpctszPrivName_i )
       {
           m_csPrivilegeName = lpctszPrivName_i;
       }
       const CString& GetPrivilegeName() const 
       { 
           return m_csPrivilegeName; 
       }
       
       // Setter and getter for privilege description
       void SetPrivilegeDescription( LPCTSTR lpctszPrivDescription_i )
       {
           m_csPrivilegeDescription = lpctszPrivDescription_i;
       }
       const CString& GetPrivilegeDescription() const
       {
           return m_csPrivilegeDescription;
       }
       
       // Setter and getter privilege enabled status
       void SetPrivilegeEnabled( const bool PrivilegeEnabled_i )
       {
           m_PrivilegeEnabled = PrivilegeEnabled_i;
       }
       bool GetPrivilegeEnabled() const 
       { 
           return m_PrivilegeEnabled; 
       }

   protected:

       DWORD SetPrivilegeAttributes( const HANDLE hToken_i, const DWORD uAttribute_i );
       bool EnablePrivilege( const HANDLE hToken_i, const bool Enable_i );
       bool RemovePrivilege( const HANDLE hToken_i );

   private:

	   // Privilege mgr
	   friend class CProcessPrivilegeMgr;

       CString m_csPrivilegeName;
       CString m_csPrivilegeDescription;
       bool    m_PrivilegeEnabled;
};

#endif // _PRIVILEGE_H_

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 Microsoft
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions