这是一本学习 window编程的很好的参考教材
源代码在线查看: enumprocesstestdlg.h
// EnumProcessTestDlg.h : header file
//
#if !defined(AFX_ENUMPROCESSTESTDLG_H__8D1404C3_9B1B_4641_81E5_F586C6871ED3__INCLUDED_)
#define AFX_ENUMPROCESSTESTDLG_H__8D1404C3_9B1B_4641_81E5_F586C6871ED3__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
/////////////////////////////////////////////////////////////////////////////
// CEnumProcessTestDlg dialog
class CEnumProcessTestDlg : public CDialog
{
// Construction
public:
CEnumProcessTestDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CEnumProcessTestDlg)
enum { IDD = IDD_ENUMPROCESSTEST_DIALOG };
CButton m_enum16;
CButton m_moduleButton;
CListCtrl m_mainlist;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CEnumProcessTestDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
CImageList m_imageList;
int m_enumMethod;
HICON m_hIcon;
void OnCustomDrawList(NMHDR *pNMHDR, LRESULT *pResult);
// Generated message map functions
//{{AFX_MSG(CEnumProcessTestDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnEnumerateprocesses();
afx_msg void OnPsapi();
afx_msg void OnToolhelp();
afx_msg void OnModule();
afx_msg void OnEnum16();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_ENUMPROCESSTESTDLG_H__8D1404C3_9B1B_4641_81E5_F586C6871ED3__INCLUDED_)