another way: you can create a BHO,which can monitor the url,when url equal "http://10.15.16.17",then post wm_close message to it. hwo to create a bho,you can see msdn example :"IEHelper"
The EnumChildWindows function enumerates the child windows that belong to the specified 懂了: parent window by passing the handle to each child window, in turn, to an application-defined callback function. EnumChildWindows continues until the last child window is enumerated or the callback function returns FALSE. BOOL EnumChildWindows( HWND hWndParent, // handle to parent window WNDENUMPROC lpEnumFunc, // callback function LPARAM lParam // application-defined value );
用API函数:
在定时器函数中用
EnumChilidWindow(....)函数
写个相关的回调函数,看MSDN中上面函数的帮助
获取文本
SendMessage(hwnd,WM_TEXT,..);
判断
关闭
PostMessage(....)
you can create a BHO,which can monitor the url,when url equal "http://10.15.16.17",then post wm_close message to it.
hwo to create a bho,you can see msdn example :"IEHelper"
枚举浏览器的所有子窗口,找到子窗口内容包含“http://10.15.16.17”就发送关闭窗口消息
但是很有可能IE窗口的标题并不是URL地址,这种方式还可行吗?
懂了:
parent window by passing the handle to each child window, in turn, to an application-defined callback function. EnumChildWindows continues until the last child window is enumerated or the callback function returns FALSE. BOOL EnumChildWindows(
HWND hWndParent, // handle to parent window
WNDENUMPROC lpEnumFunc, // callback function
LPARAM lParam // application-defined value
);