有关api的问题 #include <windows.h>#include <tlhelp32.h>以上是两个必须包含的头文件 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 哦,对了,谢谢.可是我现在还是得不到我要的结果,我哦是想显示机子现在所运行的线程的列表,可是看不到结果!!为什么呢代码如下:if(m_nProcess!=-1) return; HANDLE snapshot=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0); if(snapshot==NULL) return; m_lisProcess.SetRedraw(FALSE); SHFILEINFO shSmall; int nIndex; CString str; PROCESSENTRY32 processinfo; processinfo.dwSize=sizeof(processinfo); BOOL status=Process32First(snapshot,&processinfo); while(status) { m_nProcess++; ZeroMemory(&shSmall,sizeof(shSmall)); SHGetFileInfo(processinfo.szExeFile,0,&shSmall,sizeof(shSmall),SHGFI_ICON|SHGFI_SMALLICON); nIndex=m_imgSmall.Add(shSmall.hIcon); nIndex=m_lisProcess.InsertItem(m_nProcess,processinfo.szExeFile,nIndex); str.Format("%08X",processinfo.th32ProcessID); m_lisProcess.SetItemText(nIndex,1,str); str.Format("%08X",processinfo.th32ParentProcessID); m_lisProcess.SetItemText(nIndex,2,str); status=Process32Next(snapshot,&processinfo); } m_lisProcess.SetImageList(&m_imgSmall,LVSIL_SMALL); m_lisProcess.SetRedraw(TRUE); 提示的错误是"for information o how your program can cause an assertion failure,see the visual c++ documentation o asserts"我因为是刚学的,所以这些还不太懂,希望能予以赐教!!! 提示的错误是"for information o how your program can cause an assertion failure,see the visual c++ documentation o asserts"我因为是刚学的,所以这些还不太懂,希望能予以赐教!!! 不好意思,这种错误是由于某个指针指向了无效地址所致,单单看你的代码无法获得所要信息,你可以在程序可能出错的地方加上assert或者verify,获得错误出现的开始 clistbox实现鼠标左键拖动后,选中listbox的多行数据 对话框 打印 UPNP开启的问题! 灾难,最新消息 交流下专业书籍“阅读速度” 初学ATL,在基于CWindowImpl 的窗口上,怎样才能加上按钮、输入框等?哪里有这方面的代码实例? 如何在文本文件(*.txt)中实现查找啊???在线等啊!!! 我的窗口里有一个picture box,里面有图象,我想每次ondraw事件里都把他上面的内容重绘`怎样做? 有没有函数能直接判断文件是否已经打开? 谁有简单图形系统的源码 求源程序! 一个关于删除数据的简单问题,请快帮忙,急用!!!!!!!!!!
代码如下:
if(m_nProcess!=-1) return; HANDLE snapshot=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
if(snapshot==NULL) return; m_lisProcess.SetRedraw(FALSE);
SHFILEINFO shSmall;
int nIndex;
CString str; PROCESSENTRY32 processinfo;
processinfo.dwSize=sizeof(processinfo); BOOL status=Process32First(snapshot,&processinfo);
while(status)
{
m_nProcess++;
ZeroMemory(&shSmall,sizeof(shSmall));
SHGetFileInfo(processinfo.szExeFile,0,&shSmall,sizeof(shSmall),SHGFI_ICON|SHGFI_SMALLICON);
nIndex=m_imgSmall.Add(shSmall.hIcon);
nIndex=m_lisProcess.InsertItem(m_nProcess,processinfo.szExeFile,nIndex);
str.Format("%08X",processinfo.th32ProcessID);
m_lisProcess.SetItemText(nIndex,1,str);
str.Format("%08X",processinfo.th32ParentProcessID);
m_lisProcess.SetItemText(nIndex,2,str);
status=Process32Next(snapshot,&processinfo);
}
m_lisProcess.SetImageList(&m_imgSmall,LVSIL_SMALL);
m_lisProcess.SetRedraw(TRUE);
我因为是刚学的,所以这些还不太懂,希望能予以赐教!!!
我因为是刚学的,所以这些还不太懂,希望能予以赐教!!!
单单看你的代码无法获得所要信息,你可以在程序可能出错的地方加上assert或者verify,获得错误出现的开始