{"id":321,"date":"2014-08-09T09:11:05","date_gmt":"2014-08-09T18:11:05","guid":{"rendered":"http:\/\/blog.box.kr\/?p=321"},"modified":"2014-08-09T09:11:05","modified_gmt":"2014-08-09T18:11:05","slug":"mfc-cwebbrowser2-%ec%97%90%ec%84%9c-iwebbrowser2-%ec%82%ac%ec%9a%a9%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/blog.box.kr\/?p=321","title":{"rendered":"MFC] &#8211; CWebBrowser2 \uc5d0\uc11c IWebBrowser2 \uc0ac\uc6a9\ud558\uae30"},"content":{"rendered":"<p style=\"color: #000000;\">\ucc38\uace0 :\u00a0<a style=\"color: #3bafda;\" href=\"http:\/\/computer-programming-forum.com\/82-mfc\/20b17af03936f1e8.htm\">http:\/\/computer-programming-forum.com\/82-mfc\/20b17af03936f1e8.htm<\/a><\/p>\n<p style=\"color: #000000;\">\n<span id=\"callbacknestwabartistorycom8574877\"><\/span><\/p>\n<p style=\"color: #000000;\">\n<p style=\"color: #000000;\">\n<p style=\"color: #000000;\">You can get the IWebBrowser2 from the CWebBrowser2 something like this&#8230;<\/p>\n<p style=\"color: #000000;\">\u00a0 \u00a0 IWebBrowser2* GetIWebBrowser2FromCWebBrowser2(CWebBrowser2&amp; wndBrowser)<br \/>\n{<br \/>\nIWebBrowser2* piWebBrowser2=NULL;<br \/>\nif (LPUNKNOWN pUnk = wndBrowser.GetControlUnknown())<br \/>\n{<br \/>\nif (SUCCEEDED(pUnk-&gt;QueryInterface(<br \/>\nIID_IWebBrowser2, (void**)&amp;piWebBrowser2)))<br \/>\n{<br \/>\n\/\/ Remember to call Release<br \/>\nreturn piWebBrowser2;<br \/>\n}<br \/>\n}<br \/>\nreturn NULL;<br \/>\n}<\/p>\n<p style=\"color: #000000;\">And call it something like this&#8230;<\/p>\n<p style=\"color: #000000;\">\u00a0 \u00a0 if (IWebBrowser2* piWB2 = GetIWebBrowser2FromCWebBrowser2(<br \/>\nm_wndBrowser))<br \/>\n{<br \/>\npiWB2-&gt;Release();<br \/>\n}<\/p>\n<p style=\"color: #000000;\">Where m_wndBrowser is an valid instance of a CWebBrowser2.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ucc38\uace0 :\u00a0http:\/\/computer-programming-forum.com\/82-mfc\/20b17af03936f1e8.htm You can get the IWebBrowser2 from the CWebBrowser2 something like this&#8230; \u00a0 \u00a0 IWebBrowser2* GetIWebBrowser2FromCWebBrowser2(CWebBrowser2&amp; wndBrowser) { IWebBrowser2* piWebBrowser2=NULL; if (LPUNKNOWN pUnk = wndBrowser.GetControlUnknown()) { if (SUCCEEDED(pUnk-&gt;QueryInterface( IID_IWebBrowser2, (void**)&amp;piWebBrowser2))) { \/\/ Remember to call Release return piWebBrowser2; } } return NULL; } And call it something like this&#8230; \u00a0 \u00a0 if (IWebBrowser2* piWB2 = GetIWebBrowser2FromCWebBrowser2( m_wndBrowser)) { piWB2-&gt;Release(); } Where m_wndBrowser is an valid instance of a CWebBrowser2.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"ngg_post_thumbnail":0,"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[9,19,7],"tags":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5q9Zn-5b","jetpack-related-posts":[{"id":224,"url":"https:\/\/blog.box.kr\/?p=224","url_meta":{"origin":321,"position":0},"title":"Handling HTML Element Events","date":"2014-07-23","format":false,"excerpt":"http:\/\/msdn.microsoft.com\/en-us\/library\/bb508508(v=vs.85).aspx Handling HTML Element Events 9 out of 10 rated this helpful\u00a0-\u00a0Rate this topic The\u00a0HTMLElementEvents2\u00a0interface is an event sink interface that enables an application to receive events for HTML elements. Your custom application can receive these events, which are fired in response to user actions on HTML elements, when hosting\u2026","rel":"","context":"In &quot;C\/C++&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":248,"url":"https:\/\/blog.box.kr\/?p=248","url_meta":{"origin":321,"position":1},"title":"[\uac1c\ubc1c\/VC++] WebBrowser Control \uc774\ubca4\ud2b8 \uc5f0\uacb0 &#8211; C++","date":"2014-07-23","format":false,"excerpt":"IT\/\uac1c\ubc1c\u00a02011\/02\/10 12:12 [\uac1c\ubc1c\/VC++] WebBrowser Control \uc774\ubca4\ud2b8 \uc5f0\uacb0 - C++ WebBrowser Control IDispatch IWebBrowser2 .ReadyState READYSTATE_COMPLETE .Navigate2() .get_Document() \/\/ IDispatch -> IHTMLDocument2 .get_StatusText() on DownloadBegin on DocumentComplete on DownloadComplete IOleObject \u00a0 IHTMLWindow2 IHTMLDocument2 .get_all() .get_parentWindow() \/\/ IHTMLWindow2 IHTMLElementCollection .item() .tags \/\/ IHTMLElementCollection IHTMLElement a connectable object IConnectionPointContainer .FindConnectionPoint() \/\/ DHTMLElementEvents2 DHTMLElementEvents2\u2026","rel":"","context":"In &quot;C\/C++&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":234,"url":"https:\/\/blog.box.kr\/?p=234","url_meta":{"origin":321,"position":2},"title":"Using the WebBrowser Control from C\/C++","date":"2014-07-23","format":false,"excerpt":"Using the WebBrowser Control from C\/C++ \u00a0 This section describes some of the common implementations of the WebBrowser control, including: Adding Internet browsing functionality to your application Printing Web pages with the WebBrowser control Changing fonts with the WebBrowser control Working with WebBrowser events Adding Internet Browsing Functionality to Your\u2026","rel":"","context":"In &quot;C\/C++&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":206,"url":"https:\/\/blog.box.kr\/?p=206","url_meta":{"origin":321,"position":3},"title":"Web Browser \ucee8\ud2b8\ub864","date":"2014-07-16","format":false,"excerpt":"Web Browser Control FAQ \u00a0 \ub2e4\uc74c\uc758\u00a0FAQ(FAQ\ub77c\uace0 \ud558\uae30\ub3c4 \ubb50 \ud569\ub2c8\ub2e4\ub9cc.. )\ub294 \uc81c\uac00\u00a0VC++ Q&A\u00a0\uc5d0\uc11c \uadf8 \ub3d9\uc548 \ubd10\uc654\ub358\u00a0Web Browser\u00a0\ucee8\ud2b8\ub864\uacfc \uad00\ub828 \uc9c8\ubb38\ub4e4\uc5d0 \ub300\ud55c \ub2f5 \uae00\uacfc\u00a0KB, MSDN\u00a0\ub9c1\ud06c \ubaa8\uc74c \ub4e4 \uc785\ub2c8\ub2e4.\u00a0 \uadf8 \ub3d9\uc548 \uc9d1 \ucef4\ud4e8\ud130\uc5d0 \uc815\ub9ac\ub9cc \ud574 \ub193\uace0 \ud544\uc694\ud560 \ub54c \uc885\uc885 \ucc38\uace0 \ud588\uc5c8\ub294\ub370 \uc5bc\ub9c8 \uc804 \ub178\ud2b8\ubd81 \ud558\ub4dc\uac00 \uc0ac\ub9dd \ud558\uc2e0 \ud6c4\uc5d0 \ubcf5\uad6c\ud55c \ub0b4\uc6a9\uc744 \ud301 \uac8c\uc2dc\ud310\uc5d0 \uc62c\ub9ac\ub294\uac8c \ub0ab\uaca0\ub2e4\uace0\u2026","rel":"","context":"In &quot;C\/C++&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":325,"url":"https:\/\/blog.box.kr\/?p=325","url_meta":{"origin":321,"position":4},"title":"[MFC] &#8211; \ub3d9\uc77c \uc5b4\ud50c \ubc18\ubcf5 \uc2e4\ud589 \ubc29\uc9c0","date":"2014-08-09","format":false,"excerpt":"SDI \ub85c \uc791\uc5c5\ud558\uc600\ub2e4\uba74,\u00a0\uc751\uc6a9\ud504\ub85c\uadf8\ub7a8 \uac1d\uccb4\uc5d0 \ud574\ub2f9 \ud568\uc218\ub97c \uc120\uc5b8 \ud6c4 \ucd94\uac00. \uadf8\ub9ac\uace0 \ud504\ub85c\uadf8\ub7a8\uc774\ub984(IDS_APP_NAME)\uc744 \ub9ac\uc18c\uc2a4\uc5d0 \ub4f1\ub85d\ud558\uac70\ub098, \uac00\uc838\uc640\uc11c \uc0ac\uc6a9 BOOL CWebBroApp::IsRunning(void) { CString appName = _T(\"\"); appName.LoadString(IDS_APP_NAME); \/\/\u00a0HANDLE hMuxtex = CreateMutex(NULL, TRUE, (LPCTSTR)TEXT(\"ADIcon\")); HANDLE hMuxtex = CreateMutex(NULL, TRUE, (LPCTSTR)appName); if(GetLastError() == ERROR_ALREADY_EXISTS) \u00a0{ ReleaseMutex(hMuxtex); CWnd *pWndPre = NULL, *pWndChild = NULL; \/* if(pWndPre =\u2026","rel":"","context":"In &quot;C\/C++&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":267,"url":"https:\/\/blog.box.kr\/?p=267","url_meta":{"origin":321,"position":5},"title":"[MFC] CListCtrl \uc120\ud0dd\ub41c \ud56d\ubaa9 Index","date":"2014-07-26","format":false,"excerpt":"\/\/ \ub2e4\uc911 \uc120\ud0dd\uc2dc void GetIndex() { int nItemCount = m_ctrlList.GetSelectedCount(); POSITION pos = m_ctrlList.GetFirstSelectedItemPosition(); for (int i = 0; i < nItemCount; i++) { int nIndex = m_ctrlList.GetNextSelectedItem(pos); } } \u00a0\/\/ \ub2e8\uc77c \uc120\ud0dd int GetIndex() { int nSelectedItem = m_ctrlList.GetNextItem( -1, LVNI_SELECTED ); CString strKey = m_ctrlList.GetItemText(nSelectedItem, 0); \u00a0\u00a0\u00a0 if\u2026","rel":"","context":"In &quot;C\/C++&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/posts\/321"}],"collection":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=321"}],"version-history":[{"count":0,"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/posts\/321\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=321"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=321"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=321"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}