<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How to disable maximizing the dialog from Task manager?</title>
	<atom:link href="http://weseetips.com/2008/08/20/how-to-disable-maximizing-the-dialog-from-task-manager/feed/" rel="self" type="application/rss+xml" />
	<link>http://weseetips.com/2008/08/20/how-to-disable-maximizing-the-dialog-from-task-manager/</link>
	<description>Gold mine of Visual C++ tricks!</description>
	<lastBuildDate>Thu, 12 Jan 2012 15:10:53 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: James E</title>
		<link>http://weseetips.com/2008/08/20/how-to-disable-maximizing-the-dialog-from-task-manager/comment-page-1/#comment-200</link>
		<dc:creator>James E</dc:creator>
		<pubDate>Mon, 27 Jul 2009 17:35:54 +0000</pubDate>
		<guid isPermaLink="false">http://weseetips.wordpress.com/?p=395#comment-200</guid>
		<description>One way to solve the issue that Knjaz brings up is to use the GetWindowPlacement API instead to get the normal restored-position rect.

void CRabbitDlg::OnGetMinMaxInfo( MINMAXINFO FAR* pMinMaxInfo )
{
    WINDOWPLACEMENT lpwndpl;
    GetWindowPlacement(&amp;lpwndpl);
    CRect WindowRect(&amp;lpwndpl.rcNormalPosition);

    // Set the maximum size. Used while maximizing.
    pMinMaxInfo-&gt;ptMaxSize.x = WindowRect.Width();
    pMinMaxInfo-&gt;ptMaxSize.y = WindowRect.Height();

    // Set the x,y position after maximized.
    pMinMaxInfo-&gt;ptMaxPosition.x = rect.left;
    pMinMaxInfo-&gt;ptMaxPosition.y = rect.top;
}</description>
		<content:encoded><![CDATA[<p>One way to solve the issue that Knjaz brings up is to use the GetWindowPlacement API instead to get the normal restored-position rect.</p>
<p>void CRabbitDlg::OnGetMinMaxInfo( MINMAXINFO FAR* pMinMaxInfo )<br />
{<br />
    WINDOWPLACEMENT lpwndpl;<br />
    GetWindowPlacement(&amp;lpwndpl);<br />
    CRect WindowRect(&amp;lpwndpl.rcNormalPosition);</p>
<p>    // Set the maximum size. Used while maximizing.<br />
    pMinMaxInfo-&gt;ptMaxSize.x = WindowRect.Width();<br />
    pMinMaxInfo-&gt;ptMaxSize.y = WindowRect.Height();</p>
<p>    // Set the x,y position after maximized.<br />
    pMinMaxInfo-&gt;ptMaxPosition.x = rect.left;<br />
    pMinMaxInfo-&gt;ptMaxPosition.y = rect.top;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Knjaz Drocheslav</title>
		<link>http://weseetips.com/2008/08/20/how-to-disable-maximizing-the-dialog-from-task-manager/comment-page-1/#comment-199</link>
		<dc:creator>Knjaz Drocheslav</dc:creator>
		<pubDate>Tue, 09 Jun 2009 08:34:15 +0000</pubDate>
		<guid isPermaLink="false">http://weseetips.wordpress.com/?p=395#comment-199</guid>
		<description>There is one more issue with Jijo&#039;s solution.
Lets&#039; imagine we first minimize a window from TaskManager, then maximize it. Since window is initially in minimized state:

    RECT rect = { 0 };
    GetWindowRect( &amp;rect ); /*window is curently minimized, rect will not contain valid coordinates.*/
    CRect WindowRect( &amp;rect );

    // Set the maximum size. Used while maximizing.
    pMinMaxInfo-&gt;ptMaxSize.x = WindowRect.Width();
    pMinMaxInfo-&gt;ptMaxSize.y = WindowRect.Height();
/*Invalid values (likely, zeroes?) are placed in pMinMaxInfo-&gt;ptMaxSize.x,y*/

    // Set the x,y position after maximized.
    pMinMaxInfo-&gt;ptMaxPosition.x = rect.left;
    pMinMaxInfo-&gt;ptMaxPosition.y = rect.top;
/*Invalid values (likely, some negative numbers) are placed in pMinMaxInfo-&gt;ptMaxPosition.x,y*/

As a result, the window will never be displayed again.</description>
		<content:encoded><![CDATA[<p>There is one more issue with Jijo&#8217;s solution.<br />
Lets&#8217; imagine we first minimize a window from TaskManager, then maximize it. Since window is initially in minimized state:</p>
<p>    RECT rect = { 0 };<br />
    GetWindowRect( &amp;rect ); /*window is curently minimized, rect will not contain valid coordinates.*/<br />
    CRect WindowRect( &amp;rect );</p>
<p>    // Set the maximum size. Used while maximizing.<br />
    pMinMaxInfo-&gt;ptMaxSize.x = WindowRect.Width();<br />
    pMinMaxInfo-&gt;ptMaxSize.y = WindowRect.Height();<br />
/*Invalid values (likely, zeroes?) are placed in pMinMaxInfo-&gt;ptMaxSize.x,y*/</p>
<p>    // Set the x,y position after maximized.<br />
    pMinMaxInfo-&gt;ptMaxPosition.x = rect.left;<br />
    pMinMaxInfo-&gt;ptMaxPosition.y = rect.top;<br />
/*Invalid values (likely, some negative numbers) are placed in pMinMaxInfo-&gt;ptMaxPosition.x,y*/</p>
<p>As a result, the window will never be displayed again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Recent Links Tagged With "taskmanager" - JabberTags</title>
		<link>http://weseetips.com/2008/08/20/how-to-disable-maximizing-the-dialog-from-task-manager/comment-page-1/#comment-198</link>
		<dc:creator>Recent Links Tagged With "taskmanager" - JabberTags</dc:creator>
		<pubDate>Tue, 30 Sep 2008 18:19:10 +0000</pubDate>
		<guid isPermaLink="false">http://weseetips.wordpress.com/?p=395#comment-198</guid>
		<description>[...] &gt;&gt; taskmanager   Customize and tweak your Windows Vista Saved by juergenetu on Sun 28-9-2008   How to disable maximizing the dialog from Task manager? Saved by hehe5000 on Sun 28-9-2008   Task Manager Problems With XP Home Saved by snowbird122 on Wed [...]</description>
		<content:encoded><![CDATA[<p>[...] &gt;&gt; taskmanager   Customize and tweak your Windows Vista Saved by juergenetu on Sun 28-9-2008   How to disable maximizing the dialog from Task manager? Saved by hehe5000 on Sun 28-9-2008   Task Manager Problems With XP Home Saved by snowbird122 on Wed [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jijo.Raj</title>
		<link>http://weseetips.com/2008/08/20/how-to-disable-maximizing-the-dialog-from-task-manager/comment-page-1/#comment-197</link>
		<dc:creator>Jijo.Raj</dc:creator>
		<pubDate>Mon, 25 Aug 2008 09:05:37 +0000</pubDate>
		<guid isPermaLink="false">http://weseetips.wordpress.com/?p=395#comment-197</guid>
		<description>Wow!!! :D Thanks a lot for the info. I&#039;ll update the post.

Regards,
Jijo.</description>
		<content:encoded><![CDATA[<p>Wow!!! <img src='http://weseetips.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  Thanks a lot for the info. I&#8217;ll update the post.</p>
<p>Regards,<br />
Jijo.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nishad S</title>
		<link>http://weseetips.com/2008/08/20/how-to-disable-maximizing-the-dialog-from-task-manager/comment-page-1/#comment-196</link>
		<dc:creator>Nishad S</dc:creator>
		<pubDate>Mon, 25 Aug 2008 09:03:18 +0000</pubDate>
		<guid isPermaLink="false">http://weseetips.wordpress.com/?p=395#comment-196</guid>
		<description>Use this to avoid the titlebar painting problem... :)

void CRabbitDlg::OnWindowPosChanging(WINDOWPOS FAR* lpwndpos)
{
    ModifyStyle( WS_MAXIMIZE, 0 );
    CDialog::OnWindowPosChanging(lpwndpos);
}</description>
		<content:encoded><![CDATA[<p>Use this to avoid the titlebar painting problem&#8230; <img src='http://weseetips.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>void CRabbitDlg::OnWindowPosChanging(WINDOWPOS FAR* lpwndpos)<br />
{<br />
    ModifyStyle( WS_MAXIMIZE, 0 );<br />
    CDialog::OnWindowPosChanging(lpwndpos);<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>

