锘??xml version="1.0" encoding="utf-8" standalone="yes"?>日韩视频一区二区,亚洲免费av电影,亚洲午夜女主播在线直播http://m.shnenglu.com/mydriverc/category/4795.html濡傛灉鎯抽寰楅珮錛屽氨璇ユ妸鍦板鉤綰垮繕鎺?/description>zh-cnMon, 19 May 2008 13:36:41 GMTMon, 19 May 2008 13:36:41 GMT60ATL 瀹炵幇瀹氬埗鐨?IE 嫻忚鍣ㄦ爮銆佸伐鍏鋒爮鍜屾闈㈠伐鍏鋒爮 http://m.shnenglu.com/mydriverc/articles/29017.html鏃呴?/dc:creator>鏃呴?/author>Mon, 30 Jul 2007 08:00:00 GMThttp://m.shnenglu.com/mydriverc/articles/29017.htmlhttp://m.shnenglu.com/mydriverc/comments/29017.htmlhttp://m.shnenglu.com/mydriverc/articles/29017.html#Feedback0http://m.shnenglu.com/mydriverc/comments/commentRss/29017.htmlhttp://m.shnenglu.com/mydriverc/services/trackbacks/29017.htmlATL 瀹炵幇瀹氬埗鐨?IE 嫻忚鍣ㄦ爮銆佸伐鍏鋒爮鍜屾闈㈠伐鍏鋒爮

浣滆咃細鏉ㄨ佸笀

涓嬭澆婧愪唬鐮?/font>

鍏抽敭瀛?/strong>錛欱and錛孌esk Band錛孍xplorer Band錛孴ool Band錛屾祻瑙堝櫒鏍忥紝宸ュ叿鏍忥紝妗岄潰宸ュ叿鏍?br>
涓銆佸紩璦
銆銆鏈榪戯紝鐢變簬宸ヤ綔鐨勮姹傦紝鎴戦渶瑕佸湪 IE 涓婂仛涓浜涘紑鍙戝伐浣溿備簬鏄湪 MSDN 涓婄炕闃呬簡涓浜涜祫鏂欙紝鏍規嵁 MSDN 涓婄殑璇存槑鎴戠敤 ATL 鑳滃埄瀹屾垚浜?#8220;璧勬湰瀹惰佹澘”鍒嗛厤鐨勪換鍔°?br>錛堝茍涓斿湪鐧藉ぉ鐫¤鐨勮繃紼嬩腑姊﹀埌浜嗚佹澘緇欐垜鍔犲伐璧勫暒......錛?br>鐜板湪錛屾垜鎶?MSDN 涓婄殑鍘熸枃璧勬枡錛岀粡榪囩炕璇戞暣鐞嗗茍鎶婁竴涓?ATL 鐨勫疄鐜板璐ょ粰 VCKBASE 涓婄殑鏈嬪弸浠?/p>


銆銆鍦ㄧ炕璇戠殑榪囩▼涓紝鏈変袱涓瘝姹囬潪甯鎬笉濂界悊瑙c傜涓涓瘝鏄?Band 瀵硅薄錛岃瘝鍏鎬腑緲昏瘧涓?#8220;闀惰竟銆佽瀛愯竟銆佸甫瀛愩佷箰闃?.....”鎴戠殑鑻辨枃姘村鉤鏈夐檺錛屽疄鍦ㄤ笉鐭ラ亾搴旇緲昏瘧涓轟粈涔堣瘝姹囨洿鍚堥傘備簬鏄垜姣呯劧鍐崇劧鍦板喅瀹氾細鍦ㄥ涓嬬殑璁鴻堪涓紝渚濈劧浣跨敤 band 榪欎釜璇嶏紒錛堜粈涔堬紵娌″惉鏄庣櫧錛熸垜鐨勬剰鎬濆氨鏄錛屾垜涓嶇炕璇戣繖涓瘝浜嗭級浣嗗埌搴?Band 瀵硅薄搴旇濡備綍鐞嗚В閭o紵璇風湅鍥句竴錛?br>

鍥句竴

銆銆鍥句竴涓敾綰㈠湀鐨勫湴鏂癸紝鍒嗗埆縐頒綔“鍨傜洿鐨勬祻瑙堝櫒鏍?#8221;銆?#8220;姘村鉤鐨勬祻瑙堝櫒鏍?#8221;銆?#8220;宸ュ叿鏍?#8221;鍜?#8220;妗岄潰宸ュ叿鏍?#8221;銆傝繖浜?#8220;鏍?#8221;錛岄兘鍙互鍦?IE 鐨?#8220;鏌ョ湅”鑿滃崟涓垨榧犳爣鍙抽敭鐨勪笂涓嬫枃蹇嵎鏂瑰紡鑿滃崟涓樉紺烘垨闅愯棌璧鋒潵銆傝繖浜涚晫闈㈢獥鍙g殑瀹炵幇錛屽叾瀹炲氨鏄疄鐜頒竴縐?COM 鎺ュ彛瀵硅薄錛岃岃繖涓璞″彨 band銆傝繖涓蹇靛疄鍦ㄦ槸鍙兘鎰忎細鑰屾棤娉曡█浼犵殑錛屾垜鎬諱笉鑳藉湪鏂囩珷涓妸瀹冪炕璇戜負“鎬繪槸闈犲湪 IE 涓葷獥鍙h竟涓婄殑瀵硅薄”鍚э紵^_^
銆銆鍙﹀錛岃繕鏈変竴涓瘝鍙?site銆傝繖涓緢濂界炕璇戯紝鍙?#8220;绔欑偣”錛併傚懙鍛碉紝鎴戞暍鎵撳寘紲紝濡傛灉浣犺鑳界悊瑙h繖涓炕璇戝湪璁$畻鏈虹被鏂囩珷涓殑鍚箟錛岄偅灝卞彧鑳芥伃鍠滀綘浜嗭紝浣犵殑鏅烘収澶珮浜嗐傦紙閮芥槸瀛﹁綆楁満杞歡鐨勪漢錛屽仛浜虹殑宸窛鍜嬪氨榪欎箞澶у憿錛燂級鍦ㄦ湰綃囨枃绔犱腑錛宻ite 鍙互榪欐牱鐞嗚В錛欼E 鐨勪富妗嗘灦鍥涘懆錛屽氨濂芥瘮鏄?#8220;姹借濺绔?#8221;錛岄偅浜?band 瀵硅薄錛屽氨濂芥瘮鏄?#8220;姹借濺”銆俠and 姹借濺鎬繪槸鍙互鍋滈潬鍦?#8220;姹借濺绔?#8221;涓娿傛墍浠ワ紝site 灝辨槸“绔欑偣”錛屽畠涔熸槸 COM 鎺ュ彛鐨勫璞★紙IObjectWithSite銆両InputObjectSite錛夈?br>


3.1銆鍩烘湰 band 瀵硅薄
銆銆Band 瀵硅薄錛屼粠 Shell 4.71(IE 5.0) 寮濮嬫彁渚涙敮鎸併侭and 鏄竴涓?COM 瀵硅薄錛屽繀欏繪斁鍦ㄤ竴涓鍣ㄤ腑鍘諱嬌鐢紝褰撶劧浣跨敤瀹冧滑灝卞ソ璞′嬌鐢ㄦ櫘閫氱獥鍙f槸涓鏍風殑銆侷E 灝辨槸涓涓鍣紝妗岄潰 Shell 涔熸槸涓涓鍣紝瀹冧滑鎻愪緵涓嶅悓鐨勫嚱鏁板姛鑳斤紝浣嗗熀鏈殑瀹炵幇鏄浉浼肩殑銆?br>銆銆Band 瀵硅薄鍒嗕笁縐嶇被鍨嬶紝嫻忚鍣ㄦ爮 band錛圗xplorer bands錛夈佸伐鍏鋒爮 band錛圱ool Bands錛夊拰妗岄潰宸ュ叿鏍?Desk bands)錛岃屾祻瑙堝櫒鏍?band 鍙堟湁涓ょ琛ㄧ幇褰㈠紡錛氬瀭鐩村拰姘村鉤鐨勩傞偅涔?IE 鍜?Shell 濡備綍鍖哄垎騫跺姞杞借繖浜?bands 瀵硅薄鍛紵鏂規硶鏄細浣犺瀵逛笉鍚岀殑 band 瀵硅薄錛屽湪娉ㄥ唽琛ㄤ腑娉ㄥ唽涓嶅悓鐨勭粍浠剁被鍨嬶紙CATID錛夈?br>

Band 鏍峰紡

緇勪歡綾誨瀷

CATID

鍨傜洿鐨勬祻瑙堝櫒鏍?/td> CATID_InfoBand 00021493-0000-0000-C000-000000000046
姘村鉤鐨勬祻瑙堝櫒鏍?/td> CATID_CommBand 00021494-0000-0000-C000-000000000046
妗岄潰鐨勫伐鍏鋒爮 CATID_DeskBand 00021492-0000-0000-C000-000000000046

銆銆IE 宸ュ叿鏍忎笉浣跨敤緇勪歡綾誨瀷娉ㄥ唽錛岃屾槸浣跨敤鍦ㄦ敞鍐岃繘琛?CLSID 鐨勭櫥璁版柟寮忋傝緇嗘儏鍐佃 3.3銆?br>銆銆鍦ㄤ緥瀛愮▼搴忎腑錛屽疄鐜頒簡鍏ㄩ儴鍥涗釜綾誨瀷鐨?band 瀵硅薄錛屽瀭鐩存祻瑙堝櫒鏍?CVerticalBar)鏄劇ず浜嗕竴涓?HTML 鏂囦歡錛屽茍涓斿疄鐜頒簡瀵?IE 涓葷獥鍙f祻瑙堢綉欏電殑瀵艱埅絳夊姛鑳斤紱姘村鉤鐨勬祻瑙堝櫒鏍?CHorizontalBar)鏄竴涓紪杈戠獥錛屽畠鍚屾鏄劇ず褰撳墠緗戦〉鐨?BODY 婧愭枃浠跺唴瀹癸紱IE 宸ュ叿鏍?CToolBar)鏈綆鍗曪紝鍙槸娣誨姞浜嗕竴涓┖鐨勫伐鍏鋒爮錛涙闈㈠伐鍏鋒爮(CDeskBar)瀹炵幇浜嗕竴涓崟琛岀紪杈戠獥鍙o紝浣犲彲浠ュ湪涓婇潰杈撳叆鍛戒護琛屾垨鏂囦歡鍚嶇О錛屽洖杞﹀悗瀹冧細鎵ц Shell 鐨勬墦寮鍔ㄤ綔銆?br>
3.2銆蹇呴』瀹炵幇鐨?COM 鎺ュ彛
銆銆Band 瀵硅薄鏄?IE 鎴?Shell 鐨勮繘紼嬪唴鏈嶅姟鍣紝鎵浠ュ畠琚寘瑁呭湪 DLL 涓傝屼綔涓?COM 瀵硅薄錛屽畠蹇呴』瑕佸疄鐜?IUnknown 鍜?IClassFactory 鎺ュ彛銆傦紙澶у鍙互涓嶅悓鎿嶅績錛屽洜涓烘垜浠敤 ATL 鍐欑▼搴忥紝榪欎袱涓帴鍙f槸涓嶇敤鎴戜滑鑷繁鍐欎唬鐮佺殑銆傦級鍙﹀錛孊and 瀵硅薄榪樺繀欏誨疄鐜?IDeskBand銆両ObjectWithSite 鍜?IPersistStream 涓変釜鎺ュ彛錛?br>銆銆IPersistStream 鏄寔緇ф帴鍙g殑涓縐嶃傚綋 IE 鍔犺澆 band 瀵硅薄鐨勬椂鍊欙紝瀹冮氳繃榪欎釜鎺ュ彛鐨?Load 鏂規硶浼犻掑睘鎬у肩粰瀵硅薄錛岃鍏惰繘琛屽垵濮嬪寲錛涜屽綋鍗歌澆鍓嶏紝IE 鍒欒皟鐢ㄨ繖涓帴鍙g殑 Save 鏂規硶淇濆瓨瀵硅薄鐨勫睘鎬с傜敤 ATL 瀹炵幇榪欎釜鎺ュ彛寰堢畝鍗曪細

class ATL_NO_VTABLE Cxxx : 	......	public IPersistStreamInitImpl, // 娣誨姞緇ф壙	......{public:	BOOL m_bRequiresSave; // IPersistStreamInitImpl 鎵蹇呴』鐨勫彉閲?.....BEGIN_COM_MAP(CVerticalBar)	......	COM_INTERFACE_ENTRY2(IPersist, IPersistStreamInit)	COM_INTERFACE_ENTRY2(IPersistStream, IPersistStreamInit)	COM_INTERFACE_ENTRY(IPersistStreamInit)	......END_COM_MAP()BEGIN_PROP_MAP(Cxxx)...... // 娣誨姞闇瑕佹寔緇х殑灞炴ND_PROP_MAP()		
銆銆涓婇潰鐨勪唬鐮侊紝鍏跺疄瀹炵幇鐨勬槸 IPersistStreamInit 鎺ュ彛錛屼笉榪囨病鏈夊叧緋伙紝鍥犱負 IPersistStreamInit 媧劇敓鑷?IPersistStream錛屽疄渚嬪寲浜嗘淳鐢熺被錛岃嚜鐒跺氨瀹炰緥鍖栦簡鍩虹被銆傚湪渚嬪瓙紼嬪簭涓紝鎴戝彧鍦ㄦ闈㈠伐鍏鋒爮瀵硅薄涓坊鍔犱簡鎸佺畫鎬у睘鎬э紝鐢ㄦ潵淇濆瓨鍜屽垵濮嬪寲“鍛戒護琛?#8221;銆傚彟澶?COM_INTERFACE_ENTRY2(A錛孊)琛ㄧず鐨勫惈涔夋槸錛氬鏋滄兂鏌ヨA鎺ュ彛鐨勬寚閽堬紝鍒欐彁渚汢鎺ュ彛鎸囬拡鏉ヤ唬鏇褲備負浠涔堝彲浠ヨ繖鏍烽偅錛熷洜涓築鎺ュ彛媧劇敓鑷狝鎺ュ彛錛岄偅涔圔鎺ュ彛鐨勫墠鍑犱釜鍑芥暟蹇呯劧灝辨槸A鎺ュ彛鐨勫嚱鏁頒簡錛岃嚜鐒禕鎺ュ彛鐨勫湴鍧鍏跺疄鍜孉鎺ュ彛鐨勫湴鍧鏄竴鏍風殑浜嗐?br>銆銆IObjectWithSite 鏄?IE 鐢ㄦ潵瀵規彃浠惰繘琛岀鐞嗗拰閫氳鐢ㄧ殑涓涓帴鍙c傚繀欏昏瀹炵幇榪欎釜鎺ュ彛鐨?涓嚱鏁幫細SetSite() 鍜?GetSite()銆傚綋 IE 鍔犺澆 band 瀵硅薄鍜岄噴鏀?band 瀵硅薄鐨勬椂鍊欙紝閮借璋冪敤 SetSite()鍑芥暟錛岄偅涔堝湪榪欎釜鍑芥暟閲屾濂芥槸鍐欏垵濮嬪寲鍜岄噴鏀炬搷浣滀唬鐮佺殑鍦版柟錛?
STDMETHODIMP Cxxx::SetSite(IUnknown *pUnkSite){	if( NULL == pUnkSite )	// 閲婃斁 band 鐨勬椂鍊?{		// 濡傛灉鍔犺澆鐨勬椂鍊欙紝淇濆瓨浜嗕竴浜涙帴鍙?	// 閭d箞鐜板湪錛氶噴鏀懼畠	}	else	// 鍔犺澆 band 鐨勬椂鍊?{		m_hwndParent = NULL;	// 瑁呰澆 band 鐨勭埗紿楀彛(灝辨槸甯︽湁鏍囬鐨勯偅涓鏋剁獥鍙?		// 榪欎釜紿楀彛鐨勫彞鏌勶紝鏄皟鐢?IUnknown::QueryInterface() 寰楀埌 IOleWindow		// 鐒跺悗璋冪敤 IOleWindow::GetWindow() 鑰岃幏寰楃殑銆?	CComQIPtr< IOleWindow, &IID_IOleWindow > spOleWindow(pUnkSite);		if( spOleWindow )	spOleWindow->GetWindow(&m_hwndParent);		if( !m_hwndParent )	return E_FAIL;				// 鐜板湪錛屾濂芥槸寤虹珛瀛愮獥鍙g殑鏃舵満銆?	// 娉ㄦ剰錛屽瓙紿楀彛寤虹珛鐨勬椂鍊欙紝涓嶈浣跨敤 WS_VISIBLE 灞炴?	... ...		// 鍦ㄤ緥瀛愮▼搴忎腑錛岀敤 CAxWindow 瀹炵幇浜嗕竴涓兘鍖呭ActiveX鐨勫鍣ㄧ獥鍙?鍨傜洿嫻忚鍣ㄦ爮)		// 鍦ㄤ緥瀛愮▼搴忎腑錛岀敤 WIN API 鍑芥暟 CreateWindow 瀹炵幇浜嗘爣鍑嗙獥鍙?姘村鉤嫻忚鍣ㄦ爮銆佸伐鍏鋒爮)		// 鍦ㄤ緥瀛愮▼搴忎腑錛岀敤 CWindowImpl 瀹炵幇浜嗕竴涓寘瀹圭獥鍙?妗岄潰宸ュ叿鏍?		/*********************************************************/		   浠ヤ笅閮ㄥ垎錛屾牴鎹?band 瀵硅薄鐗規湁鐨勫姛鑳斤紝鏄彲浠ラ夋嫨瀹炵幇鐨?	**********************************************************/				// 濡傛灉瀛愮獥鍙e疄鐜頒簡鐢ㄦ埛杈撳叆錛岄偅涔堝繀欏誨疄鐜?IInputObject 鎺ュ彛錛?	// 鑰岃鎺ュ彛鏄 IE 鐨?IInputObjectSite 璋冪敤鐨勶紝鍥犳鍦ㄤ綘鐨勫璞?	// 涓紝搴旇淇濆瓨 IInputObjectSite 鐨勬帴鍙f寚閽堛?	// 鍦ㄧ被鐨勫ご鏂囦歡涓紝瀹氫箟錛?	// CComQIPtr< IInputObjectSite, &IID_IInputObjectSite > m_spSite;		m_spSite = pUnkSite;	// 淇濆瓨 IInputObjectSite 鎸囬拡		if( !m_spSite )		return E_FAIL;		// 浣犻渶瑕佹帶鍒?IE 鐨勪富妗嗘灦鍚楋紵		// 閭d箞鍦ㄧ被鐨勫ご鏂囦歡涓紝瀹氫箟錛?	// CComQIPtr< IWebBrowser2, &IID_IWebBrowser2 > m_spFrameWB;		// 鐒跺悗錛屽厛鍙栧緱 IServiceProvider,鍐嶅彇寰?IWebBrowser2		CComQIPtr < IServiceProvider, &IID_IServiceProvider> spSP(pUnkSite);		if( !spSP )	return E_FAIL;		spSP->QueryService( SID_SWebBrowserApp, &m_spFrameWB );		if( !m_spFrameWB)	return E_FAIL;		// 濡傛灉浣犲彇寰椾簡 IE 涓繪鏋剁殑 IWebBrowser2 鎸囬拡		// 閭d箞錛屽綋瀹冨彂鐢熶簡浠涔堜簨鎯咃紝浣犻毦閬撲笉鎯崇煡閬撳悧錛?	// 瀹氫箟錛欳ComPtr m_spCP;		CComQIPtr< IConnectionPointContainer,			&IID_IConnectionPointContainer> spCPC( m_spFrameWB );		if( spCPC )		{			spCPC->FindConnectionPoint( DIID_DWebBrowserEvents2, &m_spCP );			if( m_spCP )			{				m_spCP->Advise( reinterpret_cast< IDispatch * >( this ), &m_dwCookie );			}		}		// 鍜硚~~ 涓嶈浜嗭紝鐪嬫簮鐮佸幓鍚с傝繖閲岃兘騫茬殑浜嬫儏澶浜?.. ...	}	return S_OK;}		
IDeskBand 鏄竴涓壒孌婄殑 band 瀵硅薄鎺ュ彛錛屾湁涓涓柟娉曞嚱鏁幫細GetBarInfo()錛?br>IDockingWindow 鏄?IDeskBank 鐨勫熀綾伙紝鏈?涓柟娉曞嚱鏁幫細ShowDW()銆丆loseDW()銆丷esizeBorderDW()錛?br>IOleWindow 鍙堟槸 IDockingWindow 鐨勫熀綾伙紝鏈?涓柟娉曞嚱鏁幫細GetWindow()銆丆ontextSensitiveHelp()錛?

銆銆棣栧厛澹版槑 IDeskBand ,鐒跺悗瑕佸疄鐜?IDeskBand 鎺ュ彛鐨勫叡6涓嚱鏁幫紝榪欎簺鍑芥暟姣旇緝綆鍗曪紝涓嶅悓綾誨瀷鐨?band 瀵硅薄錛屽叾瀹炵幇鏂規硶涔熼兘鍩烘湰涓鑷達細
class ATL_NO_VTABLE Cxxx : 	......	public IDeskBand,	......{......BEGIN_COM_MAP(Cxxx)	......	COM_INTERFACE_ENTRY_IID(IID_IDeskBand, IDeskBand)	......END_COM_MAP()// IOleWindowSTDMETHODIMP Cxxx::GetWindow(HWND * phwnd){	// 鍙栧緱 band 瀵硅薄鐨勭獥鍙e彞鏌?// m_hWnd 鏄緩绔嬬獥鍙f椂鍊欎繚瀛樼殑	*phwnd = m_hWnd;		return S_OK;}STDMETHODIMP Cxxx::ContextSensitiveHelp(BOOL fEnterMode){	// 涓婁笅鏂囧府鍔╋紝鍙傝?IContextMenu 鎺ュ彛	return E_NOTIMPL;}// IDockingWindowSTDMETHODIMP CVerticalBar::ShowDW(BOOL bShow){	// 鏄劇ず鎴栭殣钘?band 紿楀彛	if( m_hWnd )		::ShowWindow( m_hWnd, bShow ? SW_SHOW : SW_HIDE);	return S_OK;}STDMETHODIMP CVerticalBar::CloseDW(DWORD dwReserved){	// 閿姣?band 紿楀彛	if( ::IsWindow( m_hWnd ) )		::DestroyWindow( m_hWnd );	m_hWnd = NULL;    return S_OK;}STDMETHODIMP CVerticalBar::ResizeBorderDW(LPCRECT prcBorder, IUnknown* punkToolbarSite, BOOL fReserved){	// 褰撴鏋剁獥鍙g殑杈規澶у皬鏀瑰彉鏃?return E_NOTIMPL;}// IDeskBandSTDMETHODIMP CVerticalBar::GetBandInfo(DWORD dwBandID, DWORD dwViewMode,  DESKBANDINFO* pdbi){	         // 鍙栧緱 band 鐨勫熀鏈俊鎭紝浣犻渶瑕佸~鍐?pdbi 鍙傛暟浣滀負榪斿洖	if( NULL == pdbi )		return E_INVALIDARG;	// 濡傛灉灝嗘潵闇瑕佽皟鐢?IOleCommandTarget::Exec() 鍒欓渶瑕佷繚瀛樿繖2涓弬鏁?m_dwBandID = dwBandID;	m_dwViewMode = dwViewMode;	if(pdbi->dwMask & DBIM_MINSIZE)	{	// 鏈灝忓昂瀵?	pdbi->ptMinSize.x = 10;		pdbi->ptMinSize.y = 10;	}	if(pdbi->dwMask & DBIM_MAXSIZE)	{	// 鏈澶у昂瀵?(-1 琛ㄧず 4G)		pdbi->ptMaxSize.x = -1;		pdbi->ptMaxSize.y = -1;	}	if(pdbi->dwMask & DBIM_INTEGRAL)	{		pdbi->ptIntegral.x = 1;		pdbi->ptIntegral.y = 1;	}	if(pdbi->dwMask & DBIM_ACTUAL)	{		pdbi->ptActual.x = 0;		pdbi->ptActual.y = 0;	}	if(pdbi->dwMask & DBIM_TITLE)	{	// 紿楀彛鏍囬		wcscpy(pdbi->wszTitle,L"紿楀彛鏍囬");	}	if(pdbi->dwMask & DBIM_MODEFLAGS)	{		pdbi->dwModeFlags = DBIMF_VARIABLEHEIGHT;	}	if(pdbi->dwMask & DBIM_BKCOLOR)	{	// 濡傛灉浣跨敤榛樿鐨勮儗鏅壊錛屽垯縐婚櫎璇ユ爣蹇?	pdbi->dwMask &= ~DBIM_BKCOLOR;	}	return S_OK;}		
3.3銆閫夋嫨瀹炵幇鐨?COM 鎺ュ彛
銆銆鏈変袱涓帴鍙d笉鏄繀欏誨疄鐜扮殑錛屼絾涔熻寰堟湁鐢細IInputObject 鍜?IContextMenu銆傚鏋?band 瀵硅薄闇瑕佹帴鏀剁敤鎴風殑杈撳叆錛岄偅涔堝繀欏誨疄鐜?IInputObject 鎺ュ彛銆侷E 瀹炵幇浜?IInputObjectSite 鎺ュ彛錛屽綋瀹瑰櫒涓湁澶氫釜杈撳叆紿楀彛鏃訛紝瀹冭皟鐢?IInputObject 鎺ュ彛鏂規硶鍘昏礋璐g鐞嗙敤鎴風殑杈撳叆鐒︾偣銆?br>鍦ㄦ祻瑙堝櫒鏍忎腑闇瑕佸疄鐜?涓嚱鏁幫細UIActivateIO()銆丠asFocusIO()銆乀ranslateAcceleratorIO()銆?br>褰撴祻瑙堝櫒鏍忔縺媧繪垨澶卞幓媧繪х殑鏃跺欙紝IE 璋冪敤 UIActivateIO 鍑芥暟錛屽綋嬋媧葷殑鏃跺欙紝嫻忚鍣ㄦ爮涓鑸皟鐢?SetFocus 鍘昏緗畠鑷繁紿楀彛鐨勭劍鐐廣傚綋 IE 闇瑕佸垽鏂摢涓獥鍙f湁鐒︾偣鐨勬椂鍊欙紝瀹冭皟鐢?HasFocusIO 銆傚綋嫻忚鍣ㄦ爮鐨勭獥鍙f垨鍏跺瓙紿楀彛鏈夎緭鍏ョ劍鐐規椂錛屽垯搴旇繑鍥?S_OK錛屽惁鍒欒繑鍥?S_FALSE銆俆ranslateAcceleratorIO 鍏佽瀵硅薄澶勭悊鍔犻熼敭錛屼緥瀛愮▼搴忎腑娌℃湁瀹炵幇錛屾墍浠ョ洿鎺ヨ繑鍥?S_FALSE銆?
STDMETHODIMP CExplorerBar::UIActivateIO(BOOL fActivate, LPMSG pMsg){    if(fActivate)        SetFocus(m_hWnd);    return S_OK;}STDMETHODIMP CExplorerBar::HasFocusIO(void){    if(m_bFocus)        return S_OK;    return S_FALSE;}STDMETHODIMP CExplorerBar::TranslateAcceleratorIO(LPMSG pMsg){    return S_FALSE;}      
銆銆Band 瀵硅薄鑳藉閫氳繃鍖呭鍣ㄧ殑 IOleCommandTarget::Exec() 璋冪敤鎵ц鍛戒護銆傝?IOleCommandTarget 鎺ュ彛鎸囬拡錛屽垯鍙互閫氳繃璋冪敤鍖呭鍣ㄧ殑 IInputOjbectSite::QueryInterface錛圛ID_IOleCommandTarget,...錛?鍑芥暟寰楀埌銆侰GID_DeskBand 鏄懡浠ょ粍錛屽綋涓涓?band 瀵硅薄鐨?GetBandInfo 琚皟鐢ㄧ殑鏃跺欙紝鍖呭鍣ㄩ氳繃 dwBandID 鍙傛暟鎸囧畾涓涓?ID 緇?band 瀵硅薄錛屽璞¤淇濆瓨浣忚繖涓狪D錛屼互渚胯皟鐢?IOleCommandTarget::Exec()鐨勬椂鍊欎嬌鐢ㄣ侷D 鐨勫懡浠ゆ湁錛?
  • DBID_BANDINFOCHANGED
    Band 鐨勪俊鎭彉鍖栥傝緗弬鏁?pvaIn 涓?band ID錛?璇?ID 灝辨槸鏈榪戜竴嬈¤皟鐢?GetBandInfo 鎵寰楀埌鐨勫鹼紝瀹瑰櫒浼氳皟鐢?band 瀵硅薄鐨?GetBandInfo 鍑芥暟鏉ユ洿鏂拌姹備俊鎭?
  • DBID_MAXIMIZEBAND
    鏈澶у寲 band銆傝緗弬鏁?pvaIn 涓?band ID錛岃 ID 灝辨槸鏈榪戜竴嬈¤皟鐢??GetBandInfo ?鎵寰楀埌鐨勫箋?
  • DBID_SHOWONLY
    鎵撳紑鎴栧叧闂鍣ㄤ腑鍏跺畠鐨?bands銆?璁劇疆鍙傛暟 pvaIn 涓篤T_UNKNOWN 綾誨瀷錛屽畠鍙互鏄涓嬬殑鍊鹼細
    鍊?/font> 鎻忚堪
    pUnk band 瀵硅薄鐨?IUnknown 鎸囬拡錛屽叾瀹冪殑妗岄潰 bands 灝嗚闅愯棌
    0 闅愯棌鎵鏈夌殑妗岄潰 bands
    1 鏄劇ず鎵鏈夌殑妗岄潰 bands

  • DBID_PUSHCHEVRON
    鍦ㄨ彍鍗曢」宸﹁竟鏄劇ず“v”鐨勯夋嫨鏍囧織銆傚鍣ㄥ彂閫佷竴涓?RB_PUSHCHEVRON 娑堟伅錛屽綋 band 瀵硅薄鎺ユ敹鍒伴氱煡娑堟伅 RBN_CHEVRONPUSHED 鎻愮ず瀹冩樉紺轟竴涓?v"鐨勬爣蹇椼傝緗?IOleCommandTarget::Exec 鍑芥暟涓?nCmdExecOpt 鍙傛暟涓?band ID錛岃 ID 鏄渶榪戜竴嬈¤皟鐢?GetBandInfo ?鎵寰楀埌鐨勫鹼紝璁劇疆 IOleCommandTarget::Exec 鍑芥暟涓?pvaIn 鍙傛暟涓?VT_I4 綾誨瀷錛岃繖鏄簲鐢ㄧ▼搴忓畾涔夌殑涓涓鹼紝瀹冮氳繃閫氱煡娑堟伅 RBN_CHEVRONPUSHED 涓璴AppValue 鍥炰紶緇?band 瀵硅薄銆?

3.4銆Band 瀵硅薄娉ㄥ唽
銆銆Band 瀵硅薄蹇呴』娉ㄥ唽涓轟竴涓?OLE 榪涚▼鍐呯殑鏈嶅姟鍣紝騫朵笖鏀寔 apartment 綰跨▼鍏瘬銆傛敞鍐岃〃涓粯璁ら敭鐨勫兼槸琛ㄧず鑿滃崟鐨勬枃瀛椼傚浜庢祻瑙堝櫒鏍忥紝瀹冨姞鍒?IE 鑿滃崟鐨?#8220;鏌ョ湅\嫻忚鍣ㄦ爮”涓紱瀵逛簬宸ュ叿鏍?band 錛屽畠鍔犲埌 IE 鑿滃崟鐨?#8220;鏌ョ湅\宸ュ叿鏍?#8221;涓紱瀵逛簬妗岄潰 band錛?瀹冨姞鍒扮郴緇熶換鍔℃爮鐨勫揩鎹瘋彍鍗曚腑銆傚湪鑿滃崟璧勬簮涓紝鍙互浣跨敤“&”鎸囨槑鍔犻熼敭銆?br>
閫氬父錛屼竴涓熀鏈殑 band 瀵硅薄鐨勬敞鍐岃〃欏圭洰鏄細

HKEY_CLASSES_ROOT
CLSID
{浣犵殑 band 瀵硅薄鐨?CLSID}

銆銆(Default) = 鑿滃崟鐨勬枃瀛?
銆銆InProcServer32
銆銆銆(Default) = DLL 鐨勫叏璺緞鏂囦歡鍚?
銆銆銆ThreadingModel= Apartment

宸ュ叿鏍?bands 榪樺繀欏繪妸瀹冧滑鐨?CLSID 娉ㄥ唽鍒?IE 鐨勬敞鍐岃〃涓?br>
鍦?HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Toolbar 涓嬬粰鍑?CLSID 浣滀負閿悕錛岃屽叾閿兼槸琚拷鐣ョ殑銆?br>
HKEY_LOCAL_MACHINE
Software
Microsoft
Internet Explorer
Toolbar

銆銆{浣犵殑 band 瀵硅薄鐨?CLSID}

銆銆榪樻湁鍑犱釜鍙夌殑娉ㄥ唽琛ㄩ」鐩?渚嬪瓙紼嬪簭騫朵笉鏄繖鏍峰疄鐜扮殑)銆傛瘮濡傦紝浣犳兂璁╂祻瑙堝櫒鏍忔樉紺?HTML 鐨勮瘽錛屽繀欏昏濡備笅璁劇疆娉ㄥ唽琛細

HKEY_CLASSES_ROOT
CLSID
{浣犵殑 Band 瀵硅薄鐨?CLSID}
Instance
CLSID
銆銆
(Default) = {4D5C8C2A-D075-11D0-B416-00C04FB90376}

鍚屾椂錛屽鏋滆鎸囧畾涓涓湰鍦扮殑 HTML 鏂囦歡錛岄偅涔堣濡備笅璁劇疆錛?

HKEY_CLASSES_ROOT
CLSID
{浣犵殑 Band 瀵硅薄鐨?CLSID}
Instance
InitPropertyBag
銆銆
Url

銆銆鍙﹀錛岃繕鍙互鎸囧畾嫻忚鍣ㄦ爮鐨勫鍜岄珮錛屽綋鐒訛紝瀹冩槸渚濊禆浜庤繖涓爮鏄旱鍚戣繕鏄í鍚戠殑銆傚叾瀹炶繖涓」鐩棤鎵璋擄紝鍥犱負褰撶敤鎴瘋皟鏁翠簡嫻忚鍣ㄦ爮鐨勫ぇ灝忓悗錛屼細鑷姩淇濆瓨鍦ㄦ敞鍐岃〃涓殑銆?br>
HKEY_CURRENT_USER
Software
Microsoft
Internet Explorer
Explorer Bars
{浣犵殑 Band 瀵硅薄鐨?CLSID}
銆銆
BarSize

銆銆BarSize 閿殑綾誨瀷蹇呴』鏄?REG_BINARY 綾誨瀷錛屽畠鏈?涓瓧鑺傘傚乏璧峰墠4涓瓧鑺傦紝鏄敤16榪涘埗琛ㄧず鐨勫儚绱犲搴︽垨楂樺害錛屽悗4涓瓧鑺備繚鐣欙紝浣犲簲璇ヨ緗負0銆備笅闈㈡槸涓涓彲浠ュ湪嫻忚鍣ㄦ爮涓婃樉紺?HTML 鏂囦歡鐨勫叏閮ㄦ敞鍐岃〃欏圭洰鐨勪緥瀛愶紝榛樿瀹藉害涓?91錛?x123錛変釜鍍忕礌鐐癸細

HKEY_CLASSES_ROOT
CLSID
{浣犵殑 Band 瀵硅薄鐨?CLSID}

銆(Default) = 鑿滃崟鏂囧瓧
InProcServer32
銆銆(Default) = DLL 鐨勫叏璺緞鏂囦歡鍚?
銆銆ThreadingModel= Apartment
Instance
CLSID

銆銆(Default) = {4D5C8C2A-D075-11D0-B416-00C04FB90376}
InitPropertyBag
銆銆Url= 浣犵殑 HTML 鏂囦歡鍚?br>
HKEY_CURRENT_USER
Software
Microsoft
Internet Explorer
Explorer Bars
{浣犵殑 Band 瀵硅薄鐨?CLSID}

銆銆BarSize= 23 01 00 00 00 00 00 00

銆銆瀵逛簬娉ㄥ唽琛ㄧ殑璁劇疆錛岀敤 ATL 瀹炵幇鍏跺疄鏄紓甯哥畝鍗曠殑銆傛墦寮宸ョ▼鐨?xxx.rgs 鏂囦歡錛屽茍鎵嬪伐緙栬緫涓涓嬪氨鍙互浜嗐?涓嬮潰榪欎釜鏂囦歡婧愮爜錛屾槸渚嬪瓙紼嬪簭涓?IE 宸ュ叿鏍忕殑娉ㄥ唽琛ㄦ牱寮忥紝HKLM 鏄渶瑕佹墜宸ユ坊鍔犵殑錛屽洜涓哄畠涓嶄嬌鐢ㄧ粍浠剁被鍨嬫柟寮忔敞鍐屻傝屽浜庡叾瀹冪被鍨嬬殑 band 瀵硅薄鍙鍦ㄧ被澹版槑涓坊鍔狅細

BEGIN_CATEGORY_MAP(Cxxx)			// 鍚戞敞鍐岃〃涓敞鍐?COM 綾誨瀷	IMPLEMENTED_CATEGORY(CATID_InfoBand)	// 鍨傜洿鏍峰紡鐨勬祻瑙堝櫒鏍廍ND_CATEGORY_MAP()		
IE 宸ュ叿鏍忕被鍨?band 瀵硅薄鐨?#8220;.rgs”鏂囦歡
HKCR	// 榪欎釜欏圭洰鏄?ATL 甯綘鐢熸垚鐨勶紝浣犲彧瑕佹墜宸ヤ慨鏀?#8220;鑿滃崟涓婄殑鏂囧瓧”灝卞彲浠ヤ簡{	Bands.ToolBar.1 = s ''ToolBar Class''	{		CLSID = s ''{ 浣犵殑 CLSID }''	}	Bands.ToolBar = s ''ToolBar Class''	{		CLSID = s ''{ 浣犵殑 CLSID }''		CurVer = s ''Bands.ToolBar.1''	}	NoRemove CLSID	{		ForceRemove { 浣犵殑 CLSID } = s ''鐢ㄥ湪鑿滃崟涓婄殑鏂囧瓧(&T)''		{			ProgID = s ''Bands.ToolBar.1''			VersionIndependentProgID = s ''Bands.ToolBar''			ForceRemove ''Programmable''			InprocServer32 = s ''%MODULE%''			{				val ThreadingModel = s ''Apartment''			}			''TypeLib'' = s ''{xxxx-xxxx-xxxxxxxxxxxxxxx}''		}	}}HKLM	// 榪欎釜欏圭洰鏄墜宸ユ坊鍔犵殑IE宸ュ叿鏍忔墍鐗規湁鐨剓	Software	{		Microsoft		{			''Internet Explorer''			{				NoRemove Toolbar				{					ForceRemove val { 浣犵殑 CLSID } = s ''闅忎究緇欎釜璇存槑鎬ф枃瀛椾覆''				}			}		}	}}		
鍥涖?ATL 瀹炵幇
銆銆涓嬭澆浠g爜鍚?VC 6.0 宸ョ▼)錛岃鍙傜収鍓嶉潰鐨勮鏄庝粩緇嗛槄璇伙紝浠g爜涓篃鏈変竴浜涘叧閿偣鐨勬敞閲娿傚鏋滄兂榪愯錛屽垯鍙互鐢?regsvr32.exe 榪涜娉ㄥ唽錛岀劧鍚庢墦寮 IE 嫻忚鍣ㄦ垨璧勬簮嫻忚鍣ㄥ氨鍙互鐪嬪埌鏁堟灉浜嗐傚鏋滄兂鑷繁瀹炶返涓涓嬶紝鍙互鎸夌収濡備笅鐨勬楠ゆ瀯閫犲伐紼嬶細

