首页 > C/C++开发工具专区 > VC技术 > 如何激活和关闭IE浏览器
2007
01-08

如何激活和关闭IE浏览器

//激活并打开IE
void lounchIE()
{
HWND h=FindWindowEx(NULL, NULL, NULL, “Microsoft Internet Explorer”);
ShellExecute(h, “open”, “http://www.pcvc.net”, NULL,NULL,SW_SHOWNORMAL);
}

//关闭IE及其它应用程序
void CloseIE()
{
int app = BSM_APPLICATIONS;
unsigned long bsm_app = (unsigned long)app;
BroadcastSystemMessage(BSF_POSTMESSAGE, &bsm_app, WM_CLOSE, NULL, NULL);
}


留下一个回复