⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index065.htm

📁 一本不错的VC编程的参考书
💻 HTM
字号:
<html>
<style type="text/css"><!--
.p9 {  font-family: "宋体"; font-size: 9pt}a        {text-transform: none; text-decoration: none;}
a:hover {text-decoration: underline; color: #FF0000;}
--></style>
<body background="../di2001.jpg">
<h3 align="center"><font COLOR="#AOAO99"></font></h3>
<table width="100%" border="1" cellspacing="1">
<tr><td><p align="center"><font color="#FF0000">如何检索原先的Task Manager应用程序使用的任务列表</font></td></tr>
<tr><td><p>
</Br>
原先的Task Manager应用程序显示顶层窗口的列表。为了显示该列表,窗口必须可见、包含一个标题以及不能被其他窗口拥有。调用CWnd:: GetWindow可以检索顶层窗口的列表,调用IsWindowVisible、GetWindowTextLength以及GetOwner可以确定窗口是否应该在列表中。下例将把TaskManager窗口的标题填充到列表中。<Br>
</Br>
void GetTadkList (CListBox&list)<Br>
{<Br>
&nbsp;CString strCaption<Br>
//Caption of window.<Br>
</Br>
&nbsp;list.ResetContent ()<Br>
//Clear list box.<Br>
</Br>
&nbsp;//Get first Window in window list.<Br>
&nbsp;ASSERT_VALID (AfxGetMainWnd ())<Br>
&nbsp;CWnd* pWnd=AfxGetMainWnd () ->GetWindow (GW_HWNDFIRST)<Br>
</Br>
&nbsp;//Walk window list.<Br>
&nbsp;while (pWnd)<Br>
&nbsp;{<Br>
&nbsp;// I window visible, has a caption, and does not have an owner?<Br>
&nbsp;if (pWnd ->IsWindowVisible()<Br>
&& pWnd ->GetWindowTextLength ()<Br>
&&! pWnd ->GetOwner ())<Br>
&nbsp;{<Br>
</Br>
//Add caption o window to list box.<Br>
</Br>
pWnd ->GetWindowText (strCaption)<Br>
</Br>
list.AddString (strCaption)<Br>
&nbsp;}<Br>
&nbsp;//Get next window in window list.<Br>
&nbsp;pWnd=pWnd ->GetWindow(GW_HWNDNEXT)<Br>
&nbsp;}<Br>
}<Br>
</Br>
</p></td></tr>
</table>
</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -