Click here to Skip to main content
15,881,173 members
Articles / Desktop Programming / MFC

Process, Module and Thread enumeration classes

Rate me:
Please Sign up or sign in to vote.
4.21/5 (9 votes)
15 May 2002Ms-PL3 min read 168.9K   5.4K   45  
3 simple classes for easy retrival of running processes, modules and threads
#pragma once
#include "EnhancedListCtrl.h"
#include "WinMgr.h"
#include "afxcmn.h"
#include "w32process.h"

// CDlgInfo dialog

class CDlgInfo : public CSizableDlg
{
	DECLARE_DYNAMIC(CDlgInfo)

public:
	explicit CDlgInfo(CModuleList* r);
	explicit CDlgInfo(CThreadList* r);
	virtual ~CDlgInfo();

// Dialog Data
	enum { IDD = IDD_INFO_DIALOG };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()
public:
	CEnhancedListCtrl m_cList;
	virtual BOOL OnInitDialog();

private:
	bool m_bIsModuleList;
	bool m_bSortAscending;
	int  m_nSortColumn;
	CModuleList* m_rModules;
	CThreadList* m_rThreads;

	friend int CALLBACK SortFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);


public:
	afx_msg void OnLvnColumnclickList1(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnDestroy();
};

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 Microsoft Public License (Ms-PL)


Written By
Software Developer (Senior)
Portugal Portugal
Software Smith, Blacksmith, Repeat Founder, Austrian, Asgardian.

Comments and Discussions