4.1銆寤虹珛涓涓?ATL DLL 宸ョ▼
4.2銆娣誨姞 New ATL Object...錛岄夋嫨 Internet Explorer Object錛岄夎繖涓被鍨嬬殑鐩殑鏄鍚戝緇欐垜浠坊鍔?IObjectWithSite 鐨勬敮鎸併傚鏋滀綘浣跨敤鐨勬槸 .net 鐜錛屽垯涓嶈蹇樿閫夋嫨鏀寔榪欎釜鎺ュ彛銆?br>


4.3銆杈撳叆瀵硅薄鍚嶇О錛屾瘮濡傛垜鎯沖緩绔嬩竴涓瀭鐩寸殑嫻忚鍣ㄦ爮錛屼笉濡ㄥ彨瀹?VerBar



4.4銆綰跨▼妯″瀷蹇呴』閫夋嫨 Apartment錛屾帴鍙g被鍨嬬殑閫夋嫨鏃犳墍璋擄紝鐪嬩綘鎯充笉鎯蟲敮鎸?IDispatch 鎺ュ彛鍔熻兘浜嗐傚湪渚嬪瓙紼嬪簭涓殑鍨傜洿嫻忚鍣ㄦ爮涓紝鐢變簬鎯蟲洿綆鍗曠殑鎿嶇旱 IE 鍜屼粠 IE 涓帴鍙椾簨浠訛紙榪炴帴鐐癸級錛岄夋嫨 Dual 鏄繀瑕佺殑銆傝仛鍚堥夐」錛屼綘鍙鍒夋嫨 Only 灝卞彲浠ヤ簡銆?br>


