您的位置:首页 > 其它

在 CTreeCtrl 中枚举系统中的所有窗口!(I)

2007-10-27 07:50 549 查看
2001年02月05日 10:29:00
发信人: cvisual (贝贝), 信区: VisualC
标 题: 在 CTreeCtrl 中枚举系统中的所有窗口!(I)
发信站: BBS 水木清华站 (Tue May 19 14:35:11 1998)

本文将给出一个源程序
在一个对话框中的TreeCtrl中用树的形式枚举窗口

这是头文件

// WinList.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CWinList dialog

class CWinList : public CDialog
{
// Construction
public:
HWND m_hSelected;
CWinList(CWnd* pParent = NULL); // standard constructor
static BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam);
static BOOL CALLBACK EnumChildProc(HWND hwnd,LPARAM lParam);
void BuiltTree(HWND hWnd);

// Dialog Data
//{{AFX_DATA(CWinList)
enum { IDD = ID_WINLIST };
CTreeCtrl m_Tree;
//}}AFX_DATA

// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CWinList)
public:
virtual BOOL DestroyWindow();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL

// Implementation
protected:
void DrawFlash(HWND hWnd);
void Refresh();

// Generated message map functions
//{{AFX_MSG(CWinList)
virtual BOOL OnInitDialog();
afx_msg void OnRefresh();
afx_msg void OnSelchangedTree(NMHDR* pNMHDR, LRESULT* pResult);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
CFont TreeFont;
TV_INSERTSTRUCT TreeItem;
int RootPt;
HTREEITEM RootArray[10];
};

--
┌————┐
│ 贝 贝 │
└————┘

※ 来源:·BBS 水木清华站 bbs.net.tsinghua.edu.cn·[FROM: bbs.nju.edu.cn]

Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=3331
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: