您的位置:程序门 -> vc/mfc -> 网络编程



如何关闭ie窗口?急急急急


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


如何关闭ie窗口?急急急急[已结贴,结贴人:ghhhpy]
发表于:2007-07-17 21:53:42 楼主
要关闭所有的ie窗口,窗口个数不定,窗口标题不定,要怎么关闭啊?
不用terminateprocess!!
发表于:2007-07-17 22:04:261楼 得分:50
bool   callback   wndfunc(hwnd   hwnd,   lparam   lparam)
{ //关闭桌面所有窗口回调函数
cstring   str   =   " ";
cwnd   *pwnd   =   cwnd::fromhandle(hwnd);

if   (pwnd)
{
pwnd-> getwindowtext(str);

}

if((!str.isempty())   &&   (getparent(hwnd)   ==   null))
{
crect   rect;
pwnd-> getwindowrect(rect);
if(!rect.isrectempty()   &&   pwnd-> iswindowvisible())
{
if(str   !=   "program   manager ")
{
if(str   !=   "naisa   netbar   control ")
postmessage(hwnd,wm_close,0,0);
}
}
}

return   true;
}


extern   "c "   __declspec(dllexport)   int   killwindows(memstream   *pin,memstream   *pout)
{ //关闭桌面所有窗口
afx_manage_state(afxgetstaticmodulestate());

dword   dwparam   =   0;
if   (!enumwindows(wndfunc,   dwparam))
return   0;

return   1;
}
三年前写的,关闭窗口的。改成只关ie就行了


快速检索

最新资讯
热门点击