4.5銆灞曠幇浣犳棤絀風殑鏅烘収錛屽紑濮嬭緭鍏ョ▼搴忓惂銆傚鏋滄槸 Debug 鏂瑰紡緙栬瘧錛屽彲鑳戒細鍑虹幇涓涓繛鎺ラ敊璇紝鎶ュ憡鎵句笉鍒癬AtlAxCreateControl錛岄偅涔堜綘瑕佸湪鑿滃崟 Project\Settings...\Link 涓鍔犲 Atl.lib 鐨勮繛鎺ャ傛垨鑰呬嬌鐢?#pragma comment ( lib, "atl" )鍔犲叆榪炴帴搴撱?br>4.6銆濡傛灉鎯寵皟璇曚唬鐮侊紝鍦ㄨ彍鍗?Project\Settings...\Debug 涓緭鍏?IE 鐨勮礬寰勫悕縐幫紝姣斿錛?#8220;C:\Program Files\Internet Explorer\IEXPLORE.EXE”錛岀劧鍚庡氨鍙互璺熻釜鏂偣璋冭瘯浜嗐?緙栬瘧鍜岃皟璇曟闈㈠伐鍏鋒爮鐨?band 瀵硅薄錛屾槸闈炲父楹葷儲鐨勶紝鍥犱負璁$畻鏈哄惎鍔ㄦ椂鑷姩榪愯 Shell錛岃?Shell 灝變細鍔犺澆媧誨姩鐨勬闈㈠璞°?br>
浜斻佺粨鏉熻
濂戒簡錛屽埌榪欓噷錛屽氨鍒拌繖閲屼簡銆傜澶у瀛︿範蹇箰^_^ 


]]>
Internet Explorer 緙栫▼綆榪幫紙鍗佷竴錛夊疄鐜板畬緹庣殑Inplace Drag & Drop鈥斺斺滆秴綰ф嫋鏀鋸?/title><link>http://m.shnenglu.com/mydriverc/articles/28966.html</link><dc:creator>鏃呴?/dc:creator><author>鏃呴?/author><pubDate>Sun, 29 Jul 2007 07:40:00 GMT</pubDate><guid>http://m.shnenglu.com/mydriverc/articles/28966.html</guid><wfw:comment>http://m.shnenglu.com/mydriverc/comments/28966.html</wfw:comment><comments>http://m.shnenglu.com/mydriverc/articles/28966.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/mydriverc/comments/commentRss/28966.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/mydriverc/services/trackbacks/28966.html</trackback:ping><description><![CDATA[<div style="margin: 0in; font-size: 10pt;"><font face="Courier New"><font size="3"><strong> 鍏抽敭瀛?/strong> 錛氳秴綰ф嫋鏀撅紝GetDropTarget錛宱ndragover錛孖HTMLDataTransfer</font></font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-weight: bold; font-size: 10pt;"><font face="Courier new" size="3">1銆佹榪?/font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">璁稿澶氱獥鍙f祻瑙堝櫒閮芥彁渚涗簡涓縐嶈縐頒負“瓚呯駭鎷栨斁”錛堟垨“瓚呯駭鎷栨嫿”銆?#8220;闅忓績鎷栨斁”絳夌瓑錛屼笉涓鑰岃凍錛夌殑鍔熻兘銆備綔涓哄IE鎷栨嫿琛屼負瀵規墿灞曪紝“瓚呯駭鎷栨斁”瀹炵幇浜嗕竴浜涢潪甯稿疄鐢ㄧ殑鍔熻兘錛?/font></div> <ul style="margin-top: 0in; margin-bottom: 0in; margin-left: 0.5in; direction: ltr; unicode-bidi: embed;" type="disc"> <li style="margin-top: 0px; font-size: 10pt; margin-bottom: 0px; vertical-align: middle;"><font face="Courier New">鎷栨斁緗戦〉閾炬帴錛氶氬父鏄湪鏂扮獥鍙d腑鎵撳紑 </font></li> <li style="margin-top: 0px; font-size: 10pt; margin-bottom: 0px; vertical-align: middle;"><font face="Courier New">鎷栨斁閫変腑鐨勬枃瀛楋細淇濆瓨鏂囧瓧銆佷綔涓哄叧閿瓧閫氳繃鎼滅儲寮曟搸鎼滅儲緗戠粶銆佷綔涓篣rl鎵撳紑絳?</font></li> <li style="margin-top: 0px; font-size: 10pt; margin-bottom: 0px; vertical-align: middle;"><font face="Courier New">鎷栨斁鍥劇墖錛氶氬父鏄繚瀛樺浘鐗囧埌鎸囧畾鏂囦歡澶?</font></li> <li style="margin-top: 0px; font-size: 10pt; margin-bottom: 0px; vertical-align: middle;"><font face="Courier New">褰撶劧錛岃繕鏈夊緢鍏抽敭鐨勪竴鐐癸細鎷栧姩瀵硅薄鏃墮紶鏍囨寚閽堝弽棣堜笉鍚岀殑鎷栨嫿鏁堟灉 </font></li> </ul> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">鍦ㄣ?/font><a target="_blank" ><font face="Courier New">Internet Explorer 緙栫▼綆榪幫紙鍗侊級鍝嶅簲鏉ヨ嚜HTML Element鐨勪簨浠墮氱煡鈥斺斿嚑涓ソ鐢ㄧ殑綾?/font></a><font face="Courier New">銆嬩腑鏇炬彁鍒幫紝灝界璁稿嫻忚鍣ㄩ兘鎻愪緵浜嗚秴綰ф嫋鏀劇殑鍔熻兘錛屼絾涓嶪E鐨勭己鐪佸疄鐜扮浉姣旓紝闄や簡鍏峰榧犳爣鎸囬拡鎷栨嫿鏁堟灉澶栵紝榪樻病鏈夊摢涓祻瑙堝櫒鐨勫疄鐜拌兘澶熷疄鐜幫細</font></div> <ul style="margin-top: 0in; margin-bottom: 0in; margin-left: 0.5in; direction: ltr; unicode-bidi: embed;" type="disc"> <li style="margin-top: 0px; font-size: 10pt; margin-bottom: 0px; vertical-align: middle;"><font face="Courier New">鏂囧瓧鍦ㄩ〉闈㈠唴涓庤緭鍏ユ涔嬮棿鐨勪氦浜掓嫋鏀撅紙榪欎竴鐐規渶涓洪噸瑕侊級 </font></li> <li style="margin-top: 0px; font-size: 10pt; margin-bottom: 0px; vertical-align: middle;"><font face="Courier New">鏉ヨ嚜澶栭儴鐨勬枃瀛椾笌緗戦〉杈撳叆妗嗕箣闂寸殑浜や簰鎷栨斁 </font></li> <li style="margin-top: 0px; font-size: 10pt; margin-bottom: 0px; vertical-align: middle;"><font face="Courier New">鎷栨嫿鏃舵粴鍔ㄩ〉闈紙榪欎竴鐐規槸琚拷鐣ヤ簡錛?</font></li> </ul> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">鏈枃鐨勭洰鐨勶紝涓鏄粙緇嶅疄鐜拌秴綰ф嫋鏀劇殑涓ょ鏂規硶錛屼簩鏄鏄庡浣曞疄鐜?#8220;瀹岀編”鐨勬嫋鏀鋸斺斿嵆鎵╁睍IE鎷栨嫿琛屼負鐨勫悓鏃訛紝淇濈暀IE榛樿鐨勬嫋鎷借涓恒備笁鏄粰鍑轟竴涓渶涓虹洿鎺ュ拰綆媧佺殑瀹炵幇錛岃嚦浜庢嫋鏀句笉鍚岀殑瀵硅薄浠ュ疄鐜頒笉鍚岀殑鍔熻兘錛屼笉鍦ㄦ湰鏂囪璁虹殑鑼冨洿錛岀暐鍘匯?/font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-weight: bold; font-size: 10pt;"><font face="Courier new" size="3">2銆佹爣鍑嗙殑瀹炵幇鏂規硶</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">鏍囧噯鏂規硶鍗抽氳繃IDocHostUIHandler鐨凣etDropTarget鎴愬憳鍑芥暟鏉ュ疄鐜幫紝鍦∕SDN榪欐牱璇村埌錛?/font></div> <blockquote dir="ltr" style="margin-right: 0px;"> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">IDocHostUIHandler::GetDropTarget Method鈥斺擟alled by MSHTML when it is used as a drop target. This method enables the host to supply an alternative IDropTarget interface.</font></div> </blockquote> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">鍗? 鍦ㄩ傚綋鐨勬椂鍊欙紝MSHTML寮曟搸浼氳皟鐢↖DocHostUIHandler鐨凣etDropTarget鏂規硶錛屼負搴旂敤紼嬪簭鎻愪緵涓涓満浼氭潵鏇挎崲MSHTML 緙虹渷鐨凞ropTarget瀹炵幇銆傛垜浠氨鍙互閫氳繃榪欎釜鑷畾涔夌殑DropTarget瀹炵幇鏉ュ畬鎴愪笂榪扮殑“瓚呯駭鎷栨斁”鍔熻兘銆傛柟娉曠ず渚嬪涓?鍏朵腑鐣ュ幓鐨勯儴鍒嗗彲鍙? 鑰僊FC涓瑿HtmlControlSite鍜孋HtmlView鐨勬簮浠g爜錛?/font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <blockquote dir="ltr" style="margin-right: 0px;"> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">STDMETHODIMP CHtmlControlSite::XDocHostUIHandler::GetDropTarget(</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">LPDROPTARGET pDropTarget, LPDROPTARGET* ppDropTarget)</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">METHOD_PROLOGUE_EX_(CHtmlControlSite, DocHostUIHandler)</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">*ppDropTarget = g_pDropTarget;//<font style="background-color: #808080;" color="#ffffff">灝嗚嚜瀹氫箟鐨勫疄鐜板憡鐭SHTML寮曟搸</font></font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New"><strong> return</strong> S_OK;</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">}</font></div> </blockquote> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">鍏? 涓璯_pDropTarget鎸囧悜鏌愪釜鍏ㄥ眬鐨処DropTarget鎺ュ彛鐨勫疄鐜幫紝鎴戜滑鍋囧畾涓篊IEDropTarget錛孋IEDropTarget瀹炵幇 浜咺DropTarget鐨勫嚑涓垚鍛樺嚱鏁癉ragEnter銆丏ragOver銆丏ragLeave鍜孌rop銆傚湪DragEnter涓彲浠ュ喅瀹氭槸鍚︽帴鍙? 涓涓狣rop浠ュ強濡傛灉鎺ュ彈榪欎釜Drop鐨勮瘽璇ユ彁渚涙庢牱鐨勯紶鏍囨嫋鎷藉弽棣堬紝鍦ㄦ寔緇Е鍙戠殑DragOver涓悓鏍峰彲浠ヨ瀹氶紶鏍囨嫋鎷藉弽棣堬紝浠庤屽疄鐜板湪鎷栨斁涓嶅悓鐨勫 璞★紙鏂囧瓧銆侀摼鎺ャ佸浘鍍忕瓑錛夋椂鎻愪緵涓嶅悓鐨勬嫋鎷借瑙夋晥鏋滐紝瀹炵幇鐩稿綋綆鍗曪紝姝ゅ涓嶅啀璧樿堪銆?/font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">浣? 涓婇潰鐨勫疄鐜板瓨鍦ㄤ竴浜涢棶棰樸傞鍏堟槸閫変腑鐨勬枃瀛楀湪欏甸潰鍐呬笌杈撳叆妗嗕箣闂翠氦浜掔殑鎷栨斁娌℃湁浜嗐傝繖鏄嚜鐒剁殑錛屾棦鐒舵垜浠敤鑷畾涔夌殑DropTarget鏇挎崲鎺変簡IE鐨勭己 鐪佸疄鐜幫紝閭h繖縐嶄氦浜掔殑鎷栨斁鐞嗗簲鐢辨垜浠嚜宸卞疄鐜般傞毦澶勫茍闈炲湪浜庝笉鑳藉疄鐜幫紝鑰屾槸鍦ㄤ簬瀹炵幇璧鋒潵姣旇緝楹葷儲鈥斺斿厜鏄緱鍒伴紶鏍囦笅鐨凥TML Element灝卞鎴戜滑鐑︿簡錛涘綋杈撳叆妗嗕腑鏈夋枃瀛楃殑鏃跺欙紝鍏夋爣榪樺簲璇ラ殢鐫榧犳爣鐨勭Щ鍔ㄨ岀Щ鍔ㄢ斺旀墍浠ヨ繖涓垂鍔涜繕涓嶄竴瀹氳濂界殑鍔熻兘浼間箮娌℃湁鍝釜嫻忚鍣ㄥ幓鍋氥傚叾 嬈★紝浣滀負杈撳叆妗嗘枃瀛楁嫋鏀劇殑琛嶇敓鐗╋紝鎷栨嫿婊氬姩娌℃湁浜嗐傚綋榧犳爣鍚戞煇涓柟鍚戞嫋鎷芥椂錛岀綉欏靛簲璇ラ殢鐫灝嗕笉鍙鐨勯儴鍒嗘粴鍔ㄥ嚭鏉ワ紝姣斿鏌愪釜杈撳叆妗嗭紝璁╂垜浠湁鏈轟細灝嗘枃瀛楁嫋 鎷借繃鍘匯傝繖涓狥eature鐨勫疄鐜板茍涓嶅洶闅撅紝涓嶈繃涓鏉ユ槸琚拷鐣ヤ簡錛堟敞鎰忓埌鎷栨嫿婊氬姩鐨勪漢騫朵笉澶氾級錛屼簩鏉ヤ富瑕丗eature閮芥病鏈夊疄鐜幫紝榪欎釜婊氬姩涔熸剰涔変笉澶? 浜嗐?/font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-weight: bold; font-size: 10pt;"><font face="Courier new" size="3">3銆佹墦鍏SHTML鍐呴儴</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">鏃㈢劧浠嶨etDropTarget鎻愪緵澶栭儴瀹炵幇闅句互寰楀埌涓庤緭鍏ユ鐨勪氦浜掑紡鎷栨斁錛岄偅灝辨崲涓搴︽潵鑰冭檻闂錛岃鎴戜滑鎵撳叆MSHTML鐨勫唴閮ㄣ?/font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">鐫 鎵嬬偣鏄疘HTMLDocumentX鎺ュ彛鈥斺旀搷綰礗E鐨凞OM鐨勬硶瀹濄傛垜浠敞鎰忓埌IHTMLDocument2鏈変釜ondragstart浜嬩歡錛岃繘鑰屾兂鍒? 搴旇涔熸湁璇稿ondragenter銆乷ndragover銆乷ndrop涔嬬被鐨勪簨浠訛紙浜嬪疄涓婁篃鏄湁鐨勶級錛屽鏋滃搷搴旇繖浜涗簨浠訛紝澶勭悊鍚岃緭鍏ユ鐨勪氦浜掑紡鎷栨斁搴? 璇ュ氨鑳藉瑙e喅銆傚洜涓鴻繖浜涙嫋鏀懼湪MSHTML鐨勭己鐪丏ropTarget瀹炵幇涓彂鐢燂紝鍥犺屽綋榧犳爣鎷栨嫿鍒版煇涓緭鍏ユ涓婃椂錛岃偗瀹氫細瑙﹀彂涓涓猳ndragover 浜嬩歡錛岃屽湪IHTMLEventObj鐨勮緟鍔╀笅鎴戜滑鑳借交鏉懼緱鍒扮浉鍏崇殑HTML Element錛屽叾瀹冪殑鎿嶄綔灝卞鏄撹繘琛屼簡銆傚啀緇嗗績涓鐐癸紝鎴戜滑榪樺彂鐜癐HTMLEventObj2鎺ュ彛鏈変釜dataTransfer灞炴р斺斿彲浠ュ緱鍒頒竴涓? IHTMLDataTransfer鐨勬寚閽堬紝鑰孖HTMLDataTransfer鎺ュ彛姝f槸嫻忚鍣ㄥ唴閮ㄧ敤浜庢暟鎹氦鎹㈢殑閲嶈鎵嬫涔嬩竴錛堢湅鐪嬪畠鐨勫睘鎬у氨鐭ラ亾浼? 寰堟湁鐢ㄤ簡錛夛細</font></div> <blockquote dir="ltr" style="margin-right: 0px;"> <div style="margin: 0in; font-weight: bold; font-size: 10pt;"><font face="Courier New">IHTMLDataTransfer Members</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">clearData鈥斺擱emoves one or more data formats from the clipboard through dataTransfer or clipboardData object.</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">dropEffect鈥斺擲ets or retrieves the type of drag-and-drop operation and the type of cursor to display.</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">effectAllowed鈥斺擲ets or retrieves, on the source element, which data transfer operations are allowed for the object.</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">getData鈥斺擱etrieves the data in the specified format from the clipboard through the dataTransfer or clipboardData objects.</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">setData鈥斺擜ssigns data in a specified format to the dataTransfer or clipboardData object.</font></div> </blockquote> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">鏇磋繘涓姝ワ紝浠嶪HTMLDataTransfer鎺ュ彛榪樺彲浠ヨ闂埌IDataObject鎺ュ彛錛屽湪榪涜Ole鎷栨斁鏃訛紝鏁版嵁灝辨槸閫氳繃IDataObject鎺ュ彛鏉ヤ紶閫掔殑銆傚叿浣撶敤娉曠◢鍚庤璁恒?/font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-weight: bold; font-size: 10pt;"><font face="Courier new" size="3">4銆佹墦鍏SHTML鍐呴儴鈥斺旀濊礬</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">鎻? 渚涢紶鏍囧弽棣堟晥鏋滀笌瀹炵幇GetDropTarget鐨勬柟娉曠被浼鹼紝鏈変簡IHTMLDataTransfer鎺ュ彛錛屼究鍙湪ondragstart鍙? ondragover浜嬩歡瑙﹀彂鏃墮氳繃dropEffect灞炴ц緗嫋鎷界殑鏁堟灉錛堝彲鏍規嵁闇瑕佽嚜琛岃瀹氾紝涓嶈緗殑璇濅嬌鐢ㄩ粯璁ょ殑鏁堟灉錛夈傚啀鑰咃紝“鎷?#8221;鍜?#8220;鏀?#8221;閮? 鍦∕SHTML鐨勭己鐪佸疄鐜頒腑鍙戠敓錛屾垜浠粠IHTMLEventObj鐨凷rcElement鍗沖彲寰楃煡榧犳爣鎵浣嶇疆鐨凥TML Element鏄惁鏄緭鍏ユ銆?/font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-weight: bold; font-size: 10pt;"><font face="Courier new" size="3">5銆佹墦鍏SHTML鍐呴儴鈥斺斿疄鐜?/font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">瑕佹帴鏀跺埌ondragstart涔嬬被鐨勪簨浠訛紝鍙互閲囩敤銆?/font><a target="_blank" ><font face="Courier New">Internet Explorer 緙栫▼綆榪幫紙鍗侊級鍝嶅簲鏉ヨ嚜HTML Element鐨勪簨浠墮氱煡鈥斺斿嚑涓ソ鐢ㄧ殑綾?/font></a><font face="Courier New">銆嬩腑鎻愬埌鐨凜HtmlObj綾誨拰CHtmlElements綾伙紝騫跺湪閫傚綋鐨勫湴鏂硅繛鎺ュ埌Document錛岀ず渚嬩唬鐮佸涓嬫墍紺猴細</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <blockquote dir="ltr" style="margin-right: 0px;"> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">HRESULT CHtmlDocument2::OnInvoke(DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags,</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">DISPPARAMS * pdispparams, VARIANT * pvarResult,EXCEPINFO * pexcepinfo, </font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">UINT * puArgErr)</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">......</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font style="background-color: #808080;" color="#ffffff" face="Courier New">//濡傛灉鍙槸瑕佽緗紶鏍囨嫋鎷芥晥鏋滅殑璇濓紝榪欎釜浜嬩歡鍙互涓嶅鐞?/font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New"><strong> case</strong> DISPID_HTMLELEMENTEVENTS_ONDRAGSTART :</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">OnDragStart();</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New"><strong> break</strong> ;</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font style="background-color: #808080;" color="#ffffff" face="Courier New">//閲嶇偣鍦ㄨ繖閲?/font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New"><strong> case</strong> DISPID_HTMLELEMENTEVENTS_ONDRAGOVER :</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">OnDragOver();</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New"><strong> break</strong> ;</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New"><strong> case</strong> DISPID_HTMLELEMENTEVENTS_ONDROP :</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">OnDrop();</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New"><strong> break</strong> ;</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">......</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"><strong> void</strong> CHtmlDocument2::OnDragOver(<strong> void</strong> )</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">SetDragEffect();               <font style="background-color: #808080;" color="#ffffff">//</font><font style="background-color: #808080;" color="#ffffff">璁劇疆榧犳爣鎷栨嫿鏁堟灉</font></font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"><strong> void</strong> CHtmlDocument2::SetDragEffect(<strong> void</strong> )</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">CComQIPtr<IHTMLWindow2>  </font><font face="Courier New">pWindow;</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">CComQIPtr<IHTMLEventObj>  </font><font face="Courier New">pEventObj;</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">CComQIPtr<IHTMLEventObj2>  </font><font face="Courier New">pEventObj2;</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">CComQIPtr<IHTMLElement>  </font><font face="Courier New">pElement;</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">HRESULT hr = m_spHtmlObj->get_parentWindow( &pWindow );</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">hr = pWindow->get_event( &pEventObj );</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font style="background-color: #808080;" color="#ffffff" face="Courier New">//ondragover鍙戠敓鏃禝E鐨勯粯璁よ涓烘槸“娌℃湁榧犳爣鎷栨嫿鏁堟灉”銆?/font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font style="background-color: #808080;" color="#ffffff" face="Courier New">//灝咺HTMLEventObj鐨勮繑鍥炲艱涓篺alse鍗沖彲鍙栨秷璇ヤ簨浠剁殑榛樿琛屼負錛屾墍浠ユ墽琛屽畬涓嬮潰榪欏彞璇濓紝鎷栨嫿鏁堟灉灝卞嚭鐜頒簡銆?/font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">AllowDisplayDragCursor(pEventObj, FALSE);   </font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">CComBSTR bstrTagName;</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">pEventObj->get_srcElement(&pElement);    <font style="background-color: #808080;" color="#ffffff">//</font><font style="background-color: #808080;" color="#ffffff">鑾峰緱褰撳墠HTML Element</font></font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">pElement->get_tagName(&bstrTagName);     </font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New"><strong> if</strong> ( IsEditArea(bstrTagName) ) <font style="background-color: #808080;" color="#ffffff">//鏍規嵁Tag Name鍒ゆ柇鏄惁榧犳爣浣嶄簬杈撳叆妗嗭紝浠ヤ究璁劇疆鐒︾偣浣垮緱鍏夋爣闅忛紶鏍囩Щ鍔?/font></font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">CComQIPtr<IHTMLElement2>  </font><font face="Courier New">pElement2;</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New"><strong> if</strong> ( SUCCEEDED(pElement->QueryInterface(IID_IHTMLElement2, (void **) &pElement2 )) </font></div> <div style="margin: 0in 0in 0in 1.5in; font-size: 10pt;"><font face="Courier New">&& pElement2 )</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 1.5in; font-size: 10pt;"><font face="Courier New">pElement2->focus();</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font style="background-color: #808080;" color="#ffffff" face="Courier New">//榛樿鎯呭喌涓嬶紝褰撴嫋鎷芥枃妗e埌杈撳叆妗嗘椂錛岄紶鏍囦細鍙樻垚鎷栨嫿鐨勫厜鏍囷紝鎵浠ヨ繖閲屼嬌鐢↖E鐨勯粯璁よ涓恒?/font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">AllowDisplayDragCursor(pEventObj, TRUE);</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">BOOL CHtmlDocument2::IsEditArea(CComBSTR bstrTagName)</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New"><strong> return</strong> bstrTagName == "INPUT" || bstrTagName == "TEXTAREA";</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"><strong> void</strong> CHtmlDocument2::AllowDisplayDragCursor(CComQIPtr<IHTMLEventObj> pEventObj, BOOL bAllow)</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">VARIANT v;</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">v.vt = VT_BOOL;</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">v.boolVal = !bAllow ? VARIANT_FALSE : VARIANT_TRUE;</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">pEventObj->put_returnValue(v);</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"><strong> void</strong> CHtmlDocument2::OnDrop(<strong> void</strong> )</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">CComQIPtr<IHTMLWindow2>  </font><font face="Courier New">pWindow;</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">CComQIPtr<IHTMLEventObj>  </font><font face="Courier New">pEventObj;</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">CComQIPtr<IHTMLEventObj2>  </font><font face="Courier New">pEventObj2;</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">CComQIPtr<IHTMLElement>  </font><font face="Courier New">pElement;</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">CComQIPtr<IHTMLDataTransfer>   pdt; <font style="background-color: #808080;" color="#ffffff">//姝ゅ婕旂ず濡備綍浣跨敤IHTMLDataTransfer</font></font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">HRESULT hr = m_spHtmlObj->get_parentWindow( &pWindow );</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">hr = pWindow->get_event( &pEventObj );</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">hr = pEventObj->QueryInterface(IID_IHTMLEventObj2, (void **) &pEventObj2 );</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">hr = pEventObj2->get_dataTransfer(&pdt);</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">CComBSTR bstrFormat = "URL"; <font style="background-color: #808080;" color="#ffffff">//棣栧厛灝濊瘯鑾峰彇URL</font></font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">VARIANT Data;</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">hr = pdt->getData(bstrFormat, &Data);</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New"><strong> if</strong> ( Data.vt != VT_NULL )</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">{     <font style="background-color: #808080;" color="#ffffff">//</font><font style="background-color: #808080;" color="#ffffff">鑾峰彇鎴愬姛錛屾嫋鏀劇殑瀵硅薄鏄疷rl</font></font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">DoOpenUrl(CString(Data.bstrVal));</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">else</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">{     <font style="background-color: #808080;" color="#ffffff">//</font><font style="background-color: #808080;" color="#ffffff">鍚﹀垯灝濊瘯鑾峰彇閫変腑鐨勬枃鏈?/font></font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">bstrFormat = "Text";</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">hr = pdt->getData(bstrFormat, &Data); </font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New"><strong> if</strong> ( Data.vt != VT_NULL )</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">{     <font style="background-color: #808080;" color="#ffffff">//</font><font style="background-color: #808080;" color="#ffffff">鑾峰彇鎴愬姛錛屾嫋鏀劇殑鍐呭鏄枃鏈?/font></font></div> <div style="margin: 0in 0in 0in 1.5in; font-size: 10pt;"><font face="Courier New">CComBSTR bstrTagName;</font></div> <div style="margin: 0in 0in 0in 1.5in; font-size: 10pt;"><font face="Courier New">pEventObj->get_srcElement(&pElement);</font></div> <div style="margin: 0in 0in 0in 1.5in; font-size: 10pt;"><font face="Courier New">pElement->get_tagName(&bstrTagName);</font></div> <div style="margin: 0in 0in 0in 1.5in; font-size: 10pt;"><font face="Courier New"><strong> if</strong> ( IsEditArea(bstrTagName) )</font></div> <div style="margin: 0in 0in 0in 1.5in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 2in; font-size: 10pt;"><font style="background-color: #808080;" color="#ffffff" face="Courier New">//Drop target鏄緭鍏ユ錛屼笉鍋氫換浣曟搷浣滐紝鐢盜E榪涜榛樿澶勭悊</font></div> <div style="margin: 0in 0in 0in 2in; font-size: 10pt;"><font face="Courier New"><strong> return</strong> ;</font></div> <div style="margin: 0in 0in 0in 1.5in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in 0in 0in 1.5in; font-size: 10pt;"><font face="Courier New"><strong> else</strong> </font></div> <div style="margin: 0in 0in 0in 1.5in; font-size: 10pt;"><font face="Courier New">{     <font style="background-color: #808080;" color="#ffffff">//</font><font style="background-color: #808080;" color="#ffffff">鍚﹀垯鎴戜滑鑷繁澶勭悊鏂囨湰錛屾垨淇濆瓨錛屾垨媯嫻嬫槸鍚﹂摼鎺ュ悗鎵撳紑錛岀瓑絳?/font></font></div> <div style="margin: 0in 0in 0in 2in; font-size: 10pt;"><font face="Courier New">DoProcessText(CString(Data.bstrVal));</font></div> <div style="margin: 0in 0in 0in 2.5in; font-size: 10pt;"><font face="Courier New">//Process the text</font></div> <div style="margin: 0in 0in 0in 1.5in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New"><strong> else</strong> </font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">{     <font style="background-color: #808080;" color="#ffffff">//</font><font style="background-color: #808080;" color="#ffffff">鏃笉鏄摼鎺ワ紝涔熶笉鏄枃鏈紝鍙涓烘槸鏉ヨ嚜澶栭儴錛堝Windows Shell錛夌殑鏂囦歡鎷栨斁</font></font></div> <div style="margin: 0in 0in 0in 1.5in; font-size: 10pt;"><font face="Courier New">DoOnDropFiles(pdt);</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-size: 10pt;"><font style="background-color: #808080;" color="#ffffff" face="Courier New">//婕旂ず濡備綍浠嶪HTMLDataTransfer寰楀埌IDataObject</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"><strong> void</strong> CHtmlDocument2::DoOnDropFiles(CComQIPtr<IHTMLDataTransfer> pDataTransfer)</p> </font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">CComQIPtr<IServiceProvider>  </font><font face="Courier New">psp;</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">CComQIPtr<IDataObject>  </font><font face="Courier New">pdo;</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New"><strong> if</strong> ( FAILED(pDataTransfer->QueryInterface(IID_IServiceProvider, (void **) &psp)) )</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New"><strong> return</strong> ;</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New"><strong> if</strong> ( FAILED(psp->QueryService(IID_IDataObject, IID_IDataObject, (void **) &pdo)) )</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New"><strong> return</strong> ;</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">COleDataObject DataObject;</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">DataObject.Attach(pdo);</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">......</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">}</font></div> </blockquote> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-weight: bold; font-size: 10pt;"><font face="Courier new" size="3">6銆佸啀嬈″洖鍒版爣鍑嗘柟娉?/font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">涓? 榪伴氳繃Event Sink鍝嶅簲緗戦〉鎷栨嫿鐨勬柟娉曞凡緇忚兘澶熷緢濂藉湴宸ヤ綔錛屽彲璇?#8220;瓚嬩簬瀹岀編”浜嗭紝浣嗕粛鏈変袱涓?#8220;灝?#8221;闂錛氱涓錛屽繀欏諱笌document寤虹珛榪炴帴鎵嶈兘宸ヤ綔錛岃屽緩绔嬭繛鎺? 鐨勬椂鏈轟笉瀹規槗鎺屾彙錛圡SDN涓帹鑽愮殑浣嶇疆鏄疍ocumentComplete錛屼絾鍦∟avigateComplete涓篃鍙紝鎴栬呮槸媯嫻嬪埌 WebBrowser鐨剅eadystate鍙樹負READYSTATE_INTERACTIVE鏃惰繘琛岃繛鎺ワ級銆傜浜岋紝瀹炵幇鏂規硶榪樻槸鐣ユ樉澶嶆潅銆?/font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">鏈夋病鏈夋洿綆鍗曠殑鏂規硶鍛紵鎴戝喅瀹氬啀嬈″GetDropTarget榪涜“璋冪爺”銆傛墍璋?#8220;韙忕牬閾侀瀷鏃犺澶勶紝寰楁潵鍏ㄤ笉璐瑰姛澶?#8221;錛屾檭浜嗕竴鐪糋etDropTarget鏂規硶鐨勫0鏄庡悗錛岀伒鏈轟竴鍔紝鎴戝拷鐒舵兂鍒頒簡鍔炴硶銆備簨瀹炶瘉鏄庯紝榪欐槸瀹岀編鐨勮В鍐沖姙娉曘?/font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">璁? 鎴戜滑鍐嶆潵鐪嬬湅GetDropTarget鐨勫0鏄庯紝鍏朵腑絎竴涓弬鏁版寚鍚慚SHTML鎻愪緵鐨勭己鐪丏ropTarget瀹炵幇錛岃岀浜屼釜鍙傛暟鐢ㄤ互榪斿洖搴旂敤紼嬪簭鐨勮嚜 瀹氫箟DropTarget瀹炵幇錛屽鏋滃湪GetDropTarget涓繑鍥濻_OK錛孧SHTML灝嗕互搴旂敤紼嬪簭鎻愪緵鐨勮嚜瀹氫箟DropTarget鏇挎崲緙虹渷鐨? DropTarget瀹炵幇銆?/font></div> <div style="margin: 0in; font-size: 10pt;"><blockquote dir="ltr" style="margin-right: 0px;"> <p style="margin: 0in; font-size: 10pt;">HRESULT<font face="Courier New"> GetDropTarget( IDropTarget *pDropTarget, IDropTarget **ppDropTarget);</font></p> <p style="margin: 0in; font-weight: bold; font-size: 10pt; font-family: 瀹嬩綋;"><font face="Courier New">鍙傛暟璇存槑</font></p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"><strong> pDropTarget</strong> </p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt;">[in]<font face="Courier New"> Pointer to an IDropTarget interface for the current drop target object supplied by MSHTML. </font></p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"><strong> ppDropTarget</strong> </p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt;">[out]<font face="Courier New"> Address of a pointer variable that receives an IDropTarget interface pointer for the alternative drop target object supplied by the host.</font></p> </blockquote></div> <div style="margin: 0in; font-size: 10pt;"> <p style="margin: 0in; font-size: 10pt;"><font face="Courier New">鎯沖埌浜嗗悧錛熻В鍐抽棶棰樼殑鍏抽敭灝卞湪浜庣涓涓弬鏁皃DropTarget銆傜浉淇″緢澶氭祻瑙堝櫒鍦ㄥ鐞嗙殑鏃跺欓兘蹇界暐鎺変簡絎竴涓弬鏁拌屽彧鏄皢鑷繁鐨勫疄鐜伴氳繃絎簩涓弬鏁板憡鐭SHTML錛屽洜鑰屼涪澶變簡IE緙虹渷鐨勮涓恒傛棦鐒跺姝わ紝灝嗙己鐪佺殑IDropTarget鎺ュ彛鐨勬寚閽堜繚瀛樹笅鏉ワ紝鍦ㄩ傚綋鐨勬椂鍊欒皟鐢紝涓嶅氨鑳藉淇濈暀IE鐨勫師濮嬫嫋鏀捐涓轟簡鍚楋紵</font></p> <p style="margin: 0in; font-size: 10pt;"><font face="Courier New"></font></p> <p style="margin: 0in; font-size: 10pt;"><font face="Courier New"></font></p> <p style="margin: 0in; font-size: 10pt;"><font face="Courier New"></font></p> <p style="margin: 0in; font-size: 10pt;"></p> </div> <div style="margin: 0in; font-weight: bold; font-size: 10pt;"><font face="Courier new" size="3"> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-weight: bold; font-size: 10pt;"><font face="Courier new" size="3">7銆佸畬緹庡疄鐜?/font></div> </font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">瀹屾暣鐨勪唬鐮佸氨涓嶅啀緇欏嚭錛屾垜浠彧鍒楀嚭鍏抽敭鐨勯儴鍒嗕綔涓虹ず渚嬨傚亣璁炬垜浠敤鏉ュ疄鐜癐DropTarget鎺ュ彛鐨勭被鍙仛CBrowserDropTarget錛?/font></div> <blockquote dir="ltr" style="margin-right: 0px;"> <div style="margin: 0in; font-size: 10pt;"><font style="background-color: #808080;" color="#ffffff" face="Courier New">//鏋勯犲嚱鏁幫紝浼犲叆鍙傛暟鍗蟲槸浠嶨etDropTarget寰楀埌鐨勯偅涓猵DropTarget錛屽畠鏄疢SHTML鐨勭己鐪佸疄鐜?/font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">CBrowserDropTarget::CBrowserDropTarget(IDropTarget *pOrginalDropTarget)</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">:  </font><font face="Courier New">m_bDragTextToInputBox(FALSE)</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font style="background-color: #808080;" color="#ffffff" face="Courier New">//榪欎釜甯冨皵鍙橀噺鐢ㄦ潵鍒ゆ柇鏄惁姝e湪鍚慖nputBox鎷栨嫿鏂囧瓧</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">,  </font><font face="Courier New">m_pOrginalDropTarget(pOrginalDropTarget)</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font style="background-color: #808080;" color="#ffffff" face="Courier New">//m_pOrginalDropTarget鐢ㄦ潵淇濆瓨MSHTML鐨勭己鐪佸疄鐜?/font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">STDMETHODIMP CBrowserDropTarget::DragEnter(/* [unique][in] */IDataObject __RPC_FAR *pDataObj,</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">/* [in] */ DWORD grfKeyState,</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">/* [in] */ POINTL pt,</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">/* [out][in] */ DWORD __RPC_FAR *pdwEffect)</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font style="background-color: #808080;" color="#ffffff" face="Courier New">//璋冪敤緙虹渷鐨勮涓?/font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New"><strong> return</strong> m_pOrginalDropTarget->DragEnter(pDataObj, grfKeyState, pt, pdwEffect);</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">STDMETHODIMP CBrowserDropTarget::DragOver(/* [in] */ DWORD grfKeyState,</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">/* [in] */ POINTL pt,</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">/* [out][in] */ DWORD __RPC_FAR *pdwEffect)</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font style="background-color: #808080;" color="#ffffff" face="Courier New">//鍦ㄧ綉欏靛唴鎷栨嫿鏂囧瓧鏃惰繖涓兼槸DROPEFFECT_COPY錛堟嫋鎷界殑鏂囧瓧涓嶅睘浜庤緭鍏ユ涓級</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font style="background-color: #808080;" color="#ffffff" face="Courier New">//鎴朌ROPEFFECT_COPY | DROPEFFECT_MOVE錛堟嫋鎷界殑鏂囧瓧鏄緭鍏ユ涓殑鏂囧瓧錛?/font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">DWORD dwTempEffect = *pdwEffect;</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font style="background-color: #808080;" color="#ffffff" face="Courier New">//鎺ヤ笅鏉ヨ皟鐢↖E鐨勭己鐪佽涓?/font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">HRESULT hr = m_pOrginalDropTarget->DragOver(grfKeyState, pt, pdwEffect);</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font style="background-color: #808080;" color="#ffffff" face="Courier New">//鍒ゆ柇鏄惁鏄線杈撳叆妗嗘嫋鎷芥枃瀛?/font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">m_bDragTextToInputBox = IsDragTextToInputBox(dwOldEffect, *pdwEffect);</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New"><strong> if</strong> ( !m_bDragTextToInputBox )</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font style="background-color: #808080;" color="#ffffff" face="Courier New">//涓嶆槸寰杈撳叆妗嗘嫋鎷芥枃瀛楋紝鍒欎嬌鐢ㄥ師濮嬬殑鎷栨嫿鏁堟灉銆傚惁鍒欏拰IE鐨勭己鐪佹晥鏋滀竴鏍封斺斾篃灝辨槸娌℃湁鏁堟灉</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">*pdwEffect = dwTempEffect;</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New"><strong> return</strong> S_OK;</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-size: 10pt;"><font style="background-color: #808080;" color="#ffffff" face="Courier New">//鏍規嵁璋冪敤緙虹渷琛屼負鍓嶅悗鐨凟ffect鍊煎垽鏂槸鍚︽槸寰杈撳叆妗嗘嫋鎷芥枃瀛?/font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">BOOL CBrowserDropTarget::IsDragTextToInputBox(DWORD dwOldEffect, DWORD dwNewEffect)</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font style="background-color: #808080;" color="#ffffff" face="Courier New">//濡傛灉鏄妸闈炶緭鍏ユ涓枃瀛楀線杈撳叆妗嗘嫋鍔紝鍒檇wOldEffect涓巇wNewEffect鐩哥瓑錛岄兘鏄疍ROPEFFECT_COPY</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">BOOL bTextSelectionToInputBox = ( dwOldEffect == DROPEFFECT_COPY )</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">&& ( dwOldEffect == dwNewEffect );</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font style="background-color: #808080;" color="#ffffff" face="Courier New">//濡傛灉鏄妸鏂囧瓧浠庝竴涓緭鍏ユ鎷栧埌鍙︿竴涓緭鍏ユ錛屽垯dwOldEffect涓篋ROPEFFECT_COPY | DROPEFFECT_MOVE錛?/font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font style="background-color: #808080;" color="#ffffff" face="Courier New">//鑰宒wNewEffect鐨勫煎彲鑳戒負DROPEFFECT_MOVE錛堥粯璁ゆ儏鍐碉級錛屼篃鍙兘涓篋ROPEFFECT_COPY錛堟寜涓婥trl閿椂錛?/font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">BOOL bInputBoxToInputBox = ( dwOldEffect == (DROPEFFECT_COPY | DROPEFFECT_MOVE) )</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">&& ( dwNewEffect == DROPEFFECT_MOVE || dwNewEffect == DROPEFFECT_COPY );</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font style="background-color: #808080;" color="#ffffff" face="Courier New">//鏉ヨ嚜Microsoft Word鐨勬嫋鎷界壒孌婁竴浜涳紝dwOldEffect鏄墍鏈夋晥鏋滅殑緇勫悎鍊?/font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">BOOL bMSWordToInputBox = </font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">( dwOldEffect == (DROPEFFECT_COPY | DROPEFFECT_MOVE | DROPEFFECT_LINK) )</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">&& ( dwNewEffect == DROPEFFECT_MOVE || dwNewEffect == DROPEFFECT_COPY );</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font style="background-color: #808080;" color="#ffffff" face="Courier New">//鏉ヨ嚜Edit Plus鐨勬嫋鎷借繃涔熺壒孌婁竴浜涳紝dwOldEffect鏄釜璐熸暟錛堟鐤戞槸Edit Plus鐨勬嫋鎷藉疄鐜版湁闂錛?/font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">BOOL bEditPlusToInputBox = ( dwOldEffect < 0 )</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">&& ( dwNewEffect == DROPEFFECT_MOVE || dwNewEffect == DROPEFFECT_COPY );</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font style="background-color: #808080;" color="#ffffff" face="Courier New">//涔熻榪樻湁浜涗緥澶栵紝鍙啀娣誨姞</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">......</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New"><strong> return</strong> bTextSelectionToInputBox || bInputBoxToInputBox || bMSWordToInputBox || bEditPlusToInputBox;</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">STDMETHODIMP CBrowserDropTarget::DragLeave()</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font style="background-color: #808080;" color="#ffffff" face="Courier New">//璋冪敤緙虹渷鐨勮涓?/font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New"><strong> return</strong> m_pOrginalDropTarget->DragLeave();</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">STDMETHODIMP CBrowserDropTarget::Drop(/* [unique][in] */ IDataObject __RPC_FAR *pDataObj,</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">/* [in] */ DWORD grfKeyState,</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">/* [in] */ POINTL pt,</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">/* [out][in] */ DWORD __RPC_FAR *pdwEffect)</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New"><strong> if</strong> ( m_bDragTextToInputBox )</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font style="background-color: #808080;" color="#ffffff" face="Courier New">//鏄枃瀛楁嫋鏀撅紝璋冪敤IE鐨勭己鐪佽涓?/font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">return m_pOrginalDropTarget->Drop(pDataObj, grfKeyState, pt, pdwEffect);</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font style="background-color: #808080;" color="#ffffff" face="Courier New">//鍚﹀垯鏄嫋鏀鵑摼鎺ャ佸浘鐗囥佹枃浠剁瓑錛屾寜甯歌鐨処DataObject澶勭悊鏂瑰紡</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">......</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New"><strong> return</strong> S_OK;</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">}</font></div> </blockquote> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">鑷蟲錛屾垜浠氨寰楀埌浜嗕竴涓畬緹庣殑“瓚呯駭鎷栨斁”鐨勫熀鏈鏋訛紝瀹冨湪鎵╁睍鐨勫悓鏃朵繚鐣欎簡IE鐨勯粯璁よ涓猴細</font></div> <ol style="margin-top: 0in; margin-bottom: 0in; margin-left: 0.5in; direction: ltr; unicode-bidi: embed;" type="1"> <li value="1" style="margin-top: 0px; font-size: 10pt; margin-bottom: 0px; vertical-align: middle;"><font face="Courier New">鏂囧瓧鍦ㄩ〉闈㈠唴涓庤緭鍏ユ涔嬮棿鑳藉浜や簰鎷栨斁銆?</font></li> <li style="margin-top: 0px; font-size: 10pt; margin-bottom: 0px; vertical-align: middle;" value="2"><font face="Courier New">鏉ヨ嚜澶栭儴鐨勬枃瀛椾笌緗戦〉杈撳叆妗嗕箣闂翠篃鑳戒氦浜掓嫋鏀?</font></li> <li style="margin-top: 0px; font-size: 10pt; margin-bottom: 0px; vertical-align: middle;" value="3"><font face="Courier New">鎷栨嫿鏃惰兘澶熻嚜鍔ㄦ粴鍔ㄩ〉闈?</font></li> </ol> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">鍏朵綑鐨勫姛鑳斤紝濡傚悜涓嶅悓鐨勬柟鍚戞嫋鎷戒互瀹屾垚涓嶅悓鐨勫伐浣滐紝宸﹂敭鍙抽敭鎷栨斁鎵ц涓嶅悓鐨勫姛鑳斤紝鎸変綇Alt淇濆瓨鏂囧瓧絳夌瓑錛屽彲鏍規嵁闇瑕佽嚜琛屽疄鐜幫紝涓嶅啀璁ㄨ銆?/font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> <div style="margin: 0in; font-weight: bold; font-size: 10pt;"><font face="Courier new" size="3">8銆佷慨姝?/font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">浠婂ぉ鍜?a target="_blank" >Stanley Xu</a>鑱婁簡鍑犱釜閽熷ご錛屽彈鐩婂尓嫻呫傛牴鎹甋tanley鐨勬彁璁紝姣嬮』鍐嶄綔鏄惁寰杈撳叆妗嗘嫋鎷芥枃瀛楃殑鍒ゆ柇錛屽洜涓烘垜浠渶瑕佺殑鍙槸鍦↖E鐨勭己鐪佽涓烘病鏈夐紶鏍囨嫋鎷芥晥鏋滅殑鏃跺欒瀹冩湁鎷栨嫿鏁堟灉錛屽洜姝ゅ彧闇瑕佺畝鍗曞湴鍒ゆ柇璋冪敤IE緙虹渷琛屼負鍚庣殑Effect鍊兼槸鍚︿負0鍗沖彲錛屽涓嬶細</font></div> <div style="margin: 0in; font-size: 10pt;"> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font style="background-color: #808080;" color="#ffffff" face="Courier New">//鍒ゆ柇鏄惁鏄線杈撳叆妗嗘嫋鎷芥枃瀛?/font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">m_bDragTextToInputBox = *pdwEffect != 0;</font></div> </div> <div style="margin: 0in; font-size: 10pt;">綆鍗曡岀洿鎺ワ紝褰撶劧鏇撮噸瑕佺殑鏄細鍙敤銆?/div>  </font></div> <div style="margin: 0in; font-weight: bold; font-size: 10pt;"><font face="Courier new" size="3">9銆佸弬鑰冭祫鏂?/font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">MSDN: <a target="_blank" >IHTMLEventObj Interface</a></font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">MSDN: <a target="_blank" >IHTMLDataTransfer Interface</a></font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">銆?/font><a target="_blank" ><font face="Courier New">Internet Explorer 緙栫▼綆榪幫紙鍗侊級鍝嶅簲鏉ヨ嚜HTML Element鐨勪簨浠墮氱煡鈥斺斿嚑涓ソ鐢ㄧ殑綾?/font></a><font face="Courier New">銆?/font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <br><br> <p id="TBPingURL">Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=677425</p> <br><img src ="http://m.shnenglu.com/mydriverc/aggbug/28966.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/mydriverc/" target="_blank">鏃呴?/a> 2007-07-29 15:40 <a href="http://m.shnenglu.com/mydriverc/articles/28966.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Internet Explorer 緙栫▼綆榪幫紙鍗侊級鍝嶅簲鏉ヨ嚜HTML Element鐨勪簨浠墮氱煡鈥斺斿嚑涓ソ鐢ㄧ殑綾?/title><link>http://m.shnenglu.com/mydriverc/articles/28965.html</link><dc:creator>鏃呴?/dc:creator><author>鏃呴?/author><pubDate>Sun, 29 Jul 2007 07:37:00 GMT</pubDate><guid>http://m.shnenglu.com/mydriverc/articles/28965.html</guid><wfw:comment>http://m.shnenglu.com/mydriverc/comments/28965.html</wfw:comment><comments>http://m.shnenglu.com/mydriverc/articles/28965.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/mydriverc/comments/commentRss/28965.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/mydriverc/services/trackbacks/28965.html</trackback:ping><description><![CDATA[<font face="Courier New">閿瓧錛欻TML Element, Sink</font> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-weight: bold; font-size: 10pt;"><font face="Courier New">1銆佹榪?/font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">瀹炵幇浜嗗Webbrowser鐨剅esuing涔嬪悗鎴戜滑渚夸細鍙戠幇鏈夋椂鍊欐垜浠繕闇瑕佸鐞嗘祻瑙堝櫒涓殑鍏冪礌錛圚TML Element錛夈傝繖縐嶅鐞嗗寘鎷富鍔ㄥ拰琚姩涓や釜鏂歸潰錛屽儚銆?a target="_blank" >FAQ錛氬浣曡闂甒ebBrowser鐨勬粴鍔ㄦ潯</a>銆?/font><font face="Courier New">銆併?a target="_blank" >FAQ錛氭搷綰典笅鎷夊垪琛?/a>銆?/font><font face="Courier New">銆併?a target="_blank" >FAQ錛氫袱縐嶆柟娉曡闂灞傚祵濂楃殑frame</a>銆?/font><font face="Courier New">絳? 鏂囩珷鎵婕旂ず鐨勫氨鏄富鍔ㄧ殑澶勭悊銆傞氬父鎴戜滑浠嶹ebbrowser鑾峰緱涓涓猈eb鏂囨。鎺ュ彛錛圛HTMLDocumentx錛夛紝浠庡畠鍑哄彂渚垮彲璁塊棶鍒版祻瑙堝櫒鎵鍖呭惈 鐨勪竴鍒嘓TML鍏冪礌銆傝岃鍔ㄧ殑澶勭悊鍒欐槸鍦–OM鎶鏈腑縐頒負Sink鐨勬妧鏈紝鎴戞洿鍠滄鐨勮娉曟槸浜嬩歡閫氱煡銆傚綋鏂囨。鐨勪笅杞借繘搴﹀彂鐢熷彉鍖栨椂錛屾垜浠彲浠ヨ幏寰? ProgressChange閫氱煡錛屽綋Webbrowser涓嬭澆瀹孒TML鏂囨。鏃訛紝鎴戜滑鍙互鑾峰緱DocumentComplete鐨勯氱煡錛岃屽綋閾炬帴琚偣 鍑伙紝鎴栧浘鐗囪鎷栧姩鏃訛紝鎴戜滑濡備綍鑾峰緱閫氱煡鍛紵鏈枃甯屾湜鑳藉緇欏嚭閮ㄥ垎鐨勭瓟妗堛?/font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-weight: bold; font-size: 10pt;"><font face="Courier New">2銆丠tmlObj Template</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">濡備綍Sink涓涓狧TML Element騫朵笉鏄湰鏂囩殑閲嶇偣錛屽叾鐞嗚鎴戜笉鏄お浜嗚В錛屼篃鎳掑緱鍘繪悶閫忓交錛屾墍浠ヤ嬌鐢ㄧ幇鎴愮殑搴撴潵瀹炵幇銆侰odeProject涓婄殑涓綃囨枃绔犮?a target="_blank" >CHtmlObj Template</a>銆嬬粰鍑虹殑涓涓ā鏉跨被CHtmlObj灝遍潪甯稿ソ鐢ㄣ備笅闈㈢殑渚嬪瓙鏄拡瀵笻tml Anchor Element鐨勪竴涓疄渚嬪寲銆?/font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <blockquote dir="ltr" style="margin-right: 0px;"> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">#include "HtmlObj.h"</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">class CHtmlAnchorElement : public CHtmlObj<IHTMLAnchorElement, </font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">&DIID_HTMLAnchorEvents> </font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">public:</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">CHtmlAnchorElement(CHtmlDocument2* pParentDoc2);</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">virtual ~CHtmlAnchorElement();</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">virtual HRESULT OnInvoke(DISPID dispidMember,REFIID riid, </font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">LCID lcid, WORD wFlags,</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">DISPPARAMS * pdispparams, VARIANT * pvarResult, </font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">EXCEPINFO * pexcepinfo, </font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">UINT * puArgErr);</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">};</font></div> <div style="margin: 0in; font-size: 10pt;"><br><font face="Courier New">HRESULT CHtmlAnchorElement::OnInvoke(DISPID dispidMember, </font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">REFIID riid, LCID lcid, WORD wFlags,</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">DISPPARAMS * pdispparams, VARIANT * pvarResult,</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">EXCEPINFO * pexcepinfo, </font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">UINT * puArgErr)</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">HRESULT hr = E_NOTIMPL;</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">switch(dispidMember)</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">case DISPID_HTMLELEMENTEVENTS_ONMOUSEOVER :</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">{<font style="background-color: #808080;" color="#ffffff">//褰撻紶鏍囩粡榪囬摼鎺ユ椂錛屾垜浠湪榪欓噷鑾峰緱閫氱煡</font></font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">hr = S_OK;</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">      // TODO: add code to handle on mouse over events</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">break;</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">case DISPID_HTMLELEMENTEVENTS_ONMOUSEOUT :</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">{<font style="background-color: #808080;" color="#ffffff">//褰撻紶鏍囦粠閾炬帴涓婄Щ寮鏃訛紝鎴戜滑鍦ㄨ繖閲岃幏寰楅氱煡錛屽叾瀹冪殑Dispatch ID鍙牴鎹渶瑕佹坊鍔?/font></font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">hr = S_OK;</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">      // TODO: add code to handle on mouse out events</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">break;</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">default: </font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">break;</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">return hr;</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">}</font></div> </blockquote> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">褰? 鎴戜滑寰楀埌鏌愪釜閾炬帴鐨凥TML鎺ュ彛鎸囬拡錛屼究鍙皟鐢–HtmlAnchorElement緇ф壙鑷狢HtmlObj鐨凷etSite(IUnknown *pUnkSite)鎴愬憳鍑芥暟浼犲叆璇ユ帴鍙f寚閽堛傚湪CHtmlObj綾誨唴閮ㄧ敤涓涓櫤鑳芥寚閽坢_spHtmlObj鏉ヤ繚瀛樼浉搴旂殑HTML Element鎺ュ彛鎸囬拡錛屾墍浠ュ綋涓婇潰鐨凮NMOUSEHOVER鍜孫NMOUSEOUT涓や釜浜嬩歡閫氱煡鍒拌揪鏃訛紝浠巑_spHtmlObj灝卞彲浠ヨ闂? IHTMLAnchorElement鐨勬墍鏈夋垚鍛橈紝濡備粠href鑾峰緱閾炬帴鐨刄rl絳夛紝姝ゅ涓嶅啀璧樿堪銆?/font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-weight: bold; font-size: 10pt;"><font face="Courier New">3銆丆HtmlElements綾?/font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">鏈? 浜咰HtmlObj涔嬪悗鎴戜滑鍙堜細鍙戠幇瀹炶返涓父甯鎬細闇瑕佸涓浉鍚岀被鍨嬬殑CHtmlObj銆傛瘮濡傚寘鍚獸rame鐨勭綉欏典腑姣忎釜Frame鐨凥TML Document閮介渶瑕佷竴涓狢HtmlObj鏉ink鍏朵簨浠躲傛墍浠ユ垜浠繕闇瑕佹湁鏁堝湴綆$悊榪欎簺鐩稿悓綾誨瀷鐨凜HtmlObj銆備笅闈㈡槸鎴戝啓鐨勪竴涓畝鍗曠殑妯℃澘綾? CHtmlElements錛屽畠閫氳繃CMap鏉ョ鐞嗗涓狢HtmlObj瀵硅薄銆?/font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <blockquote dir="ltr" style="margin-right: 0px;"> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">template<class THtmlElement> <strong> class</strong> CHtmlElements</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New"><strong> typedef</strong> CMap<LPDISPATCH, LPDISPATCH, THtmlElement*, THtmlElement*> CMapDispToHtmlElement;</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">CMapDispToHtmlElement m_htmlElements;</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">BOOL IsSiteConnected( LPDISPATCH pDisp )</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">THtmlElement *pElement;</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New"><strong> return </strong> m_htmlElements.Lookup( pDisp, pElement );</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"><strong> public</strong> :</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">CHtmlElements(<strong> void</strong> )</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">~CHtmlElements(<strong> void</strong> )</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"><strong> public</strong> :</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New"><strong> void</strong> SetSite( LPDISPATCH pDisp )</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">if ( IsSiteConnected( pDisp ) ) </font><font style="background-color: #808080;" color="#ffffff" face="Courier New">//媯鏌ヤ互閬垮厤澶氫綑鐨凷ink</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 1.5in; font-size: 10pt;"><font face="Courier New"><strong> return</strong> ;</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">THtmlElement *pElement = <strong> new</strong> THtmlElement; <font style="background-color: #808080;" color="#ffffff">//閫氳繃妯℃澘綾誨瀷鍒涘緩鐩稿簲鐨勭被鐨勫疄渚嬭繘琛岃繛鎺?/font></font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">pElement->SetSite( pDisp );</font></div> <div style="margin: 0in 0in 0in 1in; font-size: 10pt;"><font face="Courier New">m_htmlElements.SetAt( pDisp, pElement );</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">}</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">  <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font color="#ffffff"><font style="background-color: #808080;">//鍦ㄥ悎閫傜殑鍦版柟璋冪敤Clear閲婃斁鎵綆$悊鐨勫唴瀛?/font></font></p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">void Clear(void)</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">{</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";">POSITION pos = m_htmlElements.GetStartPosition();</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";">THtmlElement *pElement = NULL;</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";">LPDISPATCH pDisp = NULL;</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";">while (pos != NULL)</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";">{</p> <p style="margin: 0in 0in 0in 1.5in; font-size: 10pt; font-family: "Courier New";">m_htmlElements.GetNextAssoc( pos, pDisp, pElement );</p> <p style="margin: 0in 0in 0in 1.5in; font-size: 10pt; font-family: "Courier New";">m_htmlElements.RemoveKey( pDisp );</p> <p style="margin: 0in 0in 0in 1.5in; font-size: 10pt; font-family: "Courier New";">delete pElement;</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";">}</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">}</p> };</font></div> </blockquote> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">鍋囪鎴戜滑鏈変竴涓薄CHtmlAnchorElement閭f牱媧劇敓鑷狢HtmlObj鐨勭被CHtmlDocument2錛屼嬌鐢–HtmlElements鏃惰繖鏍峰0鏄庯細</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <blockquote dir="ltr" style="margin-right: 0px;"> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"><strong> typedef</strong> CHtmlElements<CHtmlDocument2> CHtmlDocuments;</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"><strong> typedef</strong> CHtmlElements<CHtmlAnchorElement> CHtmlAnchors;</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"><strong> class</strong> CMyView : <strong> public</strong> CHtmlView</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"><strong> private</strong> :</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">CHtmlDocuments m_htmlDocs;</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">CHtmlAnchors m_htmlAnchors;</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">}</font></div> </blockquote> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">鍦―ocumentComplete鏃跺氨鍙互榪欐牱榪炴帴鍒版祻瑙堝櫒鐨勬枃妗e璞★細<br></font></div> <blockquote dir="ltr" style="margin-right: 0px;"> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"><strong> void</strong> CMyView ::OnDocumentComplete(LPDISPATCH pDisp, LPCTSTR lpszURL)</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">{</font></div> <div style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font face="Courier New">m_htmlDocs.SetSite(pDisp);</font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">}</font></div> </blockquote> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">濡? 鏋滄兂涓嬈℃ц繛鎺ヤ笂鏂囨。涓墍鏈夌殑Anchor Element錛屽彲浠ラ氳繃IHTMLDocument2::get_anchors鑾峰緱鍖呭惈鎵鏈塈HTMLAnchorElement鎺ュ彛鎸囬拡鐨? IHTMLElementCollection錛屽啀閬嶅巻鍏朵腑鐨勬瘡涓厓绱狅紝鍒嗗埆璋冪敤m_htmlAnchors.SetSite鍗沖彲銆傚綋鐒訛紝涓嬈℃х殑 Sink鍏ㄩ儴閾炬帴鍙兘騫朵笉鏄釜濂芥敞鎰忥紝鎴戞洿鎰挎剰鍦–HtmlDocument2涓搷搴斾簨浠跺啀閫氳繃鍏跺畠鎵嬫鏉ヨ闂綋鍓嶄綅緗殑HTML Element銆?/font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-weight: bold; font-size: 10pt;"><font face="Courier New">4銆佺粨璁?/font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">鍝? 搴擧TML Element鐨勪簨浠墮氱煡瀵逛簬嫻忚鍣ㄧ紪紼嬫潵璇存槸涓涓潪甯稿己澶х殑鎵嬫錛屽畠鍙互鏇存繁鍏ョ粏鍖栧湴鎺у埗嫻忚鍣ㄤ腑鐨勬枃妗e強鍏禜TML鍏冪礌錛屽疄鐜版洿涓洪珮綰х殑鍔熻兘錛屾瘮濡傛墍 璋撶殑“瓚呯駭鎷栨斁”錛堣澶氬紿楀彛嫻忚鍣ㄩ兘鎻愪緵浜嗚鍔熻兘錛屼絾瀹為檯涓婃病鏈夊摢涓祻瑙堝櫒瀹岀編鍦板疄鐜頒簡瀵筓RL銆佹枃瀛楀強鍥劇墖鐨勬嫋鏀撅級銆?/font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-weight: bold; font-size: 10pt;"><font face="Courier New">5銆佸弬鑰冭祫鏂?/font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"><a target="_blank" >Codeproject: HtmlObj Template</a></font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New"> </font></div> <div style="margin: 0in; font-size: 10pt;"><font face="Courier New">寮曠敤鍦板潃錛氥?a >Internet Explorer 緙栫▼綆榪幫紙鍗侊級鍝嶅簲鏉ヨ嚜HTML Element鐨勪簨浠墮氱煡鈥斺斿嚑涓ソ鐢ㄧ殑綾?/a>銆?/font></div> <br><br> <p id="TBPingURL">Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=621961</p> <br><img src ="http://m.shnenglu.com/mydriverc/aggbug/28965.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/mydriverc/" target="_blank">鏃呴?/a> 2007-07-29 15:37 <a href="http://m.shnenglu.com/mydriverc/articles/28965.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Internet Explorer 緙栫▼綆榪幫紙涔濓級鍦ㄨ嚜宸辯殑嫻忚鍣ㄤ腑宓屽叆Google宸ュ叿鏉?/title><link>http://m.shnenglu.com/mydriverc/articles/28964.html</link><dc:creator>鏃呴?/dc:creator><author>鏃呴?/author><pubDate>Sun, 29 Jul 2007 07:25:00 GMT</pubDate><guid>http://m.shnenglu.com/mydriverc/articles/28964.html</guid><wfw:comment>http://m.shnenglu.com/mydriverc/comments/28964.html</wfw:comment><comments>http://m.shnenglu.com/mydriverc/articles/28964.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/mydriverc/comments/commentRss/28964.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/mydriverc/services/trackbacks/28964.html</trackback:ping><description><![CDATA[<p style="margin: 0in; font-size: 10pt;"><font face="Courier New">鍏抽敭瀛楋細Google Toolbar, Explorer Bars, ToolBands, IObjectWithSite, IDeskBand</font></p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in; font-weight: bold; font-size: 10pt;">1<font face="Courier New">銆佹榪?/font></p> <p style="margin: 0in; font-size: 10pt;">銆銆Internet Explorer<font face="Courier New">寮哄ぇ鑰屾柟渚跨殑鍙紪紼嬭兘鍔涘拰鍙墿灞曡兘鍔涗負鍏舵姠鍗犳祻瑙堝櫒甯傚満鍙皳鏄珛涓嬩簡姹楅┈鍔熷姵銆傚彲緙栫▼涓昏浣撶幇涓ゆ柟闈細</font></p> <ul style="margin-top: 0in; margin-bottom: 0in; margin-left: 0.5in; direction: ltr; unicode-bidi: embed;" type="disc"> <li style="margin-top: 0px; font-size: 10pt; margin-bottom: 0px; vertical-align: middle;"><font face="Courier New">瀹炵幇嫻忚鍔熻兘鐨勯儴鍒嗚鍖呰鎴愪竴涓帶浠垛斺擶ebBrowser Control錛屽紑鍙戜漢鍛樺彲浠ュ湪鑷繁鐨勫簲鐢ㄧ▼搴忎腑宓屽叆瀹冧粠鑰屼嬌紼嬪簭鍏鋒湁璁塊棶Internet涓婄綉欏電殑鑳藉姏錛屽悓鏃禬ebBrowser Control涔熻兘澶熻鐏墊椿鍦拌嚜瀹氫箟浠ユ弧瓚充笉鍚岀殑闇瑕併?/font> </li> <li style="margin-top: 0px; font-size: 10pt; margin-bottom: 0px; vertical-align: middle;"><font face="Courier New">鍙Microsoft Internet Explorer搴旂敤紼嬪簭鏈韓宓屽叆鐨勬祻瑙堝櫒鎺т歡緙栫▼錛屼竴鑸氳繃BHO錛圔rowser Helper Object錛夋潵瀹炵幇銆?/font> </li> </ul> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in; font-size: 10pt; font-family: 瀹嬩綋;"><font face="Courier New">銆銆鍙墿灞曡兘鍔涘垯浣撶幇鍦ㄥ嚑涓柟闈細</font></p> <ul style="margin-top: 0in; margin-bottom: 0in; margin-left: 0.5in; direction: ltr; unicode-bidi: embed;" type="disc"> <li style="margin-top: 0px; font-size: 10pt; margin-bottom: 0px; vertical-align: middle;"><font face="Courier New">宓屽叆寮忛潰鏉垮瀷鎵╁睍錛屽寘鎷珽xplorer Bars錛堝鏀惰棌澶廣佹悳绱€佸巻鍙茬瓑宓屽叆IE涓葷獥鍙g殑澶у瀷闈㈡澘錛? Tool Bands錛堝Google Toolbar銆丮SN Toolbar絳夊祵鍏E鐨勫伐鍏鋒潯錛? 鍜孌esk Bands錛堝蹇熷惎鍔ㄨ繖綾誨祵鍏ヤ換鍔℃爮鐨勯潰鏉匡紝瀹為檯涓婃槸Explorer澶栧3鐨勬墿灞曪級銆傝繖鍑犵闈㈡澘鐨勭紪鍐欐柟娉曠浉宸棤鍑狅紝涓嶅悓涔嬪涓昏鍦ㄤ簬鍚戠郴緇熸敞鍐屾柟寮忕殑涓嶅悓銆?/font> </li> </ul> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in; font-size: 10pt; font-family: "courier new";" align="center"><img alt="Explorer bars" src="http://blog.csdn.net/images/blog_csdn_net/cathyeagle/32965/o_ExplorerBar.jpg"></p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in;" align="center"><font face="Courier new" size="2"><img alt="Tool bands" src="http://blog.csdn.net/images/blog_csdn_net/cathyeagle/32965/o_ToolBand.jpg"></font></p> <p style="margin: 0in;" align="center"><font face="Courier new" size="2"><img alt="Desk band" src="http://blog.csdn.net/images/blog_csdn_net/cathyeagle/32965/o_DeskBand.jpg"></font></p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <ul style="margin-top: 0in; margin-bottom: 0in; margin-left: 0.5in; direction: ltr; unicode-bidi: embed;" type="disc"> <li style="margin-top: 0px; font-size: 10pt; margin-bottom: 0px; vertical-align: middle;"><font face="Courier New">鏄弬鏁板瀷鎵╁睍錛屽寘鎷負嫻忚鍣ㄥ鍔犱笂涓嬫枃鑿滃崟欏癸紙璋冪敤鑴氭湰錛夈佷負嫻忚鍣ㄤ富鑿滃崟澧炲姞鑿滃崟欏廣佷負嫻忚鍣?#8220;鏍囧噯鎸夐挳”宸ュ叿鏉℃坊鍔犳寜閽瓑銆?/font> </li> <li style="margin-top: 0px; font-size: 10pt; margin-bottom: 0px; vertical-align: middle;"><font face="Courier New">鍏朵粬鎵╁睍錛屽鏂囦歡涓嬭澆鐨勬墿灞曪紙Custom Download Manager錛夈佸湴鍧鏍忔墿灞曪紙鎼滅儲鎵╁睍錛夌瓑銆?/font> </li> </ul> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in; font-size: 10pt;"><font face="Courier New">銆銆闅忕潃IE鐨勫彂灞曪紝鍚勭綾誨瀷鐨勬墿灞曢亶鍦板紑鑺憋紝鍏朵腑鏈涓哄紩浜烘敞鐩殑錛屽綋灞炲湴鍧鏍忔墿灞曞拰宸ュ叿鏉℃墿灞曪紙鍑犱箮鎴愪簡鍏靛蹇呬簤涔嬪湴錛夈傛湰鏂囪璁虹殑涓婚錛屾鏄伐鍏鋒潯鐨勬墿灞曘?/font></p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in; font-weight: bold; font-size: 10pt;">2<font face="Courier New">銆侀棶棰樼殑鎻愬嚭</font></p> <p style="margin: 0in; font-size: 10pt;"><font face="Courier New">銆銆涓や釜鍘熷洜淇冩垚浜咷oogle Toolbar鐨勬祦琛岋紝涓鏄箍鍛婄獥鍙g殑娉涙互銆佷簩鏄疓oogle Search銆侴oogle“綆鍗?#8221;錛堝疄鍒欎竴鐐歸兘涓嶇畝鍗曪紝娌℃湁鎼滅儲寮曟搸鐨勫己鍔涙敮鎸侊紝Toolbar鐨勭敤閫斿氨澶у彈闄愬埗錛夊湴鎶撲綇浜嗚繖涓ょ偣錛岃繀閫熷崰棰嗕簡甯傚満銆?/font></p> <p style="margin: 0in; font-size: 10pt;"><font face="Courier New">銆銆鎻掍歡鐨勪竴澶уソ澶勫湪浜庡彲浠ヤ笉淇敼涓葷▼搴忥紝鍙渶鎹竴涓牱瀛愬樊涓嶅浣嗗姛鑳芥洿寮虹殑涓滆タ灝卞彲浠ヤ嬌寰楁暣涓簲鐢ㄧ▼搴忓姛鑳藉寮猴紝鎵浠E涓嶅崌綰уぇ瀹朵篃瑙夊緱Google Toobar瓚婃潵瓚婂ソ鐢ㄣ備簬鏄埄鐢╓ebBroser Control緙栧啓嫻忚鍣ㄧ殑寮鍙戜漢鍛樺氨鎯籌紝濡傛灉鑳藉儚IE涓鏍鋒敮鎸佷笂榪拌繖浜涙墿灞曪紝涓嶅氨鑳芥妸Google Toolbar鎷胯繃鏉ョ敤浜嗗悧錛熷叾浠栫殑浜嬩氦緇橤oogle鍘誨仛灝辮浜嗐傝繖灝辨槸鎴戜滑瑕佽璁虹殑闂錛?#8220;濡備綍鍦ㄨ嚜宸辯殑嫻忚鍣ㄤ腑宓屽叆Google Toolbar”銆?/font></p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in; font-weight: bold; font-size: 10pt;">3<font face="Courier New">銆佸垎鏋?/font></p> <p style="margin: 0in; font-size: 10pt;"><font face="Courier New">銆銆寰蔣騫舵湭鍦∕SDN涓鏄庡浣曞皢Google Toolbar榪欑被IE鐨勫伐鍏鋒潯鎻掍歡宓屽叆鑷繁鐨勫簲鐢ㄧ▼搴忥紝浣嗗叾鍩轟簬COM鐨勮璁℃柟娉曞疄闄呬笂緇欎簣浜嗘垜浠繖涓兘鍔涳紙鍒涘緩宓屽叆寮忕殑宸ュ叿鏉$殑鏂規硶騫朵笉鏄湰鏂囩殑閲嶇偣錛屾澶勭暐鍘伙紝鏈夊叴瓚g殑鏈嬪弸鍙互鍙傝僊SDN錛夈傛垜浠煡閬擄紝闄や簡IUnknown鎺ュ彛澶栵紝Bands鍜孊ars錛堜互涓嬬畝縐癇and瀵硅薄錛夎繕闇瑕佸疄鐜頒笁涓帴鍙o細IObjectWithSite錛孖PersistStream鍜孖DeskBand銆傚綋鐢ㄦ埛閫夋嫨宸ュ叿鏉℃垨闈㈡澘鏃訛紝鍏跺鍣紙濡侷E鐨勫澹蟲鏋訛級灝變細璋冪敤Band瀵硅薄鐨処ObjectWithSite::SetSite鏂規硶錛堣鏂規硶浠呴渶瑕佷竴涓狪Unknown綾誨瀷鐨勬寚閽堬級錛屽皢鑷繁瀹炵幇鐨処Unknown鎸囬拡浼犻掔粰Band瀵硅薄銆傝繖灝辨槸鏁翠釜鎻掍歡寮濮嬬湡姝f縺媧葷殑鍏ュ彛錛屼篃鏄垜浠殑鐫鎵嬬偣銆?/font></p> <p style="margin: 0in; font-size: 10pt;"></p> <p style="margin: 0in; font-size: 10pt;">銆銆MSDN<font face="Courier New">涓鍒幫紝涓鑸潵璇達紝Band瀵硅薄瀵逛簬SetSite鏂規硶鐨勫疄鐜伴渶瑕佸畬鎴愪互涓嬪嚑浠朵簨錛?/font></p> <ol> <li><font face="Courier New"><font size="2">濡傛灉褰撳墠Band瀵硅薄鎸佹湁鍙﹀鐨凷ite鎸囬拡錛屽垯棣栧厛閲婃斁璇ユ寚閽堛?/font></font> </li> <li> <div><font face="Courier New"><font size="2">濡傛灉瀹瑰櫒鍚慡etSite鏂規硶浼犲叆鐨勬槸涓涓┖鎸囬拡錛屽垯琛ㄧず瑕佸垹闄よBand瀵硅薄錛屾鏃禨etSite榪斿洖S_OK鍗沖彲銆?/font></font></div> </li> <li> <div><font face="Courier New"><font size="2">濡傛灉瀹瑰櫒浼犲叆鐨勪笉鏄┖鎸囬拡錛屽垯闇瑕佽緗柊鐨凷ite錛?</font></font></div> <ol style="margin-top: 0in; margin-bottom: 0in; margin-left: 0.5in; direction: ltr; unicode-bidi: embed;" type="1"> <li value="1" style="margin-top: 0px; font-size: 10pt; margin-bottom: 0px; vertical-align: middle; font-family: "Courier New";"><font face="Courier New">瀵規IUnknown鎸囬拡鎵鎸囩殑鏂癝ite璋冪敤QueryInterface鏌ヨ寰楀埌鍏禝OleWindow鎺ュ彛銆?/font> </li> <li style="margin-top: 0px; font-size: 10pt; margin-bottom: 0px; vertical-align: middle; font-family: "courier new";" value="2"><font face="Courier New">璋冪敤寰楀埌鐨処OleWindow鎺ュ彛鐨凣etWindow鏂規硶鑾峰彇鐖剁獥鍙g殑鍙ユ焺錛堟紿楀彛鍗蟲槸Band瀵硅薄鐨勬爾韜箣澶勶級騫朵繚瀛樹笅鏉ャ傚鏋滀互鍚庝笉浼氬啀鐢ㄥ埌IOleWindow鎺ュ彛鐨勮瘽灝卞鍏惰皟鐢≧elease銆?/font> </li> <li style="margin-top: 0px; font-size: 10pt; margin-bottom: 0px; vertical-align: middle; font-family: "courier new";" value="3"><font face="Courier New">鐜板湪鍙互鍒涘緩Band瀵硅薄鐨勭獥鍙d簡錛屽綋鐒訛紝瑕佷互絎?姝ュ緱鍒扮殑紿楀彛涓虹埗紿楀彛鏉ュ垱寤猴紝騫朵笖璇ョ獥鍙g洰鍓嶅彧鑳戒互涓嶅彲瑙佺姸鎬佸瓨鍦ㄣ?/font> </li> <li style="margin-top: 0px; font-size: 10pt; margin-bottom: 0px; vertical-align: middle; font-family: "courier new";" value="4"><font face="Courier New">濡傛灉Band瀵硅薄瀹炵幇浜咺InputObject鎺ュ彛錛屽嵆闇瑕佹帴鏀墮敭鐩樿緭鍏ワ紝鍒欒繕闇瑕佸悜瀹瑰櫒浼犳潵鐨凷ite鏌ヨ錛圦ueryInterface錛塈InputObjectSite鎺ュ彛錛屾鎺ュ彛鎸囬拡涔熼渶瑕佷繚瀛樹笅鏉ャ?/font> </li> <li style="margin-top: 0px; font-size: 10pt; margin-bottom: 0px; vertical-align: middle; font-family: "courier new";" value="5"><font face="Courier New">涓婅堪姝ラ瀹屾垚鍚庡嵆鍙繑鍥濻_OK錛屽惁鍒欏簲榪斿洖OLE-defined鐨別rror code鍛婄煡瀹瑰櫒浠涔堝湴鏂瑰嚭浜嗛敊銆?/font> </li> </ol> </li> </ol> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in; font-size: 10pt;"><font face="Courier New">銆銆鏄劇劧錛屽氨鎴戜滑瑕佽璁虹殑闂鑰岃█錛屽彧闇鎹釜瑙掑害錛堢紪鍐橧E澶栧3鐨勭殑瑙掑害錛夋潵鑰冭檻鍗沖彲銆傞鍏堬紝鎴戜滑闇瑕佷竴涓狪Unknown鎺ュ彛錛堝嵆Band瀵硅薄鎵闇鐨凷ite錛夛紝鍏舵闇瑕佷竴涓狪InputObjectSite鎺ュ彛錛岀敤浠ュ拰Band瀵硅薄鐨処InputObject鎺ュ彛浜や簰錛屽鐞嗚緭鍏ョ劍鐐硅漿縐葷殑鎯呭喌銆傛帴涓嬫潵灝卞彲浠ラ氳繃Band瀵硅薄鐨処DeskBand鎺ュ彛鏉ユ樉紺恒侀殣钘廈and瀵硅薄浜嗭紙娉ㄦ剰IDeskBand鎺ュ彛媧劇敓鑷狪DockingWindow鎺ュ彛,鍚庤呭張媧劇敓鑷狪OleWindow鎺ュ彛錛夈?/font></p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in; font-weight: bold; font-size: 10pt;">4<font face="Courier New">銆佸疄鐜?/font></p> <p style="margin: 0in; font-size: 10pt;"><font face="Courier New">銆銆瀹炵幇鍒嗕負涓や釜閮ㄥ垎錛屽叾涓鏄竴涓畝鍗曠殑綾伙紝鐢ㄤ互妯℃嫙IE澶栧3錛屾垜鍙栧悕涓篊IESimulator銆傚叾浜屾槸涓涓鐞咺E鎵╁睍鐨勭被CIEBandPlugInManager錛岀敤浠ョ鐞咮and瀵硅薄鐨勬柟鏂歸潰闈€?/font></p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <blockquote dir="ltr" style="margin-right: 0px;"> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">class CIESimulator : public IInputObjectSite</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">{</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">private:</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">IWebBrowser2 *m_pwb; <font color="#ffffff"><font style="background-color: #999999;">//<font face="Courier New">淇濆瓨WebBrowser Control鐨勬帴鍙f寚閽?/font></font></font></p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">public:</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">CIESimulator(void){};</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">~CIESimulator(void){};</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">void SetIWebBrowser2(IWebBrowser2* pwb);</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";"><font style="background-color: #999999;" color="#ffffff">//IUnknown methods</font></p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">STDMETHODIMP QueryInterface(REFIID, void **);</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">STDMETHODIMP_(ULONG) AddRef(void);</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">STDMETHODIMP_(ULONG) Release(void);</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";"><font style="background-color: #999999;" color="#ffffff">//IInputObjectSite specific methods</font></p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">STDMETHOD(OnFocusChangeIS)(THIS_ IUnknown* punkObj, BOOL fSetFocus);</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">};</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">//IUnknown methods</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">STDMETHODIMP CIESimulator::QueryInterface( REFIID riid, void **ppv )</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">{</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt;">if ( riid == IID_IInputObjectSite )  <font style="background-color: #999999;" color="#ffffff">//</font><font style="background-color: #999999;" color="#ffffff" face="Courier New">榪欎釜鎺ュ彛闇瑕佽嚜宸卞鐞?/font></p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">{</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";">*ppv = static_cast<IInputObjectSite*>(this);</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">}</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt;">else if ( m_pwb )  <font style="background-color: #999999;" color="#ffffff">//</font><font color="#ffffff"><font style="background-color: #999999;"><font face="Courier New">鍏跺畠鐨勪氦緇橶ebBrowser Control鍘誨鐞?/font></font></font></p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">{</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";">m_pwb->QueryInterface( riid, ppv );</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">}</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">return S_OK;</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">}</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">//IInputObjectSite specific methods</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">STDMETHODIMP CIESimulator::OnFocusChangeIS(IUnknown* punkObj, BOOL fSetFocus)</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">{</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt;">return S_OK;  <font style="background-color: #999999;" color="#ffffff">//</font><font style="background-color: #999999;" color="#ffffff" face="Courier New">姝ゅ鎴戜滑綆鍗曞湴榪斿洖</font></p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">}</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">void CIESimulator::SetIWebBrowser2(IWebBrowser2* pwb)</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">{</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">m_pwb = pwb;</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">}</p> </blockquote> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in; font-size: 10pt;"><font face="Courier New">銆銆娉ㄦ剰榪欓噷鎴戜滑騫舵病鏈夊疄鐜癐OleWindow鎺ュ彛鏉ュ悜Band瀵硅薄浼犻掔埗紿楀彛瀵硅薄錛堢獥鍙g殑瀹夸富鍙互鏇存敼錛屾墍浠and瀵硅薄鍒涘緩鐨勭獥鍙g殑鐖剁獥鍙f垜浠茍涓嶅叧蹇冿紝Band瀵硅薄鏌ヨIOleWindow鎺ュ彛鐨勫姩浣滃疄闄呬笂鏄悜WebBrowser Control鏌ヨ錛夛紝鑰屾槸鍦ㄧ◢鍚庣殑CIEBandPlugInManager綾諱腑閫氳繃璋冪敤IDeskBand鐨凣etWindow鏂規硶鑾峰緱Band瀵硅薄鐨勭獥鍙e彞鏌勶紝鍐嶆墜鍔ㄥ皢鍏跺祵鍏ユ垜浠寚瀹氱殑紿楀彛涓?/font></p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in; font-size: 10pt;"><font face="Courier New">銆銆棣栧厛鎴戜滑瀹氫箟涓涓粨鏋勭敤浠ヤ繚瀛楤and鐨勪俊鎭細</font></p> <blockquote dir="ltr" style="margin-right: 0px;"> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">enum eBANDTYPE</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">{</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">btVertical = 0,</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">btHorizontal = 1</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">};</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">enum eBANDSTATE</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">{</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">bsUnInitialized = -1,</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">bsVisible = 0,</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">bsInVisible = 1,</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">bsUnLoaded = 2</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">};</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">typedef struct tagIEBANDINFO</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">{</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">char</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in 0in 0in 1.5in; font-size: 10pt; font-family: "Courier New";">szCLSID[39];</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">char</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in 0in 0in 1.5in; font-size: 10pt; font-family: "Courier New";">szName[MAX_PATH];</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">IUnknown</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";">*puk;</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">HWND</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in 0in 0in 1.5in; font-size: 10pt; font-family: "Courier New";">hBand;</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">UINT</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in 0in 0in 1.5in; font-size: 10pt; font-family: "Courier New";">uMinHeight;</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">UINT</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in 0in 0in 1.5in; font-size: 10pt; font-family: "Courier New";">uBandID;</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">eBANDTYPE</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";">eBandType;</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">eBANDSTATE</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";">eBandState;</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">} IEBANDINFO, *LPIEBANDINFO;</p> </blockquote> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in; font-size: 10pt;"><font face="Courier New">銆銆鍐嶇敤涓涓嚱鏁版潵鑾峰彇鎵鏈塀and鐨勪俊鎭紙浠ヤ笅浠g爜涓虹ず渚嬶紝鍏蜂綋瀹炵幇鏄彲浠庢敞鍐岃〃鎶婃墍鏈塀and鐨勪俊鎭竴涓璇誨嚭錛?/font></p> <blockquote dir="ltr" style="margin-right: 0px;"> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">void CIEBandPlugInManager::GetAllBandCLSID(void)</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">{</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">LPIEBANDINFO pIEBandInfo;</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">pIEBandInfo = new IEBANDINFO();</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">strcpy( pIEBandInfo->szCLSID, "{2318C2B1-4965-11d4-9B18-009027A5CD4F}\0");  <font style="background-color: #999999;" color="#ffffff">//Google Toolbar鐨凜LSID</font></p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">strcpy( pIEBandInfo->szName, GetDisplayName(pIEBandInfo->szCLSID) );</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">pIEBandInfo->uMinHeight = 22;</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">pIEBandInfo->uBandID = m_BandCtrlID++;</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">pIEBandInfo->eBandType = btHorizontal;</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">pIEBandInfo->eBandState = bsUnInitialized;</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt;">m_oaBand.Add( (CObject*)pIEBandInfo );<font color="#ffffff"><font style="background-color: #999999;">//m_oaBand<font face="Courier New">鏄竴涓狢ObArray</font></font></font></p> <p style="margin: 0in; font-size: 10pt; font-family: 瀹嬩綋;"><font face="Courier New">锝?/font></p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in; font-size: 10pt;"><font color="#ffffff"><font style="background-color: #999999;">//鏍規嵁CLSID<font face="Courier New">浠庢敞鍐岃〃鑾峰彇Band鐨勫悕縐?/font></font></font></p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">CString CIEBandPlugInManager::GetDisplayName(CString strCLSID)</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">{</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">TCHAR</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in 0in 0in 1.5in; font-size: 10pt; font-family: "Courier New";">sz[MAX_PATH];</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">HKEY</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in 0in 0in 1.5in; font-size: 10pt; font-family: "Courier New";">hKey;</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">DWORD</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in 0in 0in 1.5in; font-size: 10pt; font-family: "Courier New";">dwSize;</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">strCLSID = "CLSID\\" + strCLSID;</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">if(RegOpenKey(HKEY_CLASSES_ROOT, strCLSID, &hKey) != ERROR_SUCCESS)</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">{</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";">return _T("");</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">}</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">RegQueryValueEx(hKey, NULL, NULL, NULL, (LPBYTE)sz, &dwSize);</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">RegCloseKey(hKey);</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">return sz;</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">}</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in; font-size: 10pt;"><font color="#ffffff"><font style="background-color: #999999;">//<font face="Courier New">閫氳繃Band鐨凜LSID嬋媧籅and</font></font></font></p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">bool CIEBandPlugInManager::ActivateBand( CString strCLSID )</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">{</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt;">LPIEBANDINFO pIEBandInfo = GetBandInfo( strCLSID ); <font style="background-color: #999999;" color="#ffffff">//</font><font color="#ffffff"><font style="background-color: #999999;"><font face="Courier New">浠巑_oaBand涓壘鍒扮鍚堟潯浠剁殑Band鐨勪俊鎭?/font></font></font></p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">if ( !pIEBandInfo )</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">{</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";">return false;</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">}</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">WCHAR wsz[MAX_PATH];  </p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">::MultiByteToWideChar(CP_ACP, 0, strCLSID, -1, wsz, MAX_PATH);</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">CLSID</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";">clsid;</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">HRESULT hr2 = CLSIDFromString( wsz, &clsid);</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">if ( hr2 != NOERROR )</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";">return false;</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">HRESULT hr = ::CoCreateInstance(clsid, NULL, LSCTX_INPROC_SERVER, IID_IUnknown, (void**)&pIEBandInfo->puk); <font color="#ffffff"><font style="background-color: #999999;">//<font face="Courier New">鍒涘緩Band瀵硅薄鐨勫疄渚?/font></font></font></p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">IUnknown* puk = pIEBandInfo->puk;</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">if (FAILED(hr))</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";">return false;</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt;">DoQueryBandInfo( pIEBandInfo );  <font style="background-color: #999999;" color="#ffffff">//</font><font color="#ffffff"><font style="background-color: #999999;"><font face="Courier New">鏌ヨBand瀵硅薄瀹炰緥鐨勪俊鎭?/font></font></font></p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">switch( pIEBandInfo->eBandType ) </p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">{</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">case btVertical:</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";">break;</p> <p style="margin: 0in 0in 0in 1.5in; font-size: 10pt;"><font color="#ffffff"><font style="background-color: #999999;">//鎴戜滑<font face="Courier New">涓嶅鐞哣ertical鐨勯潰鏉?/font></font></font></p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">case btHorizontal:</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">{</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt;">g_pMainFrame->m_wndReBar.AddBar2( pIEBandInfo->hBand, pIEBandInfo->uBandID, pIEBandInfo->uMinHeight, 0, 0); <font style="background-color: #999999;" color="#ffffff">//</font><font color="#ffffff"><font style="background-color: #999999;"><font face="Courier New">灝咮and宓屽叆涓葷獥鍙g殑ReBar涓?/font></font></font></p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";">REBARBANDINFO rbbi;</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";">rbbi.cbSize = sizeof(rbbi);</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";">rbbi.fMask = RBBIM_CHILDSIZE | RBBIM_IDEALSIZE | RBBIM_SIZE;</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";">rbbi.cxMinChild = 0;</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";">rbbi.cyMinChild = pIEBandInfo->uMinHeight;</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";">rbbi.cx = rbbi.cxIdeal = 250;</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";">UINT nCount = g_pMainFrame->m_wndReBar.GetReBarCtrl().GetBandCount();</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";">g_pMainFrame->m_wndReBar.GetReBarCtrl().SetBandInfo(nCount-1, &rbbi); </p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";">break;</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">}</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">default:</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";">break;</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">} </p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">pIEBandInfo->eBandState = bsVisible;</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">return true;</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">}</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in; font-size: 10pt;"><font color="#ffffff"><font style="background-color: #999999;">//<font face="Courier New">鏌ヨBand瀵硅薄瀹炰緥鐨勪俊鎭?/font></font></font></p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">void CIEBandPlugInManager::DoQueryBandInfo(LPIEBANDINFO pIEBandInfo)</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">{</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">IObjectWithSite *pOWS;</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt;"><font color="#ffffff"><font style="background-color: #999999;">//<font face="Courier New">鏌ヨIObjectWithSite鎺ュ彛</font></font></font></p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">HRESULT hr = pIEBandInfo->puk->QueryInterface(IID_IObjectWithSite, (void**)&pOWS);</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">if (SUCCEEDED(hr))</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt;">{     //<font face="Courier New">璁劇疆Site</font></p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt;">pOWS->SetSite( (IUnknown *)&m_IESimulator ); <font style="background-color: #999999;" color="#ffffff">//</font><font color="#ffffff"><font style="background-color: #999999;">m_IESimulator<font face="Courier New">鏄疌IESimulator鐨勪竴涓疄渚嬪璞★紝瀵笲and瀵硅薄鑰岃█錛屽畠灝卞儚IE</font></font></font></p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">}</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">IDeskBand *pdb;</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">hr = pIEBandInfo->puk->QueryInterface(IID_IDeskBand, (void**)&pdb);</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">if (SUCCEEDED(hr))</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt;">{     <font style="background-color: #999999;" color="#ffffff">//</font><font color="#ffffff"><font style="background-color: #999999;"><font face="Courier New">鏌ヨ寰楀埌Band瀵硅薄紿楀彛鐨勫彞鏌勶紝紼嶅欓氳繃璇ュ彞鏌勫皢Band瀵硅薄鐨勭獥鍙e祵鍏ユ垜浠寚瀹氱殑紿楀彛</font></font></font></p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";">pdb->GetWindow(&pIEBandInfo->hBand);</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">}</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt;">ShowBand(pIEBandInfo, TRUE);<font color="#ffffff"><font style="background-color: #999999;">//<font face="Courier New">鏄劇ずBand</font></font></font></p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">}</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">bool CIEBandPlugInManager::ShowBand(LPIEBANDINFO pIEBandInfo, bool bShow)</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">{</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">IDockingWindow *pdw;</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">HRESULT hr = pIEBandInfo->puk->QueryInterface(IID_IDockingWindow, (void**)&pdw);</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">if (SUCCEEDED(hr))</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">{</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";">pdw->ShowDW(bShow);</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">}</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">else</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">{</p> <p style="margin: 0in 0in 0in 1in; font-size: 10pt; font-family: "Courier New";">return false;</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">}</p> <p style="margin: 0in 0in 0in 0.5in; font-size: 10pt; font-family: "Courier New";">return true;</p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">}</p> </blockquote> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in; font-size: 10pt;"><font face="Courier New">銆銆涓嬮潰鏄垜嫻嬭瘯鐨勪竴涓埅鍥撅紝Google鐨勬悳绱€佸箍鍛婄獥鍙f嫤鎴潎鍙甯稿伐浣溿?/font></p> <p style="margin: 0in;" align="center"><font face="Courier new" size="2"><img alt="宓屽叆Google toolbar婕旂ず" src="http://blog.csdn.net/images/blog_csdn_net/cathyeagle/32965/o_EmbedGoogleToolbarSnap.jpg"></font></p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in; font-weight: bold; font-size: 10pt;">5<font face="Courier New">銆佹葷粨</font></p> <p style="margin: 0in; font-size: 10pt;"><font face="Courier New">銆銆涓婅堪鐨勫師鐞嗙湅鏉ュ緢綆鍗曪紝浣嗗叿浣撳疄鐜扮殑鏃跺欎粛鐒墮渶瑕佷綔杈冨鐨勬祴璇曞拰鑰冭檻錛孊and瀵硅薄鐨勭鐞嗗拰緙撳瓨銆佹帴鍙g殑AddRef鍜孯elease絳夈傛椂闂存湁闄愶紝浠g爜涔熷緢涔憋紝涓嶈繃鍙鍘熺悊浜ゅ緟娓呮錛岀浉淇′細瀵規湁鍏磋叮鐨勬湅鍙嬫湁鎵甯姪銆?/font></p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in; font-weight: bold; font-size: 10pt;">6<font face="Courier New">銆佸弬鑰冭祫鏂?/font></p> <p style="margin: 0in; font-size: 10pt;">MSDN:<font face="Courier New">銆?font face="Courier New">Creating Custom Explorer Bars, Tool Bands, and Desk Bands</font>銆?/font></p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";"> </p> <p style="margin: 0in; font-size: 10pt; font-family: "Courier New";">寮曠敤鍦板潃錛氥?a >Internet Explorer緙栫▼綆榪幫紙涔濓級鍦ㄨ嚜宸辯殑嫻忚鍣ㄤ腑宓屽叆Google宸ュ叿鏉?/a>銆?/p> <br><br> <p id="TBPingURL">Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=550698</p> <br><img src ="http://m.shnenglu.com/mydriverc/aggbug/28964.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/mydriverc/" target="_blank">鏃呴?/a> 2007-07-29 15:25 <a href="http://m.shnenglu.com/mydriverc/articles/28964.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Internet Explorer 緙栫▼綆榪幫紙鍏級瀹炵幇嫻忚鍘嗗彶鑿滃崟http://m.shnenglu.com/mydriverc/articles/28963.html鏃呴?/dc:creator>鏃呴?/author>Sun, 29 Jul 2007 07:22:00 GMThttp://m.shnenglu.com/mydriverc/articles/28963.htmlhttp://m.shnenglu.com/mydriverc/comments/28963.htmlhttp://m.shnenglu.com/mydriverc/articles/28963.html#Feedback0http://m.shnenglu.com/mydriverc/comments/commentRss/28963.htmlhttp://m.shnenglu.com/mydriverc/services/trackbacks/28963.html鍏抽敭瀛楋細ITravelLogStg, IEnumTravelLogEntry, ITravelLogEntry

 

1銆佹榪?/p>

Internet Explorer鐨勬祻瑙堝巻鍙茶彍鍗曞湪4.0鐗堟湰寮濮嬪嚭鐜幫紝浣嗙洿鍒?.5涔嬪墠錛屽井杞兘鏈叕甯冪敤浜庤闂祻瑙堝巻鍙茬殑COM鎺ュ彛錛屽浠婂凡鏄疘E6.0澶ц鍏墮亾鐨勫勾浠o紝鐢ㄤ簬璁塊棶嫻忚鍘嗗彶鐨勬帴鍙d篃鏃╁凡鍏竷澶氭椂錛屾湰鏂囩殑鐩殑鍒欐槸璇曞浘鎶涚爾寮曠帀錛岀畝鍗曚粙緇嶇敤浜庤闂祻瑙堝巻鍙茬殑Travel Log鎺ュ彛錛屽茍鐢ㄤ竴涓皬灝忕殑綾籆IETravelLog鏉ュ疄鐜板Travel Log鐨勫皝瑁呫?/p>

 

2銆両OmHistory鎺ュ彛

鍦ㄦ棭浜涙椂鍊欑殑MSDN涓紝鎴戜滑鑳藉鏌ラ槄鍒板叧浜庢祻瑙堝巻鍙茬殑鎺ュ彛浠呮湁IOmHistory錛岃岃鎺ュ彛瀹為檯涓婂搴旂殑鏄祻瑙堝櫒涓彲浠ラ氳繃鑴氭湰璁塊棶鐨?#8220;history”瀵硅薄銆傚浜?#8220;history”瀵硅薄錛孧SDN涓槸榪欐牱璇寸殑錛?/p>

 

For security reasons, the history object does not expose the actual URLs in the browser history. It does allow navigation through the browser history by exposing the back, forward, and go methods. A particular document in the browser history can be identified as an index relative to the current page. For example, specifying -1 as a parameter for the go method is the equivalent of clicking the Back button.

 

This object is available in script as of Microsoft Internet Explorer 3.0.

 

鍗充負浜嗗畨鍏ㄧ殑鍘熷洜錛孖OmHistory鎺ュ彛浠呮彁渚涗簡鏈夐檺鐨勫嚑涓柟娉曟潵瀹屾垚鍦ㄦ祻瑙堝櫒涓墠榪涖佸悗閫絳夋搷浣滐紝騫舵病鏈夋彁渚涜闂巻鍙插垪琛║rl鐨勮兘鍔涖傝繖涔熼毦鎬紝璇ユ帴鍙e湪IE 3.0鏃朵唬宸茬粡瀛樺湪錛岃屽綋鏃禝E騫朵笉鎴愮啛錛屽彲緙栫▼鑳藉姏涔熶笉鐢氬己澶с備竴鐩村埌IE 4.0閫氳繃涓嶹indows 98鎹嗙粦閿鍞竴緇熷ぉ涓嬩箣鍚庯紝鐩稿叧鐨勬枃妗f墠閫愭笎涓板瘜錛屽紿楀彛嫻忚鍣ㄧ瓑鍩轟簬Internet Explorer/WebBrowser Control鐨勫簲鐢ㄨ蔣浠朵篃鎵嶉摵澶╃洊鍦板紑鏉ャ備絾鍦↖E 5.5鎺ュ彛鍏竷涔嬪墠錛岃瀹屽叏妯℃嫙IE鐨凾ravel Log琛屼負錛屽茍涓嶆槸涓浠跺鏄撶殑浜嬨傛渶瀹規槗鎯沖埌鐨勬柟娉曞氨鏄湪BeforeNavigate銆丏ocumentComplete絳変簨浠跺彂鐢熶箣鏃惰褰?淇敼Url騫跺姞浠ヤ繚瀛橈紙鎴戝湪鏃╀簺鏃跺欎篃榪欐牱鍋氳繃錛夛紝浣嗘槸鏁堟灉涓嶇敋鐞嗘兂錛屽挨鍏舵槸嫻忚鍖呭惈Frame鐨勭綉欏墊椂錛屽鐞嗘洿鏄夯鐑︺傚綋鐒訛紝瑕佸畬鍏ㄦā鎷熶害闈為毦浜嬶紝鍙笉榪囧紑鍙戜漢鍛橀兘鐭ラ亾寰蔣鍏竷鎺ュ彛鏄棭鏅氱殑浜嬶紝鎵浠ヤ篃娌℃湁浜鴻姳澶у姏姘斿湪妯℃嫙IE鐨凾ravel Log琛屼負涓娿?/p>

 

3銆乀ravel Log綆浠?/p>

Internet Explorer 5.5鎺ㄥ嚭浠ュ悗錛孴ravel Log鎺ュ彛涔熷氨寮濮嬪嚭鐜板湪MSDN涓紝瀹冩槸涓撻棬涓篛LE宓屽叆WebBrowser Control鐨勫簲鐢ㄧ▼搴忚璁$殑錛屽叾鐩殑鏄?#8220;鎻愰珮鍜屽姞寮虹敤鎴風殑璁塊棶鏃ュ織浣撻獙”錛坕mprove and enhance the user's travel log experience錛夈備簨瀹炰笂錛岀◢鍚庢垜浼氭彁鍒幫紝Travel Log鎺ュ彛姝f棩鐩婃垚涓哄簲鐢ㄧ▼搴忎腑鐨勯噸瑕佹帴鍙d箣涓銆?/p>

寰蔣鍏竷鐨凾ravel Log鍏卞寘鍚笁涓帴鍙o細ITravelLogStg, IEnumTravelLogEntry鍜孖TravelLogEntry銆?/p>

 

  • ITravelLogStg鈥斺旇鎺ュ彛鎻愪緵浜嗙敤浜庡湪Travel Log涓坊鍔犮佸垹闄ゃ佹灇涓炬棩蹇楋紙嫻忚鍘嗗彶錛夌殑鏂規硶錛屾湰鏂囬渶瑕佺敤鍒扮殑鍑犱釜鏂規硶鍒椾婦濡備笅錛?

鏂規硶鍚?nbsp;    鐢ㄩ?/p>

EnumEntries 涓鴻闂棩蹇楅」鍒涘緩鏋氫婦鍣紙IEnumTravelLogEntry鎺ュ彛鎸囬拡錛?/p>

GetRelativeEntry 榪斿洖涓涓棩蹇楅」

TravelTo 璁塊棶涓涓棩蹇楅」

  • IEnumTravelLogEntry鈥斺旇鎺ュ彛鎻愪緵鐢ㄤ簬鏋氫婦鏃ュ織欏規墍蹇呴渶鐨勬柟娉曪紝鏈枃鍙敤鍒頒竴涓柟娉曪細

鏂規硶鍚?nbsp;    鐢ㄩ?/p>

Next   鏋氫婦涓嬩竴涓棩蹇楅」錛堣繑鍥濱TravelLogEntry鎺ュ彛鎸囬拡錛?/p>

  • ITravelLogEntry鈥斺旇鎺ュ彛鍙湁涓や釜鏂規硶錛屽垎鍒敤浜庤繑鍥炴棩蹇楅」鐨凾itle鍜孶rl錛?

鏂規硶鍚?nbsp;    鐢ㄩ?/p>

GetTitle 榪斿洖鏃ュ織欏圭殑Title

GetURL 榪斿洖鏃ュ織欏圭殑Url

 

鎺ュ彛鍑嗗濂戒簡錛屾垜浠篃灝卞緢瀹規槗寰楃煡瀹冧滑涔嬮棿鐨勫叧緋伙細

  • 瑕佸緱鍒扮浉瀵逛簬褰撳墠欏甸潰鐨勬棩蹇楅」鍒楄〃錛岄鍏堝簲閫氳繃ITravelLogStg鎺ュ彛鍒涘緩涓涓灇涓懼櫒錛圛EnumTravelLogEntry鎺ュ彛錛夈?
  • 閫氳繃IEnumTravelLogEntry鏋氫婦鍣ㄧ殑Next鏂規硶鏋氫婦鍑轟竴涓釜鐨勬棩蹇楅」錛圛TravelLogEntry鎺ュ彛錛夈?
  • 鐢盜TravelLogEntry鎺ュ彛鑾峰彇鏃ュ織欏規墍浠h〃鐨勭綉欏電殑Title鍜孶rl騫跺姞浠ュ鐞嗐?
  • 璁塊棶鐩稿浜庡綋鍓嶉〉闈㈢殑鏌愪釜鏃ュ織欏規椂錛岄鍏堢敱ITravelLogStg鐨凣etRelativeEntry鏂規硶鏍規嵁涓庡綋鍓嶉〉鐨勮窛紱誨緱鍒癐TravelLogEntry鎺ュ彛錛屽啀灝嗗悗鑰呬紶鍏TravelLogStg鐨凾ravelTo鏂規硶浠ヨ揪鍒拌闂棩蹇楅」鐨勭洰鐨勶紙濡傚墠榪涘拰鍚庨錛夈?

 

涔熻涓嶆槸澶伆褰擄紝鎴戝UML涔熶笉鐔熸倝錛屽熺敤涓涓吉UML搴忓垪鍥捐〃紺哄叾鍏崇郴濡備笅錛?/p>

 

 

 Travel log

 

4銆佸皝瑁匱ravel Log

鎺ヤ笅鏉ワ紝鎴戜滑灝辯敤涓涓畝鍗曠殑綾繪潵瀹屾垚瀵筎ravel Log鐨勫皝瑁呫傚涓嬫墍紺猴紝tlogstg.h鍖呭惈浜員ravel Log鐨勭浉鍏蟲帴鍙e0鏄庯紝璇ュご鏂囦歡鍙互鍦≒latform SDK涓壘鍒般?/p>

 

#include "tlogstg.h"

 

class CIETravelLog

{

private:

ITravelLogStg *m_pTravelLogStg;

IEnumTravelLogEntry *m_pEnumLogEntry;

ITravelLogEntry *m_pTravalLogEntry;

IWebBrowser2* m_pWebBrowser;

public:

CIETravelLog(void);

~CIETravelLog(void);

void SetWebBrowser(IWebBrowser2* pWebBrowser);

void BuildHistoryMenu(CMenu * pMenu, unsigned char nCount, bool bForward);

void TravelTo(int nPosition);

};

 

CIETravelLog::CIETravelLog(void)

: m_pTravelLogStg(NULL), m_pEnumLogEntry(NULL), m_pTravalLogEntry(NULL), m_pWebBrowser(NULL)

{

}

 

CIETravelLog::~CIETravelLog(void)

{

if ( m_pTravelLogStg != NULL )

{

m_pTravelLogStg->Release();

}

if ( m_pEnumLogEntry != NULL )

{

m_pEnumLogEntry->Release();

}

if ( m_pTravalLogEntry != NULL )

{

m_pTravalLogEntry->Release();

}

if ( m_pWebBrowser != NULL )

{

m_pWebBrowser->Release();

}

}

 

//灝嗘祻瑙堝櫒鐨処WebBrowser2鎺ュ彛鎸囬拡璧嬩簣CIETravelLog鐨勫疄渚?/font>

void CIETravelLog::SetWebBrowser(IWebBrowser2* pWebBrowser)

{

if ( (m_pWebBrowser == pWebBrowser) || (m_pWebBrowser == NULL) )

{

return;

}

if ( m_pWebBrowser != NULL )

{

m_pWebBrowser->Release();

}

m_pWebBrowser = pWebBrowser;

 

IServiceProvider *pSP;

HRESULT hr = m_pWebBrowser->QueryInterface(IID_IServiceProvider, (LPVOID*)&pSP);

m_pWebBrowser->Release();

if (SUCCEEDED(hr))

{

hr = pSP->QueryService(SID_STravelLogCursor, IID_ITravelLogStg, (LPVOID*)&m_pTravelLogStg);

pSP->Release();

}

}

 

//鍒涘緩嫻忚鍘嗗彶鑿滃崟錛宐Forward鎸囨槑鏄墠榪涜繕鏄悗閫鑿滃崟

void CIETravelLog::BuildHistoryMenu(CMenu * pMenu, unsigned char nCount, bool bForward)

{

if ( m_pTravelLogStg == NULL )

{

return;

}

TLENUMF eFlag = bForward ? TLEF_RELATIVE_FORE : TLEF_RELATIVE_BACK;

if ( FAILED(m_pTravelLogStg->EnumEntries( eFlag, &m_pEnumLogEntry ) ) )

{

return;

}

 

ULONG uFetched;

int i=0;

if ( m_pEnumLogEntry !=NULL )

{

while ( SUCCEEDED( m_pEnumLogEntry->Next( 1, &m_pTravalLogEntry, &uFetched ) ) &&

m_pTravalLogEntry && i<10 )//鎴戜滑鏈澶氬彧闇瑕?0鏉″巻鍙茶彍鍗曪紝鍙牴鎹疄闄呮儏鍐典慨鏀?/font>

{

LPOLESTR pszTitle;

m_pTravalLogEntry->GetTitle( &pszTitle );

CString strTitle = pszTitle;

if ( bForward )

{

//ID_IEHISTORY_MIDDLE鏄瀹氫箟鐨勬煇涓彍鍗曢」ID錛屼粠璇D寮濮嬪墠鍚庡彲浠ュ垱寤?0涓彍鍗曢」錛屽弬瑙佷笅涓鑺?/font>

pMenu->InsertMenu( 0, MF_STRING, ID_IEHISTORY_MIDDLE + ++i, strTitle );

}

else

{

pMenu->InsertMenu( 0, MF_STRING, ID_IEHISTORY_MIDDLE - ++i, strTitle );

}

CoTaskMemFree( pszTitle );

m_pTravalLogEntry->Release();

}

}

}

 

//鏍規嵁涓庡綋鍓嶉〉闈㈢殑鐩稿璺濈鏉ヨ闂巻鍙茬綉欏?/font>

void CIETravelLog::TravelTo(int nPosition)

{

if ( m_pTravelLogStg == NULL )

{

return;

}

if SUCCEEDED(m_pTravelLogStg->GetRelativeEntry( nPosition, &m_pTravalLogEntry ))

{

m_pTravelLogStg->TravelTo( m_pTravalLogEntry );

}

}

 

5銆佷嬌鐢–IETravelLog

鍋囪鏄湪鎴戜滑鑷繁緙栧啓鐨勫紿楀彛嫻忚鍣ㄤ腑浣跨敤Travel Log銆備負綆鍗曡搗瑙侊紝鎴戜滑澹版槑涓涓狢IETravelLog鐨勫叏灞瀵硅薄g_IETravelLog錛屼互渚垮湪浠諱綍鍦版柟璋冪敤銆傜劧鍚庡湪閫傚綋鐨勫湴鏂癸紝濡侰MainFrame鐨凾BN_DROPDOWN娑堟伅錛堝伐鍏鋒潯鑿滃崟涓嬫媺娑堟伅錛夊鐞嗗嚱鏁癘nDropDown涓紝娣誨姞涓嬮潰鐨勪唬鐮侊紝鐢ㄤ互鍒涘緩嫻忚鍘嗗彶鑿滃崟錛?/p>

//GetActiveWebBrowserPtr榪斿洖媧誨姩鐨勬祻瑙堝櫒IWebBrowser2鎺ュ彛鎸囬拡

IETravelLog.SetWebBrowser( GetActiveWebBrowserPtr );

//bForward涓簍rue鍒欏垱寤?#8220;鍓嶈繘”鑿滃崟錛屽惁鍒欏垱寤?#8220;鍚庨”鑿滃崟

IETravelLog.BuildHistoryMenu( &Menu, 10, bForward);

 

浠ヤ笅瀹氫箟涓鴻彍鍗曢」ID鐨勮寖鍥達紝鍓嶅悗鍏卞彲浠ュ綰?0涓彍鍗曢」錛屽彲鏍規嵁瀹為檯鎯呭喌淇敼銆?/p>

#define ID_IEHISTORY_FIRST  60200

#define ID_IEHISTORY_MIDDLE 60210

#define ID_IEHISTORY_LAST   60220

 

娣誨姞鍛戒護澶勭悊鍑芥暟OnTravelHistoryUrl鐢ㄤ互鍝嶅簲浠嶪D_IEHISTORY_FIRST鍒癐D_IEHISTORY_LAST鐨勮彍鍗曞懡浠ゃ?/p>

 

ON_COMMAND_RANGE(ID_IEHISTORY_FIRST, ID_IEHISTORY_LAST, OnTravelHistoryUrl)

 

void CMainFrame::OnTravelHistoryUrl(UINT nID /* Command ID */)

{

//nID - ID_IEHISTORY_MIDDLE鍗充負瑕佽闂殑嫻忚鍘嗗彶鍒板綋鍓嶉〉闈㈢殑璺濈

g_IETravelLog.TravelTo( nID - ID_IEHISTORY_MIDDLE );

}

 

6銆佸啀璋圱ravel Log

鍓嶉潰鎴戞彁鍒?#8220;Travel Log鎺ュ彛姝f棩鐩婃垚涓哄簲鐢ㄧ▼搴忎腑鐨勯噸瑕佹帴鍙d箣涓”錛屾澶勫姞浠ヨ鏄庛備粠寰蔣騫沖彴鐨勫紑鍙戞ā寮忓強瀵煎悜鏉ョ湅錛屽熀浜嶪nternet Explorer/WebBrowser Control鐨勫簲鐢ㄥ娍蹇呬細鎴愪負涓繪祦銆傚湪涓嬩竴浠g殑鎿嶄綔緋葷粺Longhorn涓紝搴旂敤紼嬪簭鐣岄潰鐨勬弿榪板皢瀹屽叏鐢盭ML鐨勪竴涓壒鍖栤斺擷AML鏉ュ畬鎴愶紝鑰孹AML鐨勮В鏋愬皢鐢辨祻瑙堝櫒瀹屾垚銆傚井杞鏈潵搴旂敤紼嬪簭鐨勯儴緗插皢浼氬崄鍒嗗鏄擄紝鏈湴搴旂敤鍜屽熀浜庢祻瑙堝櫒鐨勫簲鐢ㄤ箣闂寸殑宸紓灝嗕細琚愭笎娣″寲錛岃屽疄鐜拌繖涓鐩爣鐨勪竴涓噸瑕佽〃鐜板氨鏄紝鍦ㄥ皢鏉ョ殑鎿嶄綔緋葷粺騫沖彴涓婏紝搴旂敤紼嬪簭瀹為檯涓婃椂鍒婚兘灝嗚繍琛屽湪Internet Explorer涓紝Internet Explorer鍦ㄦ煇縐嶇▼搴︿笂鏉ヨ鍙樻垚浜嗕竴涓鍣ㄣ?/p>

浜庢槸錛屾墡鏍逛簬Internet Explorer鐨凾ravel Log鑷劧鑰岀劧鍦板氨琚暣鍚堝埌浜嗘垜浠殑搴旂敤紼嬪簭涓傚悰涓嶈錛屾垜浠瘡澶╁湪璧勬簮綆$悊鍣ㄥ拰嫻忚鍣ㄤ笂瀹屾垚鐨勫伐浣滐紝涓嶅氨鏄湪Travel Log涓潵鏉ュ洖鍥炲湴璺戝悧錛熷鏋滄墍鏈夌殑搴旂敤紼嬪簭閮藉祵鍏ュ埌Internet Explorer涓繍琛岋紝閭d箞鎴戜滑鍦ㄥ簲鐢ㄧ▼搴忎腑鎵浣滅殑鎿嶄綔渚胯嚜鐒跺緱鍒頒簡璁板綍錛?#8220;鍓嶈繘”鍜?#8220;鍚庨”涔熷氨寰圗asy浜嗐?/p>

寰堝杞歡閮藉凡緇忔垨澶氭垨灝戝湴寮濮嬮噰鐢ㄥ熀浜嶪nternet Explorer鐨勬ā寮忥紝濡侻icrosoft Money銆丮icrosoft Encarta銆乂isual Studio.net鐨勫畨瑁呯▼搴忕瓑絳夛紝閮芥槸寰堝ソ鐨勮寖渚嬨傛墍浠ワ紝灝辯洰鍓嶆潵璇達紝灝嗘垜浠殑搴旂敤紼嬪簭鎸夎繖縐嶆ā寮忕紪鍐欙紙鍙弬鑰冦?a >鍒╃敤嫻忚鍣ㄥ疄鐜扮▼搴忕晫闈笌瀹炵幇鐨勫垎紱?/a>銆嬶級錛屼笉鏄彲浠ユ棭涓鐐硅幏寰?#8220;璁塊棶鏃ュ織鐨勪綋楠?#8221;鍚楋紵

浣曚箰鑰屼笉涓恒?/p>

 

寮曠敤鍦板潃錛氥?a >Internet Explorer 緙栫▼綆榪幫紙鍏級瀹炵幇嫻忚鍘嗗彶鑿滃崟銆?/font>

Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=308620




]]>
Internet Explorer緙栫▼綆榪?涓?http://m.shnenglu.com/mydriverc/articles/28962.html鏃呴?/dc:creator>鏃呴?/author>Sun, 29 Jul 2007 07:18:00 GMThttp://m.shnenglu.com/mydriverc/articles/28962.htmlhttp://m.shnenglu.com/mydriverc/comments/28962.htmlhttp://m.shnenglu.com/mydriverc/articles/28962.html#Feedback0http://m.shnenglu.com/mydriverc/comments/commentRss/28962.htmlhttp://m.shnenglu.com/mydriverc/services/trackbacks/28962.html 1銆佹榪?/strong>

Internet Explorer鏈夊疄鍦ㄥお澶氭病鏈夊叕甯冪殑涓滆タ銆備笂涓綃囨枃绔犮奍nternet Explorer 緙栫▼綆榪幫紙鍏級鑷畾涔夋祻瑙堝櫒涓婁笅鏂囪彍鍗曘嬫彁鍒扮殑鑾峰彇“緙栫爜”鑿滃崟鐨勬柟娉曞氨鏄埄鐢ㄤ簡嫻忚鍣ㄧ殑涓婂眰紿楀彛“Shell DocObject View”鐨勬湭鍏竷鐨勫懡浠D銆傛湰鏂囧皢瑕佷粙緇嶇殑鏄浣曠敤榪欎釜ID鎶?#8220;緙栫爜”鑿滃崟鏀懼埌鎴戜滑鑷繁鐨勮彍鍗曚腑鏉ワ紙濡傚伐鍏鋒潯涓婄殑“緙栫爜”鎸夐挳鐨勪笅鎷夎彍鍗曪級銆?/p>

#define SHDVID_GETMIMECSETMENU 27
......
CComPtr spCT;

hr = pcmdTarget->QueryInterface(IID_IOleCommandTarget, (void**)&spCT);
......
// Get the language submenu
hr = spCT->Exec(&CGID_ShellDocView, SHDVID_GETMIMECSETMENU, 0, NULL, &var);

2銆佸師鐞?/strong>

涓婇潰鎸囧悜IOleCommandTarget鎺ュ彛鐨勬櫤鑳芥寚閽坰pCT鏄粠IDocHostUIHandler::ShowContextMenu鐨勫弬鏁皃cmdTarget寰楀埌鐨勶紝瀹冨叾瀹炰篃鍙互浠嶩TML鏂囨。鎺ュ彛寰楀埌錛岃繖灝辨槸瀹炵幇鐨勫叧閿?/p>

3銆佸疄鐜?/strong>

涓嬮潰鐨勪唬鐮佹紨紺轟簡濡備綍灝?#8220;緙栫爜”鑿滃崟鏀劇疆鍒版垜浠嚜宸辯殑緙栫爜鑿滃崟涓婂幓銆?/p>

void CMainFrame::OnDropDown( NMHDR* pNotifyStruct, LRESULT* pResult )

{

銆const UINT CmdID_GetMimeSubMenu = 27;

// Command ID for getting the Encoding submenu

銆NMTOOLBAR* pNMToolBar = ( NMTOOLBAR* )pNotifyStruct;

銆CMenu menu;

銆CMenu* pPopup = 0;

銆CMyHtmlView *pView = NULL;

銆m_bIsEncodMenuPopup = false;//鏍囧織鍙橀噺錛岀敤浠ュ湪WM_INITMENUPOPUP娑堟伅澶勭悊鍑芥暟涓鏌?#8220;緙栫爜”鑿滃崟

switch ( pNMToolBar->iItem )

銆{

銆......
銆case ID_VIEW_ENCODE://鎸変笅“緙栫爜”鎸夐挳

銆{

銆銆m_bIsEncodMenuPopup = true;

銆銆VERIFY( menu.LoadMenu( IDR_ENCODE ) );//IDR_ENCODE鏄緗殑“緙栫爜”鑿滃崟璧勬簮錛屽唴鍚換鎰忎竴欏瑰崰浣嶇敤鐨勮彍鍗?/font>

銆銆CMyHtmlView = GetActiveMyHtmlView();//媯鏌ュ綋鍓嶆槸鍚﹀瓨鍦ㄦ椿鍔ㄧ殑嫻忚鍣ㄨ鍥劇獥鍙?/font>

銆銆if ( pView != NULL )

銆銆{

銆銆銆LPDISPATCH lpDispatch =pView->GetHtmlDocument();//鑾峰緱鏂囨。鎸囬拡

銆銆銆if ( lpDispatch != NULL )

銆銆銆{

銆銆銆銆// Get an IDispatch pointer for the IOleCommandTarget interface.

銆銆銆銆IOleCommandTarget * pCmdTarget = NULL;

銆銆銆銆HRESULT hr = lpDispatch->QueryInterface(IID_IOleCommandTarget, (void**)&pCmdTarget);

銆銆銆銆if ( SUCCEEDED( hr ) )

銆銆銆銆{

銆銆銆銆銆VARIANT varEncSubMenu;

銆銆銆銆銆::VariantInit( &varEncSubMenu );

銆銆銆銆銆hr = pCmdTarget->Exec( &::CGID_ShellDocView, CmdID_GetMimeSubMenu, OLECMDEXECOPT_DODEFAULT, NULL, &varEncSubMenu );

銆銆銆銆銆if ( SUCCEEDED( hr ) )

銆銆銆銆銆{

銆銆銆銆銆銆// 娣誨姞“緙栫爜”鑿滃崟

銆銆銆銆銆銆MENUITEMINFO miiEncoding;

銆銆銆銆銆銆::memset( &miiEncoding, 0, sizeof(MENUITEMINFO) );

銆銆銆銆銆銆miiEncoding.cbSize = sizeof(MENUITEMINFO);

銆銆銆銆銆銆miiEncoding.fMask = MIIM_SUBMENU;

銆銆銆銆銆銆miiEncoding.hSubMenu = reinterpret_cast< HMENU > (varEncSubMenu.byref);

銆銆銆銆銆銆menu.SetMenuItemInfo(0, &miiEncoding, TRUE);//涓㈡帀璁捐鏃跺崰浣嶇敤鐨勮彍鍗曪紝鏇挎崲涓?#8220;緙栫爜”鑿滃崟

銆銆銆銆銆 }

銆銆銆銆}

銆銆銆}

銆銆}

銆銆pPopup = menu.GetSubMenu( 0 );

銆銆break;

銆}

銆......

銆}

銆if ( pPopup != 0 )

銆{

銆銆CRect rc;

銆銆::SendMessage( pNMToolBar->hdr.hwndFrom, TB_GETRECT, pNMToolBar->iItem, ( LPARAM )&rc );

銆銆rc.top = rc.bottom;

銆銆::ClientToScreen( pNMToolBar->hdr.hwndFrom, &rc.TopLeft() );

銆銆long lResult = pPopup->TrackPopupMenu( TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_RETURNCMD, rc.left, rc.top, this );

銆銆m_bIsEncodMenuPopup = false;

銆銆if ( pNMToolBar->iItem == ID_VIEW_ENCODE )

銆銆{

銆銆銆//鍏朵綑鐨勪簨鏁欑粰嫻忚鍣ㄥ幓鍋氾紝鍙傝冦?a id="CategoryEntryList.ascx_EntryStoryList_Entries__ctl1_TitleUrl" >Internet Explorer 緙栫▼綆榪幫紙浜旓級璋冪敤IE闅愯棌鐨勫懡浠わ紙涓枃鐗堬級銆?/font>

銆銆銆 CFindIEWnd FindIEWnd( pView->m_wndBrowser.m_hWnd, "Internet Explorer_Server");

銆銆銆::SendMessage( FindIEWnd.m_hWnd, WM_COMMAND, MAKEWPARAM(LOWORD(lResult), 0x0), 0 );

銆銆}

銆銆else

銆銆{

銆銆銆SendMessage( WM_COMMAND, MAKEWPARAM(LOWORD(lResult), 0x0), 0 );

銆銆}

銆}

銆*pResult = TBDDRET_DEFAULT;

}


void CMainFrame::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu)

{

銆CMDIFrameWndEx::OnInitMenuPopup(pPopupMenu, nIndex, bSysMenu);

銆if ( m_bIsEncodMenuPopup )

銆{

銆銆//榛樿鎯呭喌涓?#8220;緙栫爜”鐨勬墍鏈夎彍鍗曢」閮芥槸Disabled鐨勶紝鍦ㄦ淇敼鍏剁姸鎬佷負Enabled

銆銆for ( UINT i=0; i GetMenuItemCount(); i++ )

銆銆{

銆銆銆pPopupMenu->EnableMenuItem( pPopupMenu->GetMenuItemID( i ), MF_ENABLED | MF_BYCOMMAND );

銆銆}

銆}

}

榪欐牱涓鏉ワ紝鍘熸湰鍙湪嫻忚鍣ㄤ笂涓嬫枃鑿滃崟涓嚭鐜扮殑“緙栫爜”鑿滃崟灝卞嚭鐜板湪浜嗘垜浠嚜宸辯殑宸ュ叿鏉℃寜閽笅鎷夎彍鍗曚笂錛屾棤闇鏇村鐨勫鐞嗭紝鑿滃崟鐘舵佺殑鏀瑰彉錛岀紪鐮佺殑璁劇疆絳夛紝涓鍒囬兘鏁欑粰嫻忚鍣ㄨ嚜宸卞幓瀹屾垚浜嗐?/p>


]]>
Internet Explorer緙栫▼綆榪?鍏?http://m.shnenglu.com/mydriverc/articles/28961.html鏃呴?/dc:creator>鏃呴?/author>Sun, 29 Jul 2007 07:17:00 GMThttp://m.shnenglu.com/mydriverc/articles/28961.htmlhttp://m.shnenglu.com/mydriverc/comments/28961.htmlhttp://m.shnenglu.com/mydriverc/articles/28961.html#Feedback0http://m.shnenglu.com/mydriverc/comments/commentRss/28961.htmlhttp://m.shnenglu.com/mydriverc/services/trackbacks/28961.html

1銆佹榪?br> Internet Explorer鎻愪緵浜嗛潪甯稿紑鍙戠殑鎺ュ彛錛屼嬌寮鍙戜漢鍛樹笉浠呭彲浠ユ妸鍏舵祻瑙堝櫒鏍稿績宓屽叆搴旂敤紼嬪簭錛岃繕鍙互閫氳繃鍚勭鎺ュ彛浠ュ疄鐜版洿娣卞眰鐨勬帶鍒躲傛湰鏂囧氨灝嗕粙緇嶅嫻忚鍣ㄨ繘琛岄珮綰ф帶鍒剁殑璇濋涔嬩竴鈥斺旇嚜瀹氫箟涓婁笅鏂囪彍鍗曘?/p>

2銆佹渶綆鍗曠殑鎯呭喌
鑷畾涔夌殑IE鍙奧ebBrowser鐨勪笂涓嬫枃鑿滃崟錛屾渶綆鍗曠殑鏂瑰紡灝辨槸鍦ㄦ敞鍐岃〃鐨凥KEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt涓嬫坊鍔犺嚜瀹氫箟鐨勯敭鍊鹼紝姝ラ濡備笅錛?br> 1) 娣誨姞涓涓柊鐨勯敭錛屽叾鍚嶇О鍗充負灝嗘潵鏄劇ず鍦ㄤ笂涓嬫枃鑿滃崟涓殑鑿滃崟欏瑰悕縐幫紝濡傦細
銆HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\&Google Search
2) 灝嗘柊澧炵殑閿殑榛樿鍊艱緗負涓涓寘鍚剼鏈殑緗戦〉鐨刄RL錛堟垨鏂囦歡璺緞鍏ㄥ悕錛夛紝璇ョ綉欏典腑鐨勮剼鏈皢鍦ㄧ敤鎴風偣鍑諱笂涓嬫枃鑿滃崟涓殑“Google Search”鍚庤嫻忚鍣ㄦ墽琛屻?/p>

3)鍦ㄦ柊澧炵殑閿笅榪樺彲浠ユ柊寤轟竴涓簩榪涘埗鍊糃ontexts錛岀敤浠ユ寚瀹氭垜浠柊澧炵殑鑿滃崟欏歸拡瀵圭壒瀹氱殑緗戦〉瀵硅薄鏄惁鍑虹幇錛屽叾鍙栧煎彲浠ユ槸濡備笅鍊肩殑緇勫悎錛堥昏緫鎴栵級

Context銆銆銆銆 Value
Default銆銆銆銆 0x1
Images銆銆銆銆銆0x2
Controls銆銆銆銆0x4
Tables銆銆銆銆銆0x8
Text selection銆0x10
Anchor銆銆銆銆銆0x20

4) 榪樺彲浠ュ緩绔嬩竴涓狣WORD綾誨瀷鐨凢lags欏瑰茍灝嗗叾鍊艱緗負0x01錛岃繖灝嗕嬌寰楀墠榪拌剼鏈湪涓涓ā鎬佺獥鍙d腑鎵ц錛屽氨濂藉儚鏄氳繃window.showModalDialog璋冪敤鐨勶紝浣嗕笉鍚岀殑鏄湪鑴氭湰涓粛鐒跺彲浠ヨ闂畐indow瀵硅薄銆?br> 5) 瀹炰緥鑴氭湰濡備笅錛?/p>

閫氳繃淇敼娉ㄥ唽琛ㄨ嚜瀹氫箟鑿滃崟鐨勬柟娉曢傜敤浜嶪nternet Explorer鍜學ebBrowser錛屼篃鍏鋒湁鑹ソ鐨勬墿灞曟с備絾鎴戜滑濡傛灉甯屾湜鎵ц鐨勬槸涓嶄粎浠呮槸鑴氭湰錛屼簩鏄嚜宸辯殑紼嬪簭涓唬鐮侊紝榪欑鏂規硶灝變笉閫傜敤浜嗐?/p>

3銆佷嬌鐢ㄥ畬鍏ㄨ嚜瀹氫箟鐨勮彍鍗?br>1) IDocHostUIhandler鎺ュ彛鎻愪緵浜嗕竴涓猄howContextMenu鏂規硶錛屽湪闇瑕佹樉紺轟笂涓嬫枃鑿滃崟涔嬪墠錛孧SHTML寮曟搸灝變細璋冪敤瀹炵幇浜咺DocHostUIHandler鎺ュ彛鐨?br>瀹夸富紼嬪簭鐨凷howContextMenu鏂規硶銆?/p>

HRESULTIDocHostUIHandler::ShowContextMenu(
銆銆DWORD dwID,
銆銆POINT *ppt,
銆銆IUnknown *pcmdtReserved,
銆銆IDispatch *pdispReserved
);

dwID鍙傛暟鐨勬剰涔変笌Contexts鐨勭粍鍚堢被浼鹼紱ppt涓鴻彍鍗曠殑寮瑰嚭鐐瑰睆騫曞潗鏍囷紱pcmdtReserved鎺ュ彛鎸囧悜 IOleCommandTarget鎺ュ彛錛屽彲鐢ㄤ簬媯嫻嬬綉欏靛璞$殑鐘舵佸拰鎵ц鍛戒護絳夋搷浣溿俻dispReserved鍦↖E5浠ヤ笂鐗堟湰涓寚鍚戠殑鏄綉欏靛璞$殑 IDispatch鎺ュ彛錛岀敤浠ュ尯鍒嗕笉鍚屽璞★紝姣斿鎴戜滑鍙互榪欐牱鏉ヨ幏寰楃綉欏靛璞$殑鎸囬拡錛?/p>

IHTMLElement *pElem;
HRESULT hr;
hr = pdispReserved->QueryInterface(IID_IHTMLElement, (void**)pElem);
if(SUCCEEDED (hr)) {
銆銆BSTR bstr;
銆銆pElem->get_tagName(bstr);
銆銆USES_CONVERSION;
銆銆ATLTRACE("TagName:%s\n", OLE2T(bstr));
銆銆SysFreeString(bstr);
銆銆pElem->Release();
}

濡傛灉鎴戜滑鍦ㄨ鏂規硶涓繑鍥濻_OK錛屽垯鍛婅瘔MSHTML鎴戜滑灝嗕嬌鐢ㄨ嚜宸辯殑鑿滃崟錛堢晫闈級錛屽鏋滄槸S_FALSE錛屽垯寮瑰嚭榛樿鐨勮彍鍗曘?/p>

2) 瀹炵幇
鍘熺悊娓呮涔嬪悗錛屽疄鐜拌搗鏉ラ潪甯哥畝鍗曪紝鍜屽脊鍑轟竴鑸殑鑿滃崟娌′粈涔堜袱鏍鳳紝涓句緥濡備笅錛屾樉紺轟富妗嗘灦鐨?#8220;鏂囦歡鑿滃崟”錛?/p>

HRESULT CMyHtmlView::OnShowContextMenu(DWORD dwID, LPPOINT ppt, IUnknown * pcmdtReserved, IDispatch *)
{
銆// 杞藉叆涓昏彍鍗?br>銆HMENU hMenuParent = ::LoadMenu( ::AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_MAINFRAME) );
銆if (hMenuParent)
銆{
銆銆HMENU hMenu = ::GetSubMenu( hMenuParent, 0 ); // 鍙栧緱“鏂囦歡”瀛愯彍鍗?br>銆銆if (hMenu)
銆銆{
銆銆 // 鏄劇ず鑿滃崟
銆銆銆TrackPopupMenuEx( hMenu,
銆銆銆銆TPM_LEFTALIGN | TPM_TOPALIGN,
銆銆銆銆ppt->x,
銆銆銆銆ppt->y,
銆銆銆銆::AfxGetMainWnd()->m_hWnd,
銆銆銆銆NULL );
銆銆}
銆銆::DestroyMenu( hMenuParent );
銆}
銆return S_OK;
}

4銆佽嚜瀹氫箟鏍囧噯涓婁笅鏂囪彍鍗?br>1) 鍘熺悊
鏇村鐨勬椂鍊欐垜浠笇鏈涜兘鍦ㄦ祻瑙堝櫒鍘熸潵鑿滃崟鐨勫熀紜涓婁綔涓浜涗慨鏀癸紝濡傚垹鎺?#8220;鏌ョ湅婧愭枃浠?#8221;錛屾坊鍔犺嚜宸辯殑鑿滃崟欏癸紝絳夌瓑錛岃屼笉鏄畬鍏ㄤ笉瑕佸師濮嬬殑鑿滃崟錛屾庝箞鍔炲憿錛熷熷姪MSDN鎻愪緵鐨勪緥瀛愶紝鎴戜滑鏉ョ湅鐪嬶細

HRESULT CBrowserHost::ShowContextMenu(DWORD dwID, POINT *ppt,IUnknown *pcmdTarget,IDispatch *pdispObject)
{
銆#define IDR_BROWSE_CONTEXT_MENU 24641
銆#define IDR_FORM_CONTEXT_MENU 24640
銆#define SHDVID_GETMIMECSETMENU 27
銆#define SHDVID_ADDMENUEXTENSIONS 53

銆HRESULT hr;
銆HINSTANCE hinstSHDOCLC;
銆HWND hwnd;
銆HMENU hMenu;

銆CComPtr spCT;
銆CComPtr spWnd;

銆MENUITEMINFO mii = {0};
銆CComVariant var, var1, var2;
銆hr = pcmdTarget->QueryInterface(IID_IOleCommandTarget, (void**)&spCT);
銆hr = pcmdTarget->QueryInterface(IID_IOleWindow, (void**)&spWnd);
銆hr = spWnd->GetWindow(&hwnd);//鍙栧緱嫻忚鍣ㄧ獥鍙e彞鏌?br>銆hinstSHDOCLC = LoadLibrary(TEXT("SHDOCLC.DLL"));
銆if (hinstSHDOCLC == NULL)
銆{
銆銆// Error loading module -- fail as securely as possible
銆銆return;
銆}
銆hMenu = LoadMenu(hinstSHDOCLC, MAKEINTRESOURCE(IDR_BROWSE_CONTEXT_MENU));
銆hMenu = GetSubMenu(hMenu, dwID);
// Get the language submenu
銆hr = spCT->Exec(&CGID_ShellDocView, SHDVID_GETMIMECSETMENU, 0, NULL, &var);
銆mii.cbSize = sizeof(mii);
銆mii.fMask = MIIM_SUBMENU;
銆mii.hSubMenu = (HMENU) var.byref;
銆// Add language submenu to Encoding context item
銆SetMenuItemInfo(hMenu, IDM_LANGUAGE, FALSE, &mii);
銆// Insert Shortcut Menu Extensions from registry
銆V_VT(&var1) = VT_INT_PTR;
銆V_BYREF(&var1) = hMenu;
銆V_VT(&var2) = VT_I4;
銆V_I4(&var2) = dwID;
銆hr = spCT->Exec(&CGID_ShellDocView, SHDVID_ADDMENUEXTENSIONS, 0, &var1, &var2);
銆// Remove View Source
銆DeleteMenu(hMenu, IDM_VIEWSOURCE, MF_BYCOMMAND);//鍒犻櫎“鏌ョ湅婧愭枃浠?#8221;鑿滃崟欏?br>銆// Show shortcut menu
銆int iSelection = ::TrackPopupMenu(hMenu,
銆銆TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD ,//榪斿洖鐢ㄦ埛閫夋嫨鐨勮彍鍗曞懡浠D
銆銆ppt->x,
銆銆ppt->y,
銆銆0,
銆銆hwnd,
銆銆(RECT*)NULL);
銆// Send selected shortcut menu item command to shell
銆LRESULT lr = ::SendMessage(hwnd, WM_COMMAND, iSelection, NULL);//鍙戦佸埌Internet Explorer_Server榪涜鍐呴儴澶勭悊銆?br>銆FreeLibrary(hinstSHDOCLC);
銆return S_OK;
}

浠? 涓婇潰鐨勪緥瀛愭垜浠湅鍑猴紝鍩烘湰鐨勬柟娉曞氨鏄牴鎹?#8220;shdoclc.dll”鏂囦歡涓殑鑿滃崟璧勬簮寤虹珛鑿滃崟錛屽啀閫氳繃鏉ヨ嚜pcmdTarget鐨? IOlcCommandTarget鎺ュ彛鑾峰緱“緙栫爜”鑿滃崟浠ュ強HKEY_CURRENT_USER\Software\Microsoft\ Internet Explorer\MenuExt涓嬬殑瀹氫箟鎵╁睍鑿滃崟錛岀劧鍚庝互TPM_RETURNCMD鏍囧織璋冪敤TrackPopupMenu鎴? TrackPopupMenuEx寮瑰嚭鑿滃崟錛屽茍灝嗚繑鍥炵殑鑿滃崟鍛戒護ID鏁欑粰嫻忚鍣ㄧ獥鍙h繘琛屽鐞嗐傝繖縐嶆柟娉曞彲浠ヨ皟鐢ㄨ澶氶氳繃嫻忚鍣ㄦ棤娉曠洿鎺ヨ皟鐢ㄧ殑鍛戒護鍜屽璇濇 錛堝弬闃咃細銆?a >Internet Explorer 緙栫▼綆榪幫紙浜旓級璋冪敤IE闅愯棌鐨勫懡浠?/font>銆嬶級銆?/font>

鎵浠ワ紝鎴戜滑鍙渶瑕佸湪寮瑰嚭鑿滃崟涔嬪墠鍋氫竴浜涜嚜瀹氫箟鎿嶄綔鍗沖彲杈懼埌淇敼榛樿鑿滃崟鐨勭洰鐨勶紝濡備笂闈唬鐮佷腑灝辯敤鍒犻櫎浜?#8220;鏌ョ湅婧愭枃浠?#8221;鑿滃崟欏廣?/font>

2) 闂
濡傛灉鎴戜滑涓嶄粎浠呮槸鍒犻櫎榛樿鐨勮彍鍗曢」鎴栨槸淇敼浜嗛粯璁ょ殑鑿滃崟欏癸紝榪樻坊鍔犱簡鑷繁鐨勮彍鍗曢」錛屼細鍑虹幇浠涔堟儏鍐靛憿錛熺敱浜庝嬌鐢ㄤ簡綾諱技浜嶮FC涓璘pdateUI鐨勬満鍒訛紝閬囧埌涓嶈璇嗙殑CommandID錛屾祻瑙堝櫒灝變細灝嗗叾鐘舵佽緗負Disabled錛屾墍浠ユ垜浠嚜宸辨坊鍔犵殑鑿滃崟鏄棤娉曡閫夋嫨鐨勩?br>鍙? 浠ユ兂鍒幫紝濡傛灉鎶婅彍鍗曠姸鎬佽緗負Enabled錛屽茍閫氳繃TPM_RETURNCMD鏍囧織璋冪敤TrackPopupMenu鎴? TrackPopupMenuEx錛屽啀鎶婅繑鍥炵殑鍛戒護ID鏁欑粰鍚堥傜殑紿楀彛錛堝涓繪鏋剁獥鍙o級鍘誨鐞嗕笉灝辮浜嗐傚叧閿偣灝卞湪浜庡浣曟妸鑿滃崟鐘舵佽緗負 Enabled銆?/font>

3) 瀹炵幇
瑙e喅鐨勫姙娉曟槸鎴幏 WM_INITMENUPOPUP 娑堟伅錛屽湪鑿滃崟鍒涘緩浠ュ悗錛屽皻鏈樉紺轟箣鍓嶄慨鏀硅彍鍗曢」鐘舵侊紝閭f祻瑙堝櫒灝辨病鏈夊姙娉曚簡銆傛埅鑾稺M_INITMENUPOPUP娑堟伅鍒欏彲浣跨敤瀛愮被鍖栵紙subclass錛夌殑鎶鏈紝鍓嶉潰閫氳繃IOleWindow鎺ュ彛鎴戜滑寰楀埌浜嗘祻瑙堝櫒紿楀彛鐨勫彞鏌刪wnd錛屽垯鍙互榪欐牱鍋氾細

HMENU g_hPubMenu = NULL;
WNDPROC g_lpPrevWndProc = NULL;

LRESULT CALLBACK CustomMenuWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
銆if (uMsg == WM_INITMENUPOPUP)
銆{
銆銆if (wParam == (WPARAM) g_hPubMenu)
銆銆{
銆銆銆::EnableMenuItem( 鑷畾涔夌殑鑿滃崟鍛戒護ID, MF_ENABLED | MF_BYCOMMAND );
銆銆銆::CheckMenuItem( 鑷畾涔夌殑鑿滃崟鍛戒護ID, MF_BYCOMMAND);
銆銆銆return 0;
銆銆}
銆}
銆return CallWindowProc(g_lpPrevWndProc, hwnd, uMsg, wParam, lParam);
}

HRESULT CMyHtmlView::OnShowContextMenu(DWORD dwID, LPPOINT ppt,
LPUNKNOWN pcmdtReserved, LPDISPATCH pdispReserved)
{
//嫻忚鍣ㄨ彍鍗曞彞鏌勪繚瀛樺湪g_hPubMenu涓?br>......
// subclass嫻忚鍣ㄧ獥鍙?br>g_lpPrevWndProc = (WNDPROC)::SetWindowLong(hwnd, GWL_WNDPROC, (LONG)CustomMenuWndProc);
//m_SubclassWnd.SubclassWindow( hwnd );//MFC涓敤姝ゆ柟娉曟洿綆渚?/font>

// Show shortcut menu
int iSelection = ::TrackPopupMenu(hSubMenu,
銆TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD,
銆ppt->x,
銆ppt->y,
銆0,
銆hwnd,
銆(RECT*)NULL);
// Unsubclass嫻忚鍣ㄧ獥鍙?br>::SetWindowLong(hwnd, GWL_WNDPROC, (LONG)g_lpPrevWndProc);
g_lpPrevWndProc = NULL;
//m_SubclassWnd.UnsubclassWindow();

if (iSelection == 鑷畾涔夌殑鑿滃崟鍛戒護ID )
{
銆::SendMessage( ::AfxGetMainWnd()->m_hWnd, WM_COMMAND, MAKEWPARAM(LOWORD(lResult), 0x0), 0 );
}
else
{
銆LRESULT lr = ::SendMessage(hwnd, WM_COMMAND, iSelection, NULL);
}
......
}

鍦∕FC 涓垯鏇翠負鏂逛究錛屼粠CWnd緇ф壙涓涓獥鍙g被錛屽亣璁句負CWebBrowserSubclassWnd錛屼負CMyHtmlView娣誨姞涓涓? CWebBrowserSubclassWnd綾誨瀷鐨勬垚鍛樺彉閲弇_SubclassWnd錛屽湪瀛愮被鍖栧拰鍘婚櫎瀛愮被鍖栨椂璋冪敤 m_SubclassWnd.SubclassWindow( hwnd )鍜宮_SubclassWnd.UnsubclassWindow()鍗沖彲銆傜浉搴旂殑WM_INITMENUPOPUP娑堟伅澶勭悊鍑芥暟濡備笅鎵紺猴細

void CWebBrowserSubclassWnd::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu)
{
銆CWnd::OnInitMenuPopup(pPopupMenu, nIndex, bSysMenu);

銆pPopupMenu->EnableMenuItem( 鑷畾涔夌殑鑿滃崟鍛戒護ID, MF_ENABLED | MF_BYCOMMAND );
銆pPopupMenu->CheckMenuItem( 鑷畾涔夌殑鑿滃崟鍛戒護ID, MF_BYCOMMAND);
}

涓嬮潰鐨勫浘鐗囨樉紺轟簡灝?#8220;鏂囧瓧澶у皬”鑿滃崟欏規坊鍔犲埌“緙栫爜”鑿滃崟欏圭殑涓嬮潰鐨勬晥鏋溿?/font>

5銆佹柊鐨勯棶棰?br> 鐪嬪畬涓婇潰鐨勪唬鐮侊紝鎴戜滑鍙堣嚜鐒跺湴鎯沖埌嫻忚鍣ㄧ紪紼嬩腑鐨勫彟涓涓棶棰橈紝閭e氨鏄?#8220;緙栫爜”鑿滃崟銆傛垜浠寚瀹氾紝鎵嬪姩寤虹珛涓涓?#8220;緙栫爜”鑿滃崟鏄瘮杈冮夯鐑︾殑浜嬶紝鑰屼笖寰堥毦鍋氬埌涓庢祻瑙堝櫒涓婁笅鏂囪彍鍗曚笂鐨?#8220;緙栫爜”鑿滃崟涓鏍風殑鏁堟灉銆備綍涓嶄嬌鐢ㄤ笂榪扮殑鏂規硶璁╂祻瑙堝櫒鑷繁寤虹珛“緙栫爜”鑿滃崟鍜屽鐞嗙浉搴旂殑鍛戒護鍛紵

鍏蜂綋瀹炵幇璇風湅涓嬩竴綃囨枃绔犮奍nternet Explorer 緙栫▼綆榪幫紙涓冿級瀹岀編鐨?#8220;緙栫爜”鑿滃崟銆?/font>


鍙傝冭祫鏂?/strong> 錛?br>MSDN:Adding Entries to the Standard Context Menu
MSDN:How To Adding to the Standard Context Menus of the WebBrowser Control
MSDN:IDocHostUIHandler::ShowContextMenu Method
BeginThread.com:Custom WebBrowser Context Menus




]]>
Internet Explorer緙栫▼綆榪?浜?http://m.shnenglu.com/mydriverc/articles/28959.html鏃呴?/dc:creator>鏃呴?/author>Sun, 29 Jul 2007 07:14:00 GMThttp://m.shnenglu.com/mydriverc/articles/28959.htmlhttp://m.shnenglu.com/mydriverc/comments/28959.htmlhttp://m.shnenglu.com/mydriverc/articles/28959.html#Feedback0http://m.shnenglu.com/mydriverc/comments/commentRss/28959.htmlhttp://m.shnenglu.com/mydriverc/services/trackbacks/28959.html
銆銆闄や簡“鏁寸悊鏀惰棌澶?#8221;鍜?#8220;娣誨姞鍒版敹钘忓す”瀵硅瘽妗嗗錛岃繕鏈夊叾瀹冧竴浜涘璇濇鏄垜浠笇鏈涚洿鎺ラ氳繃WebBrowser璋冪敤鐨勶紝 姣斿“瀵煎叆/瀵煎嚭”瀵硅瘽妗嗭紝鐢ㄤ竴鑸殑鏂規硶寰堥毦璋冪敤銆侷ShellUIHelper灝界鎻愪緵浜咺mportExportFavorites鏂規硶錛屼絾緇撴灉鍙槸 鏄劇ず涓涓夋嫨鏂囦歡鐨勫璇濇錛屼笖鍙兘瀵煎叆/瀵煎嚭鏀惰棌澶硅屼笉鑳藉Cookies鎿嶄綔銆?br>

銆銆2銆佸鏈?br>
銆銆MSDN涓湁涓綃囧彨“WebBrowser Customization”鐨勬枃绔狅紝鍏朵腑浠嬬粛浜嗛氳繃IDocHostUIHandler.ShowContextMenu鏂規硶鑷畾涔塛ebBrowser涓婁笅鏂囪彍鍗曠殑鏂規硶銆?br>
鍏? 鍘熺悊鏄粠“shdoclc.dll”鐨勮祫婧愪腑鍒涘緩鑿滃崟錛屼綔涓浜涗慨鏀逛箣鍚庣敤TrackPopupMenu鍑芥暟錛堟敞鎰忓湪鏍囧織涓寘鍚? TPM_RETURNCMD錛夊皢鑿滃崟寮瑰嚭錛岀劧鍚庢妸榪斿洖鐨凜ommand ID鍙戦佺粰“Internet Explorer_Server”紿楀彛榪涜澶勭悊銆?/p>


銆銆......
銆銆// 鏄劇ず鑿滃崟
銆銆int iSelection = ::TrackPopupMenu(hMenu,
銆銆TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD,
銆銆ppt->x,
銆銆ppt->y,
銆銆0,
銆銆hwnd,
銆銆(RECT*)NULL);
銆銆// 鍙戦丆ommand ID鍒板澹崇獥鍙?br>銆銆LRESULT lr = ::SendMessage(hwnd, WM_COMMAND, iSelection, NULL);
銆銆......

銆銆濂斤紝濡傛灉鎵懼埌鎵鏈変笂涓嬫枃鑿滃崟鐨凜ommand ID錛屼笉灝卞彲浠ラ殢鏃惰皟鐢ㄤ簡錛熺‘瀹炴槸榪欐牱鐨勩?br>
銆銆3銆佸疄鐜?br>銆銆鐢╡XeScope涔嬬被搴旂敤紼嬪簭璧勬簮鎺㈢儲鍣ㄦ墦寮“shdoclc.dll”渚垮彲浠ュ湪鑿滃崟璧勬簮涓嬫壘鍒頒笂涓嬫枃鑿滃崟鐨勮璁★紝濡備笅鍥撅細

銆銆鎴戜滑瑕佸仛鐨勶紝灝辨槸灝嗚繖浜汭D鍙戦佸埌“Internet Explorer_Server”紿楀彛榪涜澶勭悊銆傞棶棰樻槸WebBrowser鍏跺疄鏄竴涓狾LE瀹瑰櫒錛屾垜浠嬌鐢ㄧ殑CHtmlView鍙堟槸鏇村灞傜殑灝佽錛屼粬浠? 鐨刴_hWnd鎴愬憳鍙橀噺騫朵笉鏄疘E紿楀彛鐨勫彞鏌勶紝濡備綍鎵懼埌鎴戜滑闇瑕佺殑鍙ユ焺鍛紵璇風湅涓嬮潰鐨勫浘錛?/p>


銆銆鏍規嵁鍥句腑鏄劇ず鐨勪粠灞炲叧緋伙紝欏鴻棨鎽哥摐錛屾渶鍐呭眰鐨勭獥鍙?#8220;Internet Explorer_Server”鐨勫彞鏌勫氨鏄垜浠渶瑕佺殑涓滆タ銆備負浜嗙畝鍖栭棶棰橈紝鎴戣繖閲屼嬌鐢ㄤ簡鏉ヨ嚜MSDN Magazine璧勬繁涓撴爮鎾扮ǹ浜篜aul Dilascia鐨凜FindWnd綾伙紝闈炲父濂界敤銆?/p>


銆銆////////////////////////////////////////////////////////////////
銆銆// MSDN Magazine -- August 2003
銆銆// If this code works, it was written by Paul DiLascia.
銆銆// If not, I don't know who wrote it.
銆銆// Compiles with Visual Studio .NET on Windows XP. Tab size=3.
銆銆//
銆銆// ---
銆銆// This class encapsulates the process of finding a window with a given class name
銆銆// as a descendant of a given window. To use it, instantiate like so:
銆銆//
銆銆// CFindWnd fw(hwndParent,classname);
銆銆//
銆銆// fw.m_hWnd will be the HWND of the desired window, if found.
銆銆//
銆銆class CFindWnd {
銆銆private:
銆銆//////////////////
銆銆// This private function is used with EnumChildWindows to find the child
銆銆// with a given class name. Returns FALSE if found (to stop enumerating).
銆銆//
銆銆static BOOL CALLBACK FindChildClassHwnd(HWND hwndParent, LPARAM lParam) {
銆銆CFindWnd *pfw = (CFindWnd*)lParam;
銆銆HWND hwnd = FindWindowEx(hwndParent, NULL, pfw->m_classname, NULL);
銆銆if (hwnd) {
銆銆pfw->m_hWnd = hwnd; // found: save it
銆銆return FALSE; // stop enumerating
銆銆}
銆銆EnumChildWindows(hwndParent, FindChildClassHwnd, lParam); // recurse
銆銆return TRUE; // keep looking
銆銆}
銆銆public:
銆銆LPCSTR m_classname; // class name to look for
銆銆HWND m_hWnd; // HWND if found
銆銆// ctor does the work--just instantiate and go
銆銆CFindWnd(HWND hwndParent, LPCSTR classname)
銆銆: m_hWnd(NULL), m_classname(classname)
銆銆{
銆銆FindChildClassHwnd(hwndParent, (LPARAM)this);
銆銆}
銆銆};

 

銆銆鍐嶅啓涓涓嚱鏁癐nvokeIEServerCommand錛岃皟鐢ㄥ氨寰堟柟渚夸簡錛屻奍nternet Explorer 緙栫▼綆榪幫紙鍥涳級“娣誨姞鍒版敹钘忓す”瀵硅瘽妗嗐嬩腑鏈鍚庣粰鍑虹殑鏂規硶灝辨槸浠庤繖閲屾潵鐨勩?/p>


銆銆void CMyHtmlView::InvokeIEServerCommand(int nID)
銆銆{
銆銆CFindWnd FindIEWnd( m_wndBrowser.m_hWnd, "Internet Explorer_Server");
銆銆::SendMessage( FindIEWnd.m_hWnd, WM_COMMAND, MAKEWPARAM(LOWORD(nID), 0x0), 0 );
銆銆}
void CMyHtmlView::OnFavAddtofav()
銆銆{
銆銆InvokeIEServerCommand(ID_IE_CONTEXTMENU_ADDFAV);//璋冪敤“娣誨姞鍒版敹钘忓す”瀵硅瘽妗?br>銆銆}



銆銆4銆丆ommand IDs
銆銆瀵規墍鏈夌殑Command ID閫愪竴灝濊瘯鍚庢垜浠彂鐜幫細
銆銆1)涓嶆槸鎵鏈夌殑Command ID閮藉彲浠ョ敤涓婇潰鐨勬柟娉曡皟鐢紱
銆銆2)涓嶆槸鎵鏈夌殑Command ID閮芥槸鐢?#8220;Internet Explorer_Server”紿楀彛澶勭悊錛?br>銆銆3)鏈変竴浜汣ommand ID鏄敱涓婁竴綰х獥鍙?#8220;Shell DocObject View”澶勭悊銆?br>銆銆鎵浠ユ垜浠繕闇瑕佸啓涓涓嚱鏁般?/p>


銆銆void CMyHtmlView::InvokeShellDocObjCommand(int nID)
銆銆{
銆銆CFindWnd FindIEWnd( m_wndBrowser.m_hWnd, "Shell DocObject View");
銆銆::SendMessage( FindIEWnd.m_hWnd, WM_COMMAND, MAKEWPARAM(LOWORD(nID), 0x0), 0 );
銆銆}

 

銆銆璋冪敤鏂囩珷寮澶存彁鍒扮殑“瀵煎叆/瀵煎嚭”瀵硅瘽妗嗗彲浠ヨ繖鏍鋒潵鍋氾細


銆銆void CDemoView::OnImportExport()
銆銆{
銆銆InvokeShellDocObjCommand(ID_IE_FILE_IMPORTEXPORT);//璋冪敤“瀵煎叆/瀵煎嚭”瀵硅瘽妗?br>銆銆}

銆銆鐢?Internet Explorer_Server"紿楀彛澶勭悊鐨凜ommand ID:
銆銆#define ID_IE_CONTEXTMENU_ADDFAV 2261
銆銆#define ID_IE_CONTEXTMENU_VIEWSOURCE 2139
銆銆#define ID_IE_CONTEXTMENU_REFRESH 6042

銆銆鐢?Shell DocObject View"紿楀彛澶勭悊鐨凜ommand ID:
銆銆#define ID_IE_FILE_SAVEAS 258
銆銆#define ID_IE_FILE_PAGESETUP 259
銆銆#define ID_IE_FILE_PRINT 260
銆銆#define ID_IE_FILE_NEWWINDOW 275
銆銆#define ID_IE_FILE_PRINTPREVIEW 277
銆銆#define ID_IE_FILE_NEWMAIL 279
銆銆#define ID_IE_FILE_SENDDESKTOPSHORTCUT 284
銆銆#define ID_IE_HELP_ABOUTIE 336
銆銆#define ID_IE_HELP_HELPINDEX 337
銆銆#define ID_IE_HELP_WEBTUTORIAL 338
銆銆#define ID_IE_HELP_FREESTUFF 341
銆銆#define ID_IE_HELP_PRODUCTUPDATE 342
銆銆#define ID_IE_HELP_FAQ 343
銆銆#define ID_IE_HELP_ONLINESUPPORT 344
銆銆#define ID_IE_HELP_FEEDBACK 345
銆銆#define ID_IE_HELP_BESTPAGE 346
銆銆#define ID_IE_HELP_SEARCHWEB 347
銆銆#define ID_IE_HELP_MSHOME 348
銆銆#define ID_IE_HELP_VISITINTERNET 349
銆銆#define ID_IE_HELP_STARTPAGE 350
銆銆#define ID_IE_FILE_IMPORTEXPORT 374
銆銆#define ID_IE_FILE_ADDTRUST 376
銆銆#define ID_IE_FILE_ADDLOCAL 377
銆銆#define ID_IE_FILE_NEWPUBLISHINFO 387
銆銆#define ID_IE_FILE_NEWCORRESPONDENT 390
銆銆#define ID_IE_FILE_NEWCALL 395
銆銆#define ID_IE_HELP_NETSCAPEUSER 351
銆銆#define ID_IE_HELP_ENHANCEDSECURITY 375

銆銆5銆丷efresh

銆銆鐔熸倝TEmbeddedWB鐨勮鑰呭彲鑳芥敞鎰忓埌浜咺D_IE_CONTEXTMENU_REFRESH(6042)榪欎釜ID錛屽湪TEmbeddedWB涓粰鍑轟簡涓涓綋緗戦〉鍒鋒柊鏃惰Е鍙戠殑OnRefresh浜嬩歡錛屽叾涓殑鍏抽敭浠g爜濡備笅錛?/p>


銆銆......
銆銆if Assigned(FOnRefresh) and ((nCmdID = 6041 { F5}) or (nCmdID = 6042 { ContextMenu}) or (nCmdID = 2300)) then
銆銆begin
銆銆FCancel := False;
銆銆FOnRefresh(self, nCmdID, FCancel);
銆銆if FCancel then Result := S_OK;
銆銆end;
銆銆......


鍏朵腑鐨?402灝辨槸鎴戜滑榪欓噷鐨処D_IE_CONTEXTMENU_REFRESH錛?300鏄唴緗殑鍒鋒柊鍛戒護錛岄偅6041鍛€傝涓嬪浘錛岃繕鏄? “shdoclc.dll”錛?041鍘熸潵鏄疘E“鏌ョ湅”鑿滃崟涓?#8220;鍒鋒柊”鑿滃崟鐨勫懡浠D銆傚疄闄呭紑鍙戜腑鎴戜滑鍙戠幇鐩存帴璋冪敤WebBrowser鐨? Refresh鍛戒護鏈夋椂鍊欎細瀵艱嚧涓浜涢敊璇紝鍙互鐢ㄨ繖閲岀殑鏂規硶鏇挎崲涓涓嬨?br>



銆銆6銆侀渶瑕佹敞鎰忕殑闂

銆銆1)鐢↖nvokeIEServerCommand (ID_IE_CONTEXTMENU_ADDFAV)璋冪敤“娣誨姞鍒版敹钘忓す”瀵硅瘽妗嗘椂闇瑕佹敞鎰忕殑鏄紝IE鎺ユ敹鍒? ID_IE_CONTEXTMENU_ADDFAV鍛戒護鏃舵槸瀵圭綉欏典腑褰撳墠琚変腑鐨勯摼鎺ユ潵鎵ц“娣誨姞鍒版敹钘忓す”鎿嶄綔鐨勶紝濡傛灉娌℃湁閫変腑鐨勯摼鎺ワ紝鎵嶆槸灝嗗綋鍓嶇綉欏? 娣誨姞鍒版敹钘忓す銆?br>
銆銆2)鏂板緩IE紿楀彛銆傝繖鏄祻瑙堝櫒緙栫▼涓殑闅鵑涔嬩竴錛屽嵆浠庡綋鍓嶇獥鍙f柊寤轟竴涓狪nternet Explorer紿楀彛錛屽畬鍏ㄥ鍒跺綋鍓嶉〉鐨勫唴瀹癸紙鍖呮嫭“鍓嶈繘”銆?#8220;鍚庨”鐨勭姸鎬侊級錛岃繖鍙互閫氳繃InvokeShellDocObjCommand (ID_IE_FILE_NEWWINDOW)鏉ュ疄鐜般?br>
銆銆3)鏄劇ずIE鐨勭増鏈俊鎭傝皟鐢↖nvokeShellDocObjCommand(ID_IE_HELP_ABOUTIE)錛屽涓嬶細

