{"id":151,"date":"2006-12-31T15:30:39","date_gmt":"2006-12-31T13:30:39","guid":{"rendered":"https:\/\/alax.info\/blog\/151"},"modified":"2014-01-27T13:12:29","modified_gmt":"2014-01-27T11:12:29","slug":"how-to-customize-ole-property-frame-window-with-atl-and-wtl","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/151","title":{"rendered":"How to customize OLE property frame window with ATL and WTL"},"content":{"rendered":"<p>Window API provides useful functions <a href=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/ms678437.aspx\">OleCreatePropertyFrame<\/a> and <a href=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/ms693353.aspx\">OleCreatePropertyFrameIndirect<\/a>, which allow easily to pop up object&#8217;s <a href=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/ms678419.aspx\">property pages<\/a>, OLE property pages. The frame, however, is not customizable, does not even allows centering relative to parent&#8217;s window. <em>COlePropertyFrameDialogT<\/em> template class is to be a solution for this problem.<\/p>\n<p>Additionally the template offers useful methods to discover available property pages from object&#8217;s <a href=\"http:\/\/msdn2.microsoft.com\/en-us\/ms695217.aspx\">ISpecifyPropertyPages<\/a> interface, if available. With multiple objects you have a choice to show union of individual object&#8217;s pages, or intersection of the pages (that is show only pages supported by all provided objects).<\/p>\n<p><img decoding=\"async\" id=\"image150\" alt=\"31-Image001.png\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2006\/12\/31-Image001.png\" \/><\/p>\n<p>Code excerpt:<\/p>\n<div>\n<pre><code>CMyOlePropertyFrameDialog Dialog;\r\nDialog.SetObject(pSampleObjectUnknown);\r\n\/\/ NOTE: This instructs dialog to query for proeprty pages from assigned object(s)\r\nDialog.SetObjectPages();\r\nconst INT_PTR nDialogResult = Dialog.DoModal(m_hWnd);<\/code><\/pre>\n<\/div>\n<p><!--more--><\/p>\n<p>The sample project\/application provides reusable <em>COlePropertyFrameDialogT<\/em> template class, customized\u00c2\u00a0 <em>CMyOlePropertyFrameDialog<\/em> class to show frame centered by owner (through handling WM_INITDIALOG message using WTL&#8217;s MSG_WM_INITDIALOG macro) and a sample COM object <em>CSampleObject<\/em> with associated <em>Color<\/em> property page from stock property pages (implemented by ATL\/MFC).<\/p>\n<p>Visual C++.NET 2005 source code can be downloaded <a id=\"p113\" title=\"scrollingpropertypage01.zip\" href=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2006\/12\/OlePropertyFrameDialog.zip\">here<\/a>, compiled binary &#8211; <a id=\"p114\" href=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2006\/12\/OlePropertyFrameDialog.exe.zip\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Window API provides useful functions OleCreatePropertyFrame and OleCreatePropertyFrameIndirect, which allow easily to pop up object&#8217;s property pages, OLE property pages. The frame, however, is not customizable, does not even allows centering relative to parent&#8217;s window. COlePropertyFrameDialogT template class is to be a solution for this problem. Additionally the template offers useful methods to discover available&hellip; <\/p>\n<p><a class=\"moretag\" href=\"https:\/\/alax.info\/blog\/151\">Read the full article<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,13,20],"tags":[],"class_list":["post-151","post","type-post","status-publish","format-standard","hentry","category-atl","category-source","category-wtl"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/151","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/comments?post=151"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/151\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}