如何让BHO最小化IE 9(和IE 8)。 [英] How to get BHO to minimize IE 9 (and IE 8).

查看:78
本文介绍了如何让BHO最小化IE 9(和IE 8)。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下代码适用于使用IE 7的XP,但不适用于使用IE 9的Windows 7.有人可以为BHO代码提供一种方法来最小化IE 9(如果不同,可以使用IE 8)吗?谢谢。

The following code works on XP with IE 7, but does NOT work on Windows 7 with IE 9. Can someone please provide an approach for BHO code to minimize IE 9 (and IE 8 if different)? Thank you.

void STDMETHODCALLTYPE CInterceptorBHO::OnDocumentComplete(IDispatch *pDisp, VARIANT *pvarURL)
{
	// Retrieve the top-level window from the site.
	HWND hwnd;
	hr = m_spWebBrowser->get_HWND((LONG_PTR*)&hwnd);
	if (SUCCEEDED(hr))
	{
		// Get current window placement.
		WINDOWPLACEMENT wp;
		wp.length = sizeof(wp);
		GetWindowPlacement(hwnd, &wp);

		// Minimize window.
		wp.showCmd = SW_SHOWMINIMIZED;
		SetWindowPlacement(hwnd, &wp);
	}
}




Tech_Net_User



Tech_Net_User

推荐答案

它可能是对IE的保护,因此恶意代码无法隐藏窗口,或者可能是您没有获得预期的HWND。  您是否在不工作时验证了返回的HWND?  另外,您是否尝试过SW_MINIMIZE?
It could be a protection of IE so malicious code cannot hide the window or it could be that you are not getting the expected HWND.  Have you verified the HWND returned when it isn't working?  Also, have you tried with SW_MINIMIZE?


这篇关于如何让BHO最小化IE 9(和IE 8)。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