銆銆4)InvokeShellDocObjCommand(ID_IE_FILE_PRINT)璋冨嚭鐨?#8220;鎵撳嵃”瀵硅瘽妗嗘槸闈炴ā鎬佺殑錛堟垜浠笉澶竻妤? Microsoft鐨勮璁℃剰鍥撅紝鎴戣涓?#8220;鎵撳嵃”瀵硅瘽妗嗗簲璇ユ槸妯℃佺殑錛夛紝鏄劇ず妯℃佺獥鍙g殑鏂規硶璇峰弬鑰冩垜鐨勫彟涓綃囨枃绔犮婂埄鐢╓H_CBT Hook灝嗛潪妯℃佸璇濇鏄劇ず涓烘ā鎬佸璇濇銆?/p>


]]>
Internet Explorer緙栫▼綆榪?鍥?http://m.shnenglu.com/mydriverc/articles/28958.html鏃呴?/dc:creator>鏃呴?/author>Sun, 29 Jul 2007 07:12:00 GMThttp://m.shnenglu.com/mydriverc/articles/28958.htmlhttp://m.shnenglu.com/mydriverc/comments/28958.htmlhttp://m.shnenglu.com/mydriverc/articles/28958.html#Feedback0http://m.shnenglu.com/mydriverc/comments/commentRss/28958.htmlhttp://m.shnenglu.com/mydriverc/services/trackbacks/28958.html銆銆璋冪敤“娣誨姞鍒版敹钘忓す”瀵硅瘽妗嗭紙濡備笅錛変笌璋冪敤“鏁寸悊鏀惰棌澶?#8221;瀵硅瘽妗嗘湁涓嶅悓涔嬪錛屽墠鑰呮墍鍋氱殑宸ヤ綔姣斿悗鑰呰鏉ュ緱澶嶆潅銆傚皢閾炬帴娣誨姞鍒版敹钘忓す闄や簡灝嗛摼鎺ヤ繚瀛樹箣澶栵紝榪樺彲鑳戒細鏈夎劚鏈鴻闂殑璁劇疆錛屼粠IE 4.0鍒癐E 5.0錛屽鐞嗙殑鏂瑰紡涔熷彂鐢熶簡涓浜涘彉鍖栥?br>




銆銆2銆両ShellUIHelper鎺ュ彛

銆銆寰蔣涓撻棬鎻愪緵浜嗕竴涓帴鍙ShellUIHelper鏉ュ疄鐜板Windows Shell API涓浜涘姛鑳界殑璁塊棶錛屽皢閾炬帴娣誨姞鍒版敹钘忓す涔熸槸鍏朵腑涔嬩竴錛屽氨鏄笅闈㈢殑AddFavorite鍑芥暟銆?/p>


銆銆HRESULT IShellUIHelper::AddFavorite(BSTR URL, VARIANT *Title);

銆銆瀹炰緥浠g爜濡備笅錛?/p>


銆銆void CMyHtmlView::OnAddToFavorites()
銆銆{
銆銆IShellUIHelper* pShellUIHelper;
銆銆HRESULT hr = CoCreateInstance(CLSID_ShellUIHelper, NULL,
銆銆CLSCTX_INPROC_SERVER, IID_IShellUIHelper,(LPVOID*)&pShellUIHelper);

銆銆if (SUCCEEDED(hr))
銆銆{
銆銆_variant_t vtTitle(GetTitle().AllocSysString());
銆銆CString strURL = m_webBrowser.GetLocationURL();

銆銆pShellUIHelper->AddFavorite(strURL.AllocSysString(), &vtTitle);
銆銆pShellUIHelper->Release();
銆銆}
銆銆}

銆銆鎴戜滑娉ㄦ剰鍒拌繖閲岀殑“AddFavorite”鍑芥暟騫舵病鏈夊儚“DoOrganizeFavDlg”閭f牱闇瑕佷竴涓埗紿楀彛鍙ユ焺銆傝繖涔熷鑷翠笌鍦↖E涓墦 寮涓嶅悓錛岄氳繃IShellUIHelper鎺ュ彛鏄劇ず鍑烘潵鐨?#8220;娣誨姞鍒版敹钘忓す”瀵硅瘽妗嗘槸“闈炴ā鎬?#8221;鐨勶紝鏈変竴涓嫭绔嬩簬鎴戜滑搴旂敤紼嬪簭鐨勪換鍔℃爮鎸夐挳錛岃繖浣挎垜浠殑嫻忚 鍣ㄦ樉寰楅潪甯鎬笉涓撲笟錛堟垜鏄釜榪芥眰瀹岀編鐨勪漢錛岃繖涔熸槸鎴戠殑嫻忚鍣ㄨ繜榪熶笉鑳藉彂甯冪殑鍘熷洜涔嬩竴錛夈?br>
銆銆浜庢槸鎴戜滑寰堣嚜鐒跺湴鎯沖埌“shdocvw.dll”涓櫎浜?#8220;DoOrganizeFavDlg”澶栵紝搴旇榪樻湁涓涓被浼肩殑鍑芥暟錛屽彲浠ヤ紶鍏ヤ竴涓埗紿楀彛鍙ユ焺鐢ㄤ互鏄劇ず妯℃佺獥鍙o紝涔熻灝卞儚榪欐牱錛?/p>


銆銆typedef UINT (CALLBACK* LPFNADDFAV)(HWND, LPTSTR, LPTSTR);

銆銆浜嬪疄涓婏紝榪欐牱鐨勫嚱鏁扮‘瀹炲瓨鍦ㄤ簬“shdocvw.dll”涓紝閭e氨鏄?#8220;DoAddToFavDlg”銆?/p>


銆銆3銆丏oAddToFavDlg鍑芥暟

銆銆“DoAddToFavDlg”鍑芥暟涔熸槸“shdocvw.dll”鏆撮湶鍑烘潵鐨勫嚱鏁頒箣涓錛屽叾鍘熷瀷濡備笅錛?/p>


銆銆typedef BOOL (CALLBACK* LPFNADDFAV)(HWND, TCHAR*, UINT, TCHAR*, UINT,LPITEMIDLIST);

銆銆絎竴涓弬鏁版鏄垜浠兂瑕佺殑鐖剁獥鍙e彞鏌勶紝絎簩鍜岀鍥涗釜鍙傛暟鍒嗗埆鏄垵濮嬬洰褰曪紙涓鑸潵璇村氨鏄敹钘忓す鐩綍錛夊拰瑕佹坊鍔犵殑閾炬帴鐨勫悕瀛楋紙姣斿緗戦〉鐨? Title錛夛紝絎笁鍜岀浜斾釜鍙傛暟鍒嗗埆鏄浜屽拰絎洓涓や釜緙撳啿鍖虹殑闀垮害錛岃屾渶鍚庝竴涓弬鏁板垯鏄寚鍚戜笌絎簩涓弬鏁扮洰褰曠浉鍏崇殑item identifier list鐨勬寚閽?PIDL)銆備絾鏈濂囨殑鏄繖閲屽茍娌℃湁鍍?#8220;AddFavorite”鍑芥暟涓鏍風殑閾炬帴URL錛岄偅閾炬帴鏄庢牱娣誨姞鐨勫憿錛熺瓟妗堟槸“鎵嬪姩鍒涘緩”銆?br>
絎簩涓弬鏁板湪鍑芥暟璋冪敤榪斿洖鍚庝細鍖呭惈鐢ㄦ埛鍦?#8220;娣誨姞鍒版敹钘忓す”瀵硅瘽妗嗕腑閫夋嫨鎴栧垱寤虹殑瀹屾暣閾炬帴璺緞鍚嶏紙濡?#8220;X:\XXX\mylink.url”錛夛紝鎴戜滑灝辨牴 鎹繖涓礬寰勫拰緗戦〉鐨刄RL鏉ュ垱寤洪摼鎺ワ紝浠g爜濡備笅錛堜負綆鍖栵紝姝ゅ鐪佸幓媯鏌?shdocvw.dll"鏄惁宸插湪鍐呭瓨涓殑浠g爜錛屽弬瑙併奍nternet Explorer 緙栫▼綆榪幫紙涓夛級“鏁寸悊鏀惰棌澶?#8221;瀵硅瘽妗嗐嬶級錛?/p>


銆銆void CMyHtmlView::OnFavAddtofav()
銆銆{
銆銆typedef BOOL (CALLBACK* LPFNADDFAV)(HWND, TCHAR*, UINT, TCHAR*, UINT,LPITEMIDLIST);

銆銆HMODULE hMod = (HMODULE)LoadLibrary("shdocvw.dll");
銆銆if (hMod)
銆銆{
銆銆LPFNADDFAV lpfnDoAddToFavDlg = (LPFNADDFAV)GetProcAddress( hMod, "DoAddToFavDlg");
銆銆if (lpfnDoAddToFavDlg)
銆銆{
銆銆TCHAR szPath[MAX_PATH];
銆銆LPITEMIDLIST pidlFavorites;

銆銆if (SHGetSpecialFolderPath(NULL, szPath, CSIDL_FAVORITES, TRUE) &&
銆銆(SUCCEEDED(SHGetSpecialFolderLocation(NULL, CSIDL_FAVORITES, &pidlFavorites))))
銆銆{
銆銆TCHAR szTitle[MAX_PATH];
銆銆strcpy(szTitle, GetLocationName());

銆銆TCHAR szURL[MAX_PATH];
銆銆strcpy(szURL, GetLocationURL());

銆銆BOOL bOK = lpfnDoAddToFavDlg(m_hWnd, szPath,
銆銆sizeof(szPath)/sizeof(szPath[0]), szTitle,
銆銆sizeof(szTitle)/sizeof(szTitle[0]), pidlFavorites);
銆銆CoTaskMemFree(pidlFavorites);

銆銆if (bOK)
銆銆CreateInternetShortcut( szURL, szPath, "");  //鍒涘緩Internet蹇嵎鏂瑰紡
銆銆}
銆銆}
銆銆FreeLibrary(hMod);
銆銆}
銆銆return;
銆銆}

銆銆瀹炵幇CreateInternetShortcut鍑芥暟鍒涘緩Internet蹇嵎鏂瑰紡錛屽彲浠ョ敤璇誨啓INI鏂囦歡鐨勬柟娉曪紝浣嗘洿濂界殑鍒欐槸鍒╃敤IUniformResourceLocator鎺ュ彛銆?/p>


銆銆HRESULT CMyHtmlView::CreateInternetShortcut(LPCSTR pszURL, LPCSTR pszURLfilename,
銆銆LPCSTR szDescription,LPCTSTR szIconFile,int nIndex)
銆銆{
銆銆HRESULT hres;

銆銆CoInitialize(NULL);

銆銆IUniformResourceLocator *pHook;

銆銆hres = CoCreateInstance (CLSID_InternetShortcut, NULL, CLSCTX_INPROC_SERVER,
銆銆IID_IUniformResourceLocator, (void **)&pHook);

銆銆if (SUCCEEDED (hres))
銆銆{
銆銆IPersistFile *ppf;
銆銆IShellLink *psl;

銆銆// Query IShellLink for the IPersistFile interface for
銆銆hres = pHook->QueryInterface (IID_IPersistFile, (void **)&ppf);
銆銆hres = pHook->QueryInterface (IID_IShellLink, (void **)&psl);

銆銆if (SUCCEEDED (hres))
銆銆{
銆銆WORD wsz [MAX_PATH]; // buffer for Unicode string

銆銆// Set the path to the shortcut target.
銆銆pHook->SetURL(pszURL,0);

銆銆hres = psl->SetIconLocation(szIconFile,nIndex);

銆銆if (SUCCEEDED (hres))
銆銆{
銆銆// Set the description of the shortcut.
銆銆hres = psl->SetDescription (szDescription);

銆銆if (SUCCEEDED (hres))
銆銆{
銆銆// Ensure that the string consists of ANSI characters.
銆銆MultiByteToWideChar (CP_ACP, 0, pszURLfilename, -1, wsz, MAX_PATH);

銆銆// Save the shortcut via the IPersistFile::Save member function.
銆銆hres = ppf->Save (wsz, TRUE);
銆銆}
銆銆}

銆銆// Release the pointer to IPersistFile.
銆銆ppf->Release ();
銆銆psl->Release ();
銆銆}

銆銆// Release the pointer to IShellLink.
銆銆pHook->Release ();

銆銆}
銆銆return hres;
銆銆}

銆銆濂斤紝涓婇潰鐨勬柟娉曡櫧鐒墮夯鐑︿竴鐐癸紝浣嗘葷畻瑙e喅浜?#8220;妯℃佺獥鍙?#8221;鐨勯棶棰橈紝浣垮緱鎴戜滑鐨勭▼搴忎笉鑷充簬璁╃敤鎴烽剻瑙嗐備絾鏄棶棰樺張鏉ヤ簡錛屾垜浠彂鐜?#8220;鍏佽鑴辨満浣跨敤”鏄疍isabled鐨勶紝閭?#8220;鑷畾涔?#8221;涔熷氨鏃犱粠璋堣搗浜嗭紝灝界90%鐨勪漢閮芥病鏈変嬌鐢ㄨ繃IE鎻愪緵鐨勮劚鏈烘祻瑙堛?br>

銆銆闅鵑亾鎴戜滑鐨勫笇鏈涜鐮寸伃鍚楋紵鎴戜滑涓鏂歸潰鎯沖儚璋冪敤“AddFavorite”鍑芥暟涓鏍風殑涓嶅繀鎵嬪姩鍒涘緩閾炬帴錛屼竴鏂歸潰鍙堣妯℃佹樉紺虹獥鍙o紝灝卞儚IE閭f牱錛岃繕鑳借嚜瀹氫箟鑴辨満嫻忚銆?/p>

銆銆3銆佽剼鏈柟寮?/p>

銆銆璁稿緗戦〉涓婇兘浼氭湁涓涓寜閽垨閾炬帴“娣誨姞鏈〉鍒版敹钘忓す”錛屽疄闄呬笂閫氳繃涓嬮潰鐨勮剼鏈樉紺烘ā鎬佺殑“娣誨姞鍒版敹钘忓す”瀵硅瘽妗嗗皢緗戦〉鍔犲叆鍒版敹钘忓す銆?/p>


銆銆window.external.AddFavorite(location.href, document.title);

銆銆榪欓噷鐨別xternal瀵硅薄鏄疻ebBrowser鍐呯疆鐨凜OM鑷姩鍖栧璞★紝浠ュ疄鐜板鏂囨。瀵硅薄妯″瀷錛圖OM錛夌殑鎵╁睍錛堟垜浠篃鍙互閫氳繃 IDocHostUIHandler瀹炵幇鑷繁鐨勬墿灞曪級.鏌ラ槄MSDN鍙互寰楃煡external瀵硅薄鐨勭殑鏂規硶涓嶪ShellUIHelper鎺ュ彛鎻愪緵鐨勬柟娉? 鏄竴鏍風殑銆傛垜浠湁鐞嗙敱鐩鎬俊錛孖ShellUIHelper鎻愪緵浜嗗WebBrowser鍐呯疆鐨別xternal瀵硅薄鐨勮闂紝濡傛灉鍦ㄩ傚綋鐨勫湴鏂瑰垱寤? IShellUIHelper鎺ュ彛鐨勫疄渚嬶紝涔熻璋冪敤“AddFavorite”鍑芥暟鏄劇ず鍑烘潵鐨勫氨鏄ā鎬佸璇濇浜嗐傞棶棰樻槸鎴戜滑榪樻病鏈夋壘鍒拌繖鏍風殑鍦版柟銆?/p>

銆銆浠庝笂闈㈢殑鑴氭湰錛屾垜浠緢鑷劧鍦板張鎯沖埌鍙︿竴涓柟娉曘傚鏋滆兘澶熻緗戦〉鏉ユ墽琛屼笂闈㈢殑鑴氭湰錛屽矀涓嶆槸闂灝辮В鍐充簡錛熻鍋氬氨鍋氾紝濡備笅錛?/p>


銆銆void CMyHtmlView::OnFavAddtofav()
銆銆{
銆銆CString strUrl = GetLocationURL();
銆銆CString strTitle = GetLocationName();
銆銆CString strjs = "javascript:window.external.AddFavorite('" + strUrl + "'," + "'" + strTitle + "');";
銆銆ExecScript(strjs);
銆銆}

銆銆void CMIEView::ExecScript(CString strjs)
銆銆{
銆銆CComQIPtr<IHTMLDocument2>   pHTMLDoc = (IHTMLDocument2*)GetHtmlDocument();
銆銆if ( pHTMLDoc != NULL  )
銆銆{
銆銆CComQIPtr<IHTMLWindow2>   pHTMLWnd;
銆銆pHTMLDoc->get_parentWindow( &pHTMLWnd );

銆銆if ( pHTMLWnd != NULL  )
銆銆{
銆銆CComBSTR bstrjs = strjs.AllocSysString();
銆銆CComBSTR bstrlan = SysAllocString(L"javascript");
銆銆VARIANT varRet;
銆銆pHTMLWnd->execScript(bstrjs, bstrlan, &varRet);
銆銆}
銆銆}
銆銆}

銆銆鍏堜粠CHtmlView鑾峰緱鏂囨。鐨勭埗紿楀彛window瀵硅薄鐨勬寚閽堬紝鍐嶈皟鐢ㄥ叾鏂規硶execScript鏉ユ墽琛岃剼鏈紙浜嬪疄涓婂彲浠ユ墽琛屼換鎰忕殑鑴氭湰錛夈? 璇曢獙鍙戠幇錛岃繖涓柟娉曢潪甯告湁鏁堬紝涓嶄粎紿楀彛鏄ā鎬佺殑錛岃屼笖涓嶉渶瑕佹墜鍔ㄥ垱寤洪摼鎺ワ紝鏇撮噸瑕佺殑鏄?#8220;鍏佽鑴辨満浣跨敤”鍜?#8220;鑷畾涔?#8221;鎸夐挳涔熷彲浠ョ敤浜嗐?/p>

銆銆4銆侀棶棰樹粛鏃ф病鏈夎В鍐?/p>

銆銆鎵ц鑴氭湰鐨勬柟寮忕湅璧鋒潵鏈夋晥錛屽彲涓鏃︽垜浠殑紼嬪簭瀹炵幇浜咺DocHostUIHandler鎺ュ彛瀵筗ebBrowser榪涜楂樼駭鎺у埗錛屽氨浼氬彂鐜頒竴鏃? 鎵ц鐨勮剼鏈寘鍚湁瀵?#8220;external”瀵硅薄鐨勮皟鐢紝灝變細鍑虹幇“鎵句笉鍒板璞?#8221;鐨勮剼鏈敊璇傚師鍥犳槸褰揗SHTML瑙f瀽寮曟搸錛堝茍闈濿ebBrowser錛夋鏌? 鍒板涓誨疄鐜頒簡IDocHostUIHandler鎺ュ彛錛屽氨浼氳皟鐢ㄥ叾GetExternal鏂規硶浠ヨ幏寰椾竴涓敤浠ユ墿灞旸OM鐨勮嚜鍔ㄥ寲鎺ュ彛鐨勫紩鐢ㄣ?/p>


銆銆HRESULT IDocHostUIHandler::GetExternal(IDispatch **ppDispatch錛?/p>

銆銆浣嗘湁鏃跺欐垜浠茍娌℃湁鎯寵鎵╁睍DOM錛屽悓鏃舵垜浠繕甯屾湜WebBrowser浣跨敤瀹冭嚜宸辯殑DOM鎵╁睍銆傜碂緋曠殑鏄疓etExternal鏂規硶鐨勬枃妗d腑 璇磋繖縐嶆儏鍐典笅蹇呴』鎶妏pDispatch璁劇疆涓篘ULL錛屾崲鍙ヨ瘽璇達紝WebBrowser榪炲畠鍐呯疆鐨別xternal瀵硅薄涔熶笉鐢ㄤ簡錛岄偅鎴戜滑鐨? window.external.AddFavorite灝卞彉寰楁棤澶勪負瀹朵簡銆?/p>

銆銆鎴戞浘澶氭柟灝濊瘯灝哤ebBrowser鍐呯疆鐨別xternal瀵硅薄鎵懼嚭鏉ワ紝铏界劧閮芥病鏈夋垚鍔燂紝浣嗘槸瑙e喅闂鐨勬柟娉曞嵈琚垜鎵懼埌浜嗐?/p>

銆銆5銆佸畬緹庣殑鏂規

銆銆WebBrowser鍐呯疆鐨別xternal瀵硅薄鎴戜滑铏界劧鎵句笉鍒幫紝浣嗗畠鑲畾瀛樺湪錛屾垜浠彧瑕佹兂鍔炴硶璁¦ebBrowser鑷繁瀹屾垚瀵瑰叾璋冪敤鍗沖彲銆? 瀹炵幇闈炲父綆鍗曪紝鎵懼埌WebBrowser涓寘鍚殑“Internet Explorer_Server”紿楀彛鐨勫彞鏌勶紝鍙戜竴涓秷鎭氨瀹屾垚浜嗐備笅闈㈢殑浠g爜涓亣璁緈_hWndIE灝辨槸“Internet Explorer_Server”紿楀彛鐨勫彞鏌勩?/p>


銆銆#define ID_IE_ID_ADDFAV 2261
銆銆::SendMessage( m_hWndIE, WM_COMMAND, MAKEWPARAM(LOWORD(ID_IE_ID_ADDFAV), 0x0), 0 );

銆銆璇曚竴璇曟垚鏋滐紝鏄笉鏄拰鍦↖nternet Explorer涓夋嫨“娣誨姞鍒版敹钘忓す”鐨勬晥鏋滀竴妯′竴鏍楓?/p>

銆銆鑷充簬涓轟粈涔堣繖鏍峰仛錛屽悗緇枃绔犲啀璇淬?/p>


]]>
Internet Explorer緙栫▼綆榪?涓?http://m.shnenglu.com/mydriverc/articles/28956.html鏃呴?/dc:creator>鏃呴?/author>Sun, 29 Jul 2007 07:10:00 GMThttp://m.shnenglu.com/mydriverc/articles/28956.htmlhttp://m.shnenglu.com/mydriverc/comments/28956.htmlhttp://m.shnenglu.com/mydriverc/articles/28956.html#Feedback0http://m.shnenglu.com/mydriverc/comments/commentRss/28956.htmlhttp://m.shnenglu.com/mydriverc/services/trackbacks/28956.html銆銆鍏抽敭瀛楋細娣誨姞鍒版敹钘忓す錛屾暣鐞嗘敹钘忓す錛孌oAddToFavDlg錛?DoOrganizeFavDlg

銆銆 1銆佹暣鐞嗘敹钘忓す

銆銆璋冪敤“鏁寸悊鏀惰棌澶?#8221;瀵硅瘽妗嗭紙濡備笅錛夛紝鍩烘湰涓婃潵璇撮兘鐢ㄧ殑鏄悓涓涓柟娉曪紝鍗寵皟鐢?#8220;shdocvw.dll”涓殑“DoOrganizeFavDlg”鍑芥暟錛屾妸鐖剁獥鍙e彞鏌勫拰鏀惰棌澶硅礬寰勪綔涓哄弬鏁頒紶鍏ュ嵆鍙?/p>


 

銆銆 2銆佷唬鐮?/strong>

銆銆浠g爜瀹炰緥濡備笅鎵紺猴紝鍊煎緱娉ㄦ剰鐨勬槸瀵?#8220;shdocvw.dll”鐨勫鐞嗭紝涓洪伩鍏嶉噸澶嶈皟鐢紝搴旇鍏堟鏌ュ叾鏄惁宸茬粡鍦ㄥ唴瀛樹腑銆?/p>


銆銆void CMyHtmlView::OnFavOrganizefav()
銆銆{
銆銆typedef UINT (CALLBACK* LPFNORGFAV)(HWND, LPTSTR);

銆銆bool bResult = false;

銆銆HMODULE hMod = ::GetModuleHandle( _T("shdocvw.dll") );

銆銆if (hMod == NULL)//濡傛灉"shdocvw.dll"灝氭湭杞藉叆鍒欒澆鍏ヤ箣
銆銆{
銆銆hMod = ::LoadLibrary( _T("shdocvw.dll") );

銆銆if (hMod == NULL)
銆銆{



銆銆MessageBox( _T("The dynamic link library ShDocVw.DLL cannot be found."),
銆銆_T("Error"), MB_OK | MB_ICONSTOP );
銆銆return;
銆銆}
銆銆LPFNORGFAV lpfnDoOrganizeFavDlg = (LPFNORGFAV)
銆銆::GetProcAddress( hMod, "DoOrganizeFavDlg" );

銆銆if (lpfnDoOrganizeFavDlg == NULL)
銆銆{
銆銆MessageBox( _T("The entry point DoOrganizeFavDlg cannot be found\n")
銆銆_T("in the dynamic link library ShDocVw.DLL."),
銆銆_T("Error"), MB_OK | MB_ICONSTOP );
銆銆return;
銆銆}

銆銆TCHAR szPath [ MAX_PATH ];
銆銆HRESULT hr;

銆銆hr = ::SHGetSpecialFolderPath( m_hWnd, szPath, CSIDL_FAVORITES, TRUE );
銆銆if (FAILED(hr))
銆銆{
銆銆MessageBox( _T("The path of the Favorites folder cannot be found."),
銆銆_T("Error"), MB_OK | MB_ICONSTOP );
銆銆return;
銆銆}

銆銆bResult = (*lpfnDoOrganizeFavDlg) ( m_hWnd, szPath ) ? true : false;

銆銆::FreeLibrary( hMod );
銆銆}
銆銆else//濡傛灉"shdocvw.dll"宸茬粡鍦ㄨ皟鐢ㄨ呰繘紼嬬殑鍦板潃絀洪棿涓垯鐩存帴浣跨敤銆?br>銆銆{
銆銆LPFNORGFAV lpfnDoOrganizeFavDlg = (LPFNORGFAV)
銆銆::GetProcAddress( hMod, "DoOrganizeFavDlg" );

銆銆if (lpfnDoOrganizeFavDlg == NULL)
銆銆{
銆銆MessageBox( _T("The entry point DoOrganizeFavDlg cannot be found\n")
銆銆_T("in the dynamic link library ShDocVw.DLL."),
銆銆_T("Error"), MB_OK | MB_ICONSTOP );
銆銆return;
銆銆}

銆銆TCHAR szPath [ MAX_PATH ];
銆銆HRESULT hr;

銆銆hr = ::SHGetSpecialFolderPath( m_hWnd, szPath, CSIDL_FAVORITES, TRUE );
銆銆if (FAILED(hr))
銆銆{
銆銆MessageBox( _T("The path of the Favorites folder cannot be found."),
銆銆_T("Error"), MB_OK | MB_ICONSTOP );
銆銆return;
銆銆}


銆銆bResult = (*lpfnDoOrganizeFavDlg) ( m_hWnd, szPath ) ? true : false;
銆銆}

銆銆return;


銆銆}

銆銆 3銆佽璁?/strong>

銆銆瀹為檯涓婏紝浠?#8220;DoOrganizeFavDlg”鍑芥暟鐨勫師鍨嬪0鏄庢垜浠彲浠ョ湅鍒幫紝鐢變簬闇瑕佷竴涓礬寰勶紝鎵浠?#8220;鏁寸悊鏀惰棌澶?#8221;瀵硅瘽妗嗗叾瀹炰笉浠呭彲浠ョ敤鏉ユ暣 鐞嗘敹钘忓す錛岃繕鍙互鏁寸悊紓佺洏涓婄殑鐩綍銆傝屼笖鎵璋撶殑鏁寸悊涔熶笉榪囨槸鎻愪緵浜嗕竴涓璇濇浣跨敤鎴風敤璧鋒潵姣旇緝鏂逛究鑰屽凡錛屽拰鐩存帴鍦ㄨ祫婧愮鐞嗗櫒涓暣鐞嗘病鏈夊疄璐ㄦх殑宸埆銆傚洜姝? 璋冪敤“鏁寸悊鏀惰棌澶?#8221;瀵硅瘽妗嗙殑鏂規硶浠嶪E4.0寮濮嬪氨娌℃湁鍙樿繃錛岄櫎浜嗗璇濇鐨勫竷灞鏈夋墍鏀瑰彉銆?/p>


銆銆typedef UINT (CALLBACK* LPFNORGFAV)(HWND, LPTSTR);

銆銆IE 4.0鐨?#8220;鏁寸悊鏀惰棌澶?#8221;瀵硅瘽妗?br>

銆銆IE 4.0鐨?#8220;鏁寸悊鏀惰棌澶?#8221;瀵硅瘽妗嗭紙鍘熸湰鐨勮璁★級

銆銆“娣誨姞鍒版敹钘忓す”灝變笉鍚屼簡錛?#8220;DoAddToFavDlg”鍑芥暟涓嶅啀鍍?#8220;DoOrganizeFavDlg”鍑芥暟涓鏍峰鎵鏈塈E鐨勭増鏈兘閫傜敤銆?/p>

銆銆 鍙傝冭祫鏂欙細

銆銆MSDN: Adding Internet Explorer Favorites to Your Application




]]>
Internet Explorer緙栫▼綆榪?浜?http://m.shnenglu.com/mydriverc/articles/28955.html鏃呴?/dc:creator>鏃呴?/author>Sun, 29 Jul 2007 07:09:00 GMThttp://m.shnenglu.com/mydriverc/articles/28955.htmlhttp://m.shnenglu.com/mydriverc/comments/28955.htmlhttp://m.shnenglu.com/mydriverc/articles/28955.html#Feedback0http://m.shnenglu.com/mydriverc/comments/commentRss/28955.htmlhttp://m.shnenglu.com/mydriverc/services/trackbacks/28955.html銆銆闄や簡鎵撳紑Internet涓婄殑緗戦〉錛孖nternet Explorer榪樿兘澶熸祻瑙堟湰鍦版枃浠跺す鍙婃枃浠躲傚鏋滄祻瑙堢殑鏄疨DF鏂囨。鎴朞ffice鏂囨。錛屾湁鏃跺欎綘浼氬彂鐜板綋璋冪敤Navigate("xxx.doc") 鐨勬椂鍊欙紝Adobe Reader/Acrobat鎴朞ffice絳塂ocument Servers浼氬湪IE涓祵鍏ヨ嚜宸辯殑涓涓疄渚嬩互鎵撳紑鐩稿簲鐨勬枃浠訛紝褰撶劧鏈夋椂鍊欎篃浼氬湪鐙珛鐨凙crobat鎴朞ffice紿楀彛涓墦寮鏂囦歡銆?

銆銆鍦ˋdobe Reader/Acrobat鐨勫睘鎬ц緗獥鍙d腑錛屾垜浠彲浠ユ壘鍒?#8220;Display PDF in browser”鐨勯夐」錛屽鏋滃嬀涓婏紝鍒橬avigate("xxx.pdf")灝嗕細浠ュ祵鍏ョ殑鏂瑰紡鍦↖E涓祻瑙圥DF鏂囦歡錛屽惁鍒欏湪鐙珛鐨凙dobe Reader/Acrobat紿楀彛涓祻瑙堛備絾鍦∣ffice鐨?#8220;閫夐」”瀵硅瘽妗嗕腑鎴戜滑鎵句笉鍒拌繖鏍風殑璁劇疆銆?/p>

銆銆闂錛氬浣曞湪鑷繁鐨勬祻瑙堝櫒涓帶鍒禣ffice榪欑被Ole Servers鐨勬墦寮鏂瑰紡錛?br>
銆銆絳旀錛氫慨鏀規枃浠跺す閫夐」錛屾垨淇敼娉ㄥ唽琛ㄣ?br>
銆銆鏂規硶1銆佸涓嬫墍紺猴紝浠庢帶鍒墮潰鏉夸腑鎵撳紑“鏂囦歡澶?#8221;閫夐」錛屽湪“鏂囦歡綾誨瀷”灞炴ч〉涓婃壘鍒扮浉搴旂殑鏂囦歡鍚庣紑鍚嶏紝濡?#8220;DOC”錛岀偣鍑?#8220;楂樼駭”鎸夐挳錛屽湪寮瑰嚭鐨?#8220;緙栬緫鏂囦歡綾誨瀷”瀵硅瘽妗嗕腑鏈?#8220;鍦ㄥ悓涓紿楀彛涓祻瑙?#8221;鐨勯夐」錛屽鏋滃嬀涓婏紝鍒欎互宓屽叆IE鐨勬柟寮忔墦寮鏂囨。錛屽惁鍒欏湪鐙珛紿楀彛涓墦寮銆?br>



銆銆鏂規硶2銆佺洿鎺ヤ慨鏀規敞鍐岃〃銆?br>
銆銆鍦?#8220;HKEY_LOCAL_MACHINE\SOFTWARE\Classes”閿間笅錛屼繚瀛樹簡鍚勭鏂囦歡綾誨瀷鐨勬敞鍐屼俊鎭紝浠ffice鏂囨。涓轟緥錛屼笌鏂囨。鐩稿叧閿煎涓嬨?br>
銆銆鏂囨。綾誨瀷 閿?br>
銆銆Microsoft Excel 7.0 worksheet Excel.Sheet.5

