<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>RE: FW: WM_NEXTDLGCTL changes the default button ID and does not rest ore default control identifier</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>No, it is required. The DEFDLG_SetDefButton() is also called from message DM_SETDEFID. In this case idResult should set to the default button ID passed. And the current logic of DEFDLG_SetDefButton() does what is required for DM_SETDEFID.</FONT></P>

<P><FONT SIZE=2>But when called from the&nbsp; WM_NEXTDLGCTL, it should not change idResult. It should only change the look of the button by drawing the default button rectangle if it is a push button. </FONT></P>

<P><FONT SIZE=2>Otherwise we need to enhance the DEFDLG_SetDefButton() to accept one more parameter which indicates who invoked the method.</FONT></P>

<P><FONT SIZE=2>Krishna</FONT>
</P>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Alexandre Julliard [<A HREF="mailto:julliard@winehq.org">mailto:julliard@winehq.org</A>] </FONT>
<BR><FONT SIZE=2>Sent: Thursday, June 17, 2004 8:36 PM</FONT>
<BR><FONT SIZE=2>To: Krishna Murthy</FONT>
<BR><FONT SIZE=2>Cc: wine-devel@winehq.org</FONT>
<BR><FONT SIZE=2>Subject: Re: FW: WM_NEXTDLGCTL changes the default button ID and does not rest ore default control identifier</FONT>
</P>

<P><FONT SIZE=2>Krishna Murthy &lt;Krishna.Murthy@guptaworldwide.com&gt; writes:</FONT>
</P>

<P><FONT SIZE=2>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /**</FONT>
<BR><FONT SIZE=2>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * if the next control is push button, then draw default push button</FONT>
<BR><FONT SIZE=2>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * rectangle.</FONT>
<BR><FONT SIZE=2>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * </FONT>
<BR><FONT SIZE=2>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * if the next control is not a push button, then draw the push button</FONT>
<BR><FONT SIZE=2>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * rectangle for the default control.</FONT>
<BR><FONT SIZE=2>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * </FONT>
<BR><FONT SIZE=2>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * Call SetDefButton to draw the default rectangle, but do not change the</FONT>
<BR><FONT SIZE=2>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * default push button ID (idResult) - As Per MSDN</FONT>
<BR><FONT SIZE=2>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; */</FONT>
<BR><FONT SIZE=2>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( !(SendMessageW(hwndDest, WM_GETDLGCODE, 0, 0 ) &amp; </FONT>
<BR><FONT SIZE=2>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (DLGC_UNDEFPUSHBUTTON | DLGC_BUTTON)) )</FONT>
<BR><FONT SIZE=2>&gt; +&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hwndDest = GetDlgItem(hwnd, idSaveResult);</FONT>
<BR><FONT SIZE=2>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DEFDLG_SetDefButton( hwnd, dlgInfo, GetDlgCtrlID(hwndDest) );</FONT>
<BR><FONT SIZE=2>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dlgInfo-&gt;idResult = idSaveResult;</FONT>
</P>

<P><FONT SIZE=2>It seems you are doing redundant work here, since DEFDLG_SetDefButton will also send the same WM_GETDLGCODE. Wouldn't a simpler fix be to have DEFDLG_SetDefButton not set idResult unless it really changed the default button?</FONT></P>

<P><FONT SIZE=2>--</FONT>
<BR><FONT SIZE=2>Alexandre Julliard</FONT>
<BR><FONT SIZE=2>julliard@winehq.org</FONT>
</P>

</BODY>
</HTML>