Sender: Cvisual (Beibei), Letter Area: Visualc
Title: Enumerate all the windows in the system in CTREECTRL! (I)
Sending station: BBS Shuimu Tsinghua Station (Tue May 19 14:35:11 1998)
This article will give a source program
Enumerate the window in the form of TreeCtrl in a dialog
This is a header file
// WinList.h: Header File
//
/
// CWINLIST DIALOG
Class CWINLIST: PUBLIC CDIALOG
{
// construction
PUBLIC:
HWND M_HSELECTED;
CWINLIST (CWND * PParent = NULL); // Standard Constructionor
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];
}
-
┌ ---- ┐
│Babe │
└ ---- ┘
※ Source: · BBS Shuimu Tsinghua Station bbs.net.tsinghua.edu.cn · [from: bbs.nju.edu.cn]