銆銆Microsoft Excel 97 worksheet Excel.Sheet.8

銆銆Microsoft Excel 2000 worksheet Excel.Sheet.8

銆銆Microsoft Word 7.0 document Word.Document.6

銆銆Microsoft Word 97 document Word.Document.8

銆銆Microsoft Word 2000 document Word.Document.8

銆銆Microsoft Project 98 project MSProject.Project.8

銆銆Microsoft PowerPoint 2000 document PowerPoint.Show.8

濡傛灉鎴戜滑瑕佷慨鏀筗ord鏂囨。鐨勬墦寮鏂瑰紡錛岋紝鍒欏湪“HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ Word.Document.8”涓嬫柊寤轟竴涓悕涓?#8220;BrowserFlags”錛岀被鍨嬩負“REG_DWORD”鐨勫瓙閿鹼紝濡傛灉璁劇疆鍏跺間負“8”錛屽垯鍦ㄧ嫭绔? 鐨勭獥鍙d腑鎵撳紑Word鏂囨。錛屽惁鍒欏湪宓屽叆IE鐨刉ord紿楀彛涓墦寮鏂囨。銆?br>
銆銆娉細Microsoft Excel 7.0 worksheet紼嶆湁涓嶅悓錛屽簲璁劇疆BrowserFlags鐨勫間負“9”鏂瑰彲鍦ㄧ嫭绔嬬殑紿楀彛涓墦寮鏂囨。銆?br>

鍙傝冭祫鏂欙細

銆銆MSDN錛?59970錛欼n-Place Activating Document Servers in Internet Explorer

MSDN錛?62059錛欻ow to configure Internet Explorer to open Office documents in the appropriate Office program instead of in Internet Explorer


]]>
Internet Explorer緙栫▼綆榪?涓)http://m.shnenglu.com/mydriverc/articles/28954.html鏃呴?/dc:creator>鏃呴?/author>Sun, 29 Jul 2007 07:08:00 GMThttp://m.shnenglu.com/mydriverc/articles/28954.htmlhttp://m.shnenglu.com/mydriverc/comments/28954.htmlhttp://m.shnenglu.com/mydriverc/articles/28954.html#Feedback0http://m.shnenglu.com/mydriverc/comments/commentRss/28954.htmlhttp://m.shnenglu.com/mydriverc/services/trackbacks/28954.htmlTWebBrowser緙栫▼綆榪?/font>銆嬶紝鍙戣〃鍦ㄨ嚜宸辯殑涓漢涓婚〉“闃跨敇鐨勫”涓婏紝寰楀埌浜嗕笉灝戠綉鍙嬬殑鍥炲簲錛屼篃琚澶氱綉绔欒漿杞姐傛鍚庣浉褰撻暱鐨勬椂闂村唴涓嶆柇鍥炵瓟緗戝弸鐨勬彁闂紝鏀惰幏鑹銆?

銆銆鍏墮棿姝f槸澶氱獥鍙f祻瑙堝櫒鍏ㄩ潰寮鑺辯殑鏃ュ瓙錛屾棤濂堟墜澶翠簨鎯呭お澶氾紝鎴戠殑浣滃搧Multiple iExplorer涔熶竴鐩存湭鑳介棶涓栵紝鑷充粖閬楁喚銆傚悗鏉ュ父涓嶨oSurf鐨勪綔鑰呬氦嫻佸涔狅紝鏇夸粬瑙e喅浜嗕笉灝戦棶棰橈紝涔熶粠浠栭偅閲屽鍒拌澶氥傚浠奊oSurf鏈変簡姣旇緝 鍥哄畾鐨勭敤鎴風兢錛屾湁鎴戜竴浠藉姛鍔籌紝綆楁槸涓縐嶅畨鎱板惂錛屼粬涔熶竴搴﹀湪GoSurf瀹樻柟涓婚〉涓婂皢鎴戝垪涓烘牳蹇冩妧鏈敮鎸侊紝浣嗘垜鍚庢潵鍥犱負宸ヤ綔鍜屽涔犵殑鍏崇郴寰堝皯鍐嶅拰浠栬仈緋伙紝瀹? 鍦ㄦ儹鎰с?/p>

銆銆鍥炲ご鍐嶇湅褰撴椂鐨勬枃绔狅紝閿欒瀹炲湪涓嶅皯錛岃璇嗕篃姣旇緝嫻呰杽錛屾湁浜涢棶棰樻洿鏄竴鐩存病鏈夊緱鍒拌В鍐籌紝鎵浠ユ垜瑙夊緱鏈夊繀瑕佸湪鍓嶆枃鐨勫熀紜涓婏紝鑺辯偣鏃墮棿灝嗘垜縐瘡鐨勫叧浜嶪nternet Explorer緙栫▼鐨勯棶棰樻瘮杈冨畬鏁村湴鍐欏嚭鏉ワ紝甯屾湜瀵硅嚜宸辨湁涓氦浠o紝瀵瑰ぇ瀹舵湁涓浜涘府鍔┿?/p>

銆銆鏄負搴忋?/p>

銆銆 Internet Explorer緙栫▼綆榪幫紙涓錛塛ebBrowser榪樻槸WebBrowser_V1

銆銆浣犵殑鏈哄櫒涓婃繪槸瀛樺湪鐫“涓?#8221;涓猈ebBrowser錛屼竴涓彨WebBrowser錛屽彟涓涓彨WebBrowser_V1錛屽叾CLASSID濡備笅錛?/p>


銆銆CLASS_WebBrowser: TGUID = '{8856F961-340A-11D0-A96B-00C04FD705A2}';
銆銆CLASS_WebBrowser_V1: TGUID = '{EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B}';

銆銆瀹冧滑鍒嗗埆瀵瑰簲鐨勬帴鍙f槸IWebBrowser2鍜孖WebBrowser銆傞棶棰樻槸鎴戜滑璇ョ敤鍝竴涓憿錛?br>銆銆鎸夌収寰蔣鐨勬帹鑽愶紝搴旇灝介噺浣跨敤 鍓嶈咃紝鍥犱負鍚庤呮槸涓哄吋瀹笽nternet Explorer 3.x鑰屼繚鐣欑殑錛堝敖綆″畠鑳藉鍝嶅簲鏉ヨ嚜Internet Explorer 3.x銆?.x銆?.x銆?.x鐨勪簨浠訛級錛岀浉搴旂殑IWebBrowser鍜孖WebBrowserApp鎺ュ彛涔熷簲鎶涘純銆?/p>

銆銆鐢變簬Internet Explorer 3.x騫翠唬涔呰繙錛屽鑷碬ebBrowser_V1鎻愪緵鐨勪簨浠跺皯寰楀彲鎬滐紝浣嗗煎緱涓鎻愮殑鏄畠鎻愪緵鐨勪袱涓簨浠禣nNewWindow鍜? OnFrameBeforeNavigate鏈夌潃涓嶰nBeforeNavigate鍑犱箮鐩稿悓鐨勫弬鏁幫細


銆銆OnBeforeNavigate(
銆銆BSTR URL,
銆銆long Flags,
銆銆BSTR TargetFrameName,
銆銆VARIANT* PostData,
銆銆BSTR Headers,
銆銆BOOL FAR* Cancel)


銆銆OnNewWindow(
銆銆BSTR URL,
銆銆long Flags,
銆銆BSTR TargetFrameName,
銆銆VARIANT* PostData,
銆銆BSTR Headers,
銆銆BOOL FAR* Processed)

銆銆OnFrameBeforeNavigate(
銆銆BSTR URL,
銆銆long Flags,
銆銆BSTR TargetFrameName,
銆銆VARIANT* PostData,
銆銆BSTR Headers,
銆銆BOOL FAR* Cancel)

銆銆鎵浠ヤ嬌鐢╓ebBrowser_V1浣垮緱鎴戜滑鐨勬祻瑙堝櫒鍦ㄦ湁鏂扮獥鍙f墦寮鏃惰兘澶熻交鏄撴崟鎹夊埌鍏禪RL鍙婄浉鍏崇殑鏁版嵁錛屽鏋滃皢Processed璁劇疆涓篢RUE錛屽垯鍙彇娑堟柊紿楀彛鐨勫脊鍑恒傚悓鏍鳳紝澶勭悊Frame涔熸瘮鍦╓ebBrowser涓潵寰楀鏄撱?/p>

銆銆浣哤ebBrowser_V1鐨勮嚧鍛藉急鐐規槸瀹冧笉鏀寔楂樼駭鎺ュ彛錛屽IDocHostUIHandler錛屽嵆渚挎垜浠疄鐜頒簡 IDocHostUIHandler鎺ュ彛錛屼篃涓嶄細琚玏ebBrowser_V1璋冪敤銆傛墍浠ュ笇鏈涘湪鑷繁鐨勬祻瑙堝櫒涓疄鐜癤P鐨勭晫闈富棰樸佹墿灞旾E鐨凞OM 錛圖ocument Object Model錛夌瓑楂樼駭鎺у埗鐨勮瘽錛屽氨鑲畾涓嶈兘閫夋嫨WebBrowser_V1浜嗐?/p>

銆銆澶勭悊鏂扮獥鍙e疄鍦ㄦ槸寰堥夯鐑︾殑涓浠朵簨錛屼笉鐭ラ亾寰蔣涓轟粈涔堝湪鏂扮増鏈殑OnNewWindow2浜嬩歡涓幓鎺変簡URL榪欐牱鐨勫弬鏁幫紝鑰屼笖OnNewWindow2浜嬩歡涓嶈兘瀹屽叏鎹曟崏鍒版墍鏈夌殑鏂扮獥鍙f墦寮銆備絾濡傛灉瀹夎浜哤indows XP SP2鐨勮瘽錛屽ソ澶勫張鍥炴潵浜嗐?/p>

銆銆Windows XP SP2瀵笽nternet Explorer 6浣滀簡鍗囩駭錛屽茍涓旀彁渚涗簡涓涓柊鐨勪簨浠禣nNewWindow3錛屽畠鍦∣nNewWindow2浜嬩歡涔嬪墠鍙戠敓錛屼篃鍖呭惈浜嗚鎴戜滑鑳藉鍔犱互榪囨護澶勭悊鐨勬柊紿楀彛鐨? URL絳夊弬鏁幫紝鍐嶅姞涓奍NewWindowManager鎺ュ彛錛屽氨鏄疄鐜癢indows XP SP2涓繃婊ゅ箍鍛婄獥鍙e姛鑳界殑鍩虹銆?/p>


]]>
BHO寮鍙戝熀紜http://m.shnenglu.com/mydriverc/articles/28951.html鏃呴?/dc:creator>鏃呴?/author>Sun, 29 Jul 2007 06:59:00 GMThttp://m.shnenglu.com/mydriverc/articles/28951.htmlhttp://m.shnenglu.com/mydriverc/comments/28951.htmlhttp://m.shnenglu.com/mydriverc/articles/28951.html#Feedback0http://m.shnenglu.com/mydriverc/comments/commentRss/28951.htmlhttp://m.shnenglu.com/mydriverc/services/trackbacks/28951.html鏂囦歡嫻忚鍣紙exploer.exe錛屽簲鐢ㄤ簬鏂囦歡緋葷粺錛夊拰Internet嫻忚鍣? 錛坕explore.exe錛屽簲鐢ㄤ簬浜掕仈緗戣祫婧愶級銆?/span>鐢變簬榪欎袱涓祻瑙堝櫒鍔熻兘寮哄ぇ錛岃屼笖鍙堜笌Windows鎿嶄綔緋葷粺鎹嗙粦閿鍞紝鏈緇堜篃灝辨垚涓轟簡嫻忚鍣ㄧ殑鏍囧噯銆備絾 鏈夋椂鍊欙紝涓轟簡緇欐祻瑙堝櫒鍔犲叆涓浜涙柊鐨勭壒鎬э紝鎴戜滑寰寰浼氶噸鏂拌璁′竴涓嚜宸辯殑嫻忚鍣ㄣ傛柊鐨勬祻瑙堝櫒妯′豢鏍囧噯嫻忚鍣ㄧ殑澶ч儴鍒嗗姛鑳斤紝鍚屾椂鍔犲叆鏂扮壒鎬с傝繖縐嶅仛娉曟渶鐩磋錛? 浣嗗疄闄呬笂涔熸槸鐩稿浜庡井杞殑閲嶅鍔沖姩錛屼笖宸ヤ綔閲忔瘮杈冨ぇ銆傚叾瀹烇紝浣跨敤BHO鎻掍歡錛屼竴鍒囬兘鍙樺緱寰堢畝鍗曘?br>
BHO錛圔rowser Help Objects錛夛紝鏄疄鐜頒簡鐗瑰畾鎺ュ彛鐨凜OM緇勪歡銆傚紑鍙戝ソ鐨凚HO鎻掍歡鍦ㄦ敞鍐岃〃鐗瑰畾鐨勪綅緗敞鍐屽ソ鍚庯紝姣忓綋寰蔣鐨勬祻瑙堝櫒鍚姩錛孊HO瀹炰緥灝變細琚垱寤恒傚湪嫻忚 鍣ㄥ伐浣滅殑宸ョ▼涓紝BHO浼氭帴鏀跺埌寰堝浜嬩歡錛屾瘮濡傛祻瑙堝櫒嫻忚鏂扮殑鍦板潃銆佸墠榪涙垨鍚庨銆佺敓鎴愭柊鐨勭獥鍙c佹祻瑙堝櫒閫鍑虹瓑絳夛紱BHO鍙互鍦ㄨ繖浜涗簨浠剁殑鍝嶅簲涓疄鐜頒笌嫻忚 鍣ㄧ殑浜や簰銆?br>
涓嬮潰錛屾垜浠鍏堟潵浠嬬粛涓涓婤HO鐨勫伐浣滃師鐞嗐備笂闈㈡垜浠凡緇忔彁鍒幫紝BHO鏄疌OM緇勪歡錛岃屼笖涓瀹氬疄鐜頒簡IObjectWithSite鎺ュ彛銆傝繖浜涚粍浠墮櫎浜嗗湪 娉ㄥ唽琛ㄤ腑娉ㄥ唽涓篊OM Server澶栵紝榪樺繀欏誨皢瀹冧滑鐨凜LSID鍦℉KEY_LOCAL_MACHINESOFTWAREMicrosoftWindows CurrentVersionExplorerBrowser Helper Objects涓嬫敞鍐屼負瀛愰敭銆傚井杞湪璁捐嫻忚鍣ㄧ殑鏃跺欙紝宸茬粡緇欒繖浜涚粍浠墮鐣欎簡絀洪棿銆傛瘡褰撴祻瑙堝櫒鍚姩鏃訛紝嫻忚鍣ㄤ細棣栧厛鍦ㄤ笂榪版敞鍐岃〃浣嶇疆鏌ョ湅鏄惁鏈夋敞鍐岀殑 BHO CLSID錛涘鏋滄湁鍒欏垎鍒垱寤轟竴涓疄渚嬶紝騫跺BHO瀹炰緥榪涜鍒濆鍖栵紝寤虹珛浜や簰榪炴帴銆傦紙娉細BHO瀹炰緥鍙湁鍦ㄥ垱寤哄畠鐨勬祻瑙堝櫒紿楀彛閿姣佹椂鎵嶈閲婃斁銆傦級涓嬪浘婕旂ず 浜咮HO鐨勫垱寤鴻繃紼嬶細
璇存槑 createbho.jpg

鎴愬姛鍒涘緩鐨凚HO錛屼笉浠呭彲浠ュ緱鍒板悇縐嶆爣鍑嗙殑嫻忚鍣ㄦ搷浣滀簨浠訛紝騫跺仛鍑哄搷搴旓紱榪樺彲浠ュ畾鍒舵祻瑙堝櫒鐨勮彍鍗曘佸伐鍏鋒潯絳夌晫闈㈠厓绱狅紱鏇存垨鑰呭彲浠ュ畨瑁呴挬瀛愬嚱鏁幫紝鐩戣嫻忚鍣? 鐨勪竴涓句竴鍔ㄣ傚煎緱娉ㄦ剰鐨勬槸錛屼嬌鐢˙HO鎻掍歡錛孖nternet嫻忚鍣ㄨ姹傚湪4.0浠ヤ笂鐗堟湰錛涘鏋滄槸鏂囦歡嫻忚鍣紝鎿嶄綔緋葷粺瑕佹眰鏄疻indows 95/98/2000鎴朩indow NT 4.0浠ヤ笂鐗堟湰錛屽茍涓擲hell鐨勭増鏈湪4.71浠ヤ笂銆備笅闈㈡槸鏀寔BHO鐗規х殑緋葷粺涓瑙堣〃錛?br>
Shell鐗堟湰 鎿嶄綔緋葷粺鐗堟湰 鏀寔BHO
4.00 Windows 95 and Windows NT 4.0錛圛E鐗堟湰涓?4.0錛?浠匢E4.0
4.71 Windows 95 and Windows NT 4.0錛圛E鐗堟湰涓?4.0錛?IE鍜屾枃浠舵祻瑙堝櫒
4.72 Windows 98 IE鍜屾枃浠舵祻瑙堝櫒
5.00   Windows 2000 IE鍜屾枃浠舵祻瑙堝櫒

鎺ヤ笅鍘伙紝絎旇呭氨鏉ヤ粙緇嶄竴涓嬪浣曞紑鍙態HO鎻掍歡錛屽紑鍙戠幆澧冧負VC6.0錛堜嬌鐢ˋTL錛夛紝瀹夎Platform SDK涓殑Internet Development SDK銆傞鍏堬紝鍚姩VC鐨凙TL COM AppWizard錛岀敓鎴愪竴涓」鐩悕涓築hoPlugin錛屽叾浣欏潎閲囩敤榛樿璁劇疆銆傛帴鐫錛屾垜浠氨鏉ュ垎姝ヨ緇嗛槓榪般?br> 絎竴姝ワ紝澧炲姞涓涓狝TL Object鍒拌欏圭洰涓俈C鑿滃崟Insert->New ATL Object…錛屽湪寮瑰嚭鐨勫璇濇涓夋嫨“Internet Explorer Object”錛岃緭鍏OM綾誨悕錛堝湪Short Name鍚庤緭鍏yeOnIE錛屽叾瀹冨悇欏逛細鑷姩鐢熸垚錛夈傚畬鎴愬悗錛屾垜浠彲浠ョ湅鍒癈EyeOnIE綾繪湁涓涓熀綾籌ObjectWithSiteImpl錛岃繖涓? 灝辨槸瀹炵幇IObjectWithSite鎺ュ彛鐨勬ā鐗堢被銆?br> 絎簩姝ワ紝瀹炵幇IObjectWithSite鐨勬帴鍙f柟娉曘傚湪榪欎箣鍓嶏紝鎴戜滑瑕佸厛瀹氫箟鍑犱釜鎴愬憳鍙橀噺錛欳ComQIPtr<IWebBrowser2, &IID_IWebBrowser2> mWebBrowser2錛岋紙闇瑕佸姞鍏?include "ExDisp.h"錛夛紝鐢ㄤ互淇濆瓨嫻忚鍣ㄧ粍浠剁殑鎸囬拡錛汥WORD mCookie錛岀敤浠ヤ繚瀛樹笌嫻忚鍣ㄧ殑榪炴帴ID銆侷ObjectWithSite鏈変袱涓帴鍙f柟娉曪細SetSite鍜孏etSite銆傛垜浠彧闇閲嶈澆 SetSite灝辮浜嗐傚湪EyeOnIE.h涓鍔犲嚱鏁板0鏄嶴TDMETHOD(SetSite)(IUnknown *pUnkSite)錛屽湪EyeOnIE.cpp瀹炵幇濡備笅錛?br> STDMETHODIMP CEyeOnIE::SetSite(IUnknown *pUnkSite)
{
USES_CONVERSION;

if (pUnkSite)
{
mWebBrowser2 = pUnkSite;
if (mWebBrowser2)
{
return RegisterEventHandler(TRUE);
}
}
return E_FAIL;
}

HRESULT CEyeOnIE::RegisterEventHandler(BOOL inAdvise)
{
CComPtr<IConnectionPoint> spCP;
// Receives the connection point for WebBrowser events
CComQIPtr<IConnectionPointContainer, &IID_IConnectionPointContainer> spCPC(mWebBrowser2);
HRESULT hr = spCPC->FindConnectionPoint(DIID_DWebBrowserEvents2, &spCP);
if (FAILED(hr))
return hr;

if (inAdvise)
{
// Pass the event handlers to the container
hr = spCP->Advise(reinterpret_cast<IDispatch*>(this), &mCookie);
}
else
{
spCP->Unadvise(mCookie);
}
return hr;
}
鎴戜滑鍙互鐪嬪埌錛孲etSite鐨勫弬鏁板疄闄呬笂鎸囧悜鐨勬槸嫻忚鍣ㄧ粍浠躲傚湪SetSite瀹炵幇涓紝鎴戜滑棣栧厛淇濆瓨嫻忚鍣ㄧ粍浠舵寚閽堬紝鐒跺悗灝嗚BHO鍚戞祻瑙堝櫒娉ㄥ唽涓轟簨浠跺鐞嗗櫒銆?br> 絎笁姝ワ紝瀹炵幇IDispatch鎺ュ彛鏂規硶銆備簨浠跺鐞嗕篃灝卞湪IDispatch::Invoke涓疄鐜幫紙鍚勪釜浜嬩歡鐨処D鍦‥xDispID.h涓畾涔夛級銆? BHO鍙兘浼氭帴鏀跺埌寰堝浜嬩歡錛屼絾鎴戜滑鍙渶瑕佸搷搴旀垜浠劅鍏磋叮鐨勯偅涓閮ㄥ垎銆傞鍏堝湪EyeOnIE.h涓鍔犺鍑芥暟鐨勫0鏄庯紝鍦‥yeOnIE.cpp鐨勫疄鐜頒腑錛? 絎旇呰瘯鐫鍝嶅簲嫻忚鍣ㄦ祻瑙堜竴涓湴鍧涔嬪墠鍙戝嚭鐨勪簨浠?a name="baidusnap1"> STDMETHODIMP CEyeOnIE::Invoke(DISPID dispidMember,REFIID riid, LCID lcid,
WORD wFlags, DISPPARAMS * pDispParams,
VARIANT * pvarResult,EXCEPINFO * pexcepinfo,
UINT * puArgErr)
{
USES_CONVERSION;

if (!pDispParams)
return E_INVALIDARG;

switch (dispidMember)
{
//
// The parameters for this DISPID are as follows:
// [0]: Cancel flag - VT_BYREF|VT_BOOL
// [1]: HTTP headers - VT_BYREF|VT_VARIANT
// [2]: Address of HTTP POST data - VT_BYREF|VT_VARIANT
// [3]: Target frame name - VT_BYREF|VT_VARIANT
// [4]: Option flags - VT_BYREF|VT_VARIANT
// [5]: URL to navigate to - VT_BYREF|VT_VARIANT
// [6]: An object that evaluates to the top-level or frame
// WebBrowser object corresponding to the event.
//
case DISPID_BEFORENAVIGATE2 :
{
LPOLESTR lpURL = NULL;
mWebBrowser2->get_LocationURL(&lpURL);
char * strurl;
if (pDispParams->cArgs >= 5 && pDispParams->rgvarg[5].vt == (VT_BYREF|VT_VARIANT))
{
CComVariant varURL(*pDispParams->rgvarg[5].pvarVal);
varURL.ChangeType(VT_BSTR);
strurl = OLE2A(varURL.bstrVal);
}
if (strstr(strurl, "girl.com"))
{
*pDispParams->rgvarg[0].pboolVal = TRUE;
::MessageBox(NULL, _T("璇ョ綉欏靛凡琚姝?"),_T("Warning"),MB_ICONSTOP);
return S_OK;
}
break;
}

case DISPID_NAVIGATECOMPLETE2:
break;
case DISPID_DOCUMENTCOMPLETE:
break;
case DISPID_DOWNLOADBEGIN:
break;
case DISPID_DOWNLOADCOMPLETE:
break;
case DISPID_NEWWINDOW2:
break;
case DISPID_QUIT:
RegisterEventHandler(FALSE);
break;
default:
break;
}

return S_OK;
}
鎴戜滑鐪嬪埌錛屽綋鐢ㄦ埛嫻忚鐨勬柊鍦板潃鍖呭惈"girl.com"瀛楃鐨勬椂鍊欙紝嫻忚鍣ㄥ氨浼氬脊鍑轟竴涓鍛婂璇濇錛屽茍涓斿仠姝㈣繘涓姝ョ殑鍔ㄤ綔銆傚彟澶栧煎緱娉ㄦ剰鐨勬槸錛屽湪DISPID_QUIT浜嬩歡錛堟祻瑙堝櫒灝嗚閫鍑猴級鐨勫搷搴斾腑錛屾垜浠皢BHO浜嬩歡澶勭悊鍣ㄨ繘琛屼簡娉ㄩ攢銆?br> 絎洓姝ワ紝鍥犱負BHO鍙兘浼氳鏂囦歡嫻忚鍣ㄥ姞杞姐傚鏋滄垜浠笉鎯寵繖鏍鳳紝鎴戜滑灝辮鍦―llMain涓鍔犺澆鑰呰繘琛屽垽鏂紝鍙傝冨涓嬶細
extern "C"
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
// Check who's loading us.
// If it's Explorer then "no thanks" and exit...
TCHAR pszLoader[MAX_PATH];
GetModuleFileName(NULL, pszLoader, MAX_PATH);
_tcslwr(pszLoader);
if (_tcsstr(pszLoader, _T("explorer.exe")))
return FALSE;

_Module.Init(ObjectMap, hInstance, &LIBID_BHOPLUGINLib);
DisableThreadLibraryCalls(hInstance);
}
else if (dwReason == DLL_PROCESS_DETACH)
_Module.Term();
return TRUE; // ok
}
鏈鍚庯紝鍒繕浜嗕慨鏀規敞鍐岃〃鏂囦歡錛岃拷鍔燘HO鐨勬敞鍐屼俊鎭傚湪EyeOnIE.rgs鏂囦歡鐨勪笅闈㈠鍔犲涓嬩唬鐮侊細
HKLM
{
SOFTWARE
{
Microsoft
{
Windows
{
CurrentVersion
{
Explorer
{
'Browser Helper Objects'
{
{6E28339B-7A2A-47B6-AEB2-46BA53782379}
}
}
}
}
}
}
}
娉ㄦ剰錛寋6E28339B-7A2A-47B6-AEB2-46BA53782379}鏄瑪鑰呰繖涓狟HO鐨凜LSID錛屽鏋滀綘鑷繁寮鍙態HO錛岃繖閲屽簲璇ユ紜~鍐欎綘鐨凜LSID銆?br>
BHO鎻掍歡鍙互瀹炵幇鐨勫姛鑳借繕鏈夊緢澶氾紝姣斿緗戦〉鍐呭鍒嗘瀽銆両E鐣岄潰瀹氬埗絳夌瓑銆備綔涓烘葷粨錛岀瑪鑰呰繕瑕佹彁閱掕鑰呬竴鐐圭殑鏄紝濡傛灉涓嶆兂璁〣HO璧蜂綔鐢ㄤ簡錛屽彲浠ユ敞閿璇ユ彃 浠訛紝濡備笅鏍煎紡錛歳egsvr32 /u yourpathyourbho.dll錛屾垨鑰呯洿鎺ュ湪娉ㄥ唽琛ㄤ腑灝?#8220;Browser Helper Objects”鐩綍涓嬫敞鍐岀殑CLSID鍒犳帀銆?



]]>
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
      <noscript id="pjuwb"></noscript>
            <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
              <dd id="pjuwb"></dd>
              <abbr id="pjuwb"></abbr>
              欧美sm视频| 国内外成人在线| 午夜欧美精品| 亚洲欧美久久久| 亚洲一区中文| 欧美一级大片在线观看| 久久精品视频va| 欧美福利在线观看| 国产精品九九| 在线观看日韩www视频免费| 亚洲片区在线| 亚洲欧美日韩中文在线制服| 久久中文精品| 日韩视频在线免费观看| 亚洲欧美一区在线| 欧美国产精品va在线观看| 国产精品入口尤物| 亚洲国产精品福利| 亚洲欧美视频在线观看视频| 麻豆精品在线视频| 亚洲精品影院在线观看| 欧美一区国产一区| 欧美日韩的一区二区| 国模大胆一区二区三区| 99re66热这里只有精品4| 午夜精品一区二区三区在线播放| 久热成人在线视频| 亚洲视频一区| 欧美粗暴jizz性欧美20| 国产精品夫妻自拍| 亚洲精品视频在线观看网站| 久久精品国产久精国产爱| 亚洲日韩视频| 亚洲欧美日韩精品久久久久| 欧美高清视频一区| 一区在线播放| 久久精品色图| 欧美亚洲综合网| 99精品视频一区二区三区| 亚洲高清电影| 午夜宅男欧美| 亚洲激情视频在线播放| 欧美一区二区三区婷婷月色| 欧美视频官网| aa亚洲婷婷| 欧美黄色aa电影| 久久精品视频在线看| 国产精品视频久久| 一区二区三区视频在线看| 欧美激情精品久久久久久大尺度 | 欧美福利网址| 欧美一区二区精品在线| 国产精品婷婷| 亚洲男人的天堂在线观看| 夜夜爽99久久国产综合精品女不卡| 另类综合日韩欧美亚洲| 黄色成人在线观看| 久久久久久网| 久久亚洲不卡| 亚洲国产欧美日韩另类综合| 免费一级欧美片在线播放| 久久激情五月婷婷| 国内久久婷婷综合| 久久久久久久久久码影片| 亚洲欧美中文日韩v在线观看| 国产精品免费看片| 在线一区二区三区四区五区| 亚洲精品美女久久久久| 欧美偷拍一区二区| 欧美在线欧美在线| 欧美在线地址| 亚洲动漫精品| 亚洲人成在线观看| 欧美午夜三级| 亚洲午夜久久久久久久久电影院| 亚洲无线视频| 红桃av永久久久| 亚洲国产欧美日韩另类综合| 欧美日韩综合视频网址| 西瓜成人精品人成网站| 久久精品国产亚洲aⅴ| 亚洲人成免费| 亚洲午夜激情在线| 国产综合欧美| 亚洲日本aⅴ片在线观看香蕉| 欧美亚州一区二区三区| 美乳少妇欧美精品| 欧美日韩a区| 久久久av毛片精品| 欧美大片免费久久精品三p | 国产日韩欧美亚洲| 久久精品国产亚洲a| 国产精品久久久久久久久久直播| 99热精品在线| 午夜视频在线观看一区二区| 亚洲国产精品一区二区久| 亚洲伦理久久| 狠狠色狠色综合曰曰| 日韩图片一区| 在线日韩电影| 亚洲欧美一区二区三区久久| 99re热精品| 久久精品中文| 亚洲欧美日韩精品在线| 女同一区二区| 久久午夜电影| 国产精品亚洲综合久久| 亚洲国产另类 国产精品国产免费| 国产欧美不卡| 亚洲乱码一区二区| 亚洲国内精品| 欧美在线视频一区| 午夜精品福利视频| 欧美大尺度在线观看| 久久中文欧美| 国产综合色产在线精品| 亚洲午夜视频在线观看| 亚洲另类一区二区| 久久精品视频免费观看| 香蕉乱码成人久久天堂爱免费| 欧美国产日本在线| 欧美成人午夜剧场免费观看| 国产在线精品一区二区中文| 亚洲制服少妇| 午夜精品久久久久久久99水蜜桃| 欧美精品999| 亚洲电影免费观看高清完整版在线观看| 国产视频一区在线| 午夜精品在线看| 欧美在线日韩| 国产一区二区三区奇米久涩 | 亚洲欧美日产图| 亚洲综合欧美日韩| 欧美日韩不卡合集视频| 亚洲国产精品激情在线观看| 亚洲高清在线精品| 久久亚洲国产精品一区二区| 欧美大片免费观看在线观看网站推荐| 国内精品久久久久影院色| 久久成年人视频| 久久久www成人免费毛片麻豆 | 亚洲午夜激情网站| 欧美视频一区二区三区在线观看| 亚洲国内在线| 亚洲调教视频在线观看| 欧美日韩免费观看一区| 一区二区三区视频在线看| 亚洲综合色噜噜狠狠| 国产精品大全| 亚欧成人精品| 麻豆精品一区二区av白丝在线| 亚洲国产高潮在线观看| 欧美 日韩 国产在线| 最新国产成人av网站网址麻豆| 夜夜狂射影院欧美极品| 欧美日韩美女在线观看| 亚洲国产一区视频| 亚洲永久在线观看| 欧美日韩亚洲综合| 欧美激情在线狂野欧美精品| 国产亚洲精品综合一区91| 午夜精品久久久久久99热软件 | 久久久精品性| 欧美xx69| 亚洲一区二区三区精品视频| 国产精品国码视频| 久久久欧美一区二区| 亚洲欧洲一区| 欧美一区二区三区另类| 亚洲第一中文字幕在线观看| 欧美三级资源在线| 欧美专区福利在线| 亚洲人成在线播放网站岛国| 午夜一级久久| 亚洲国产三级在线| 国产精品网站视频| 美女精品国产| 亚洲欧美国产日韩天堂区| 欧美va亚洲va香蕉在线| 中日韩男男gay无套| 国产亚洲精品一区二555| 欧美激情第三页| 羞羞漫画18久久大片| 亚洲国产精品久久人人爱蜜臀| 亚洲一区二区三区四区五区黄| 激情成人在线视频| 欧美性做爰毛片| 欧美激情网友自拍| 午夜视频久久久| 亚洲精品自在久久| 欧美国产日韩一区| 久久久综合网站| 香蕉亚洲视频| 亚洲一级二级在线| 91久久中文| 国产一区二区三区四区五区美女| 欧美特黄一级| 欧美日韩视频在线| 欧美国产视频在线观看| 免费高清在线一区|