
开发核心过程:创建一个单文档的MFC工程,将其视图类的基类设置为CListView。
在视图类的PreCreateWindow函数中,设置列表为报表格式,如下:
BOOL CEnumWindowsProcView::PreCreateWindow(CREATESTRUCT&cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
cs.style |= LVS_REPORT | LVS_NOSORTHEADER//设置列表视为报表格式
return CListView::PreCreateWindow(cs)
}
有效。获得进程主窗口的方法:
EnumWindows:http://msdn.microsoft.com/en-us/library/ms633497(VS.85).aspx
其中第一个参数是自定义的回调函数EnumWindowsProc的地址,详见http://msdn.microsoft.com/en-us/library/ms633497(VS.85).aspx
EnumWindowsProc的第一个参数就是枚举到的窗口句柄,然后用GetWindowText获得窗口标题
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)