if (hOwner)
hOwner = GetAncestor( hOwner, GA_ROOT );
if (!hOwner) return;
- EnableWindow( hOwner, TRUE );
+ EnableWindow( hOwner, TRUE );
}
- /***********************************************************************
+
+/***********************************************************************
* DIALOG_DisableOwner
*
* Helper function for modal dialogs to disable the
return FALSE;
}
- /***********************************************************************
+/***********************************************************************
* DIALOG_GetControl32
*
* Return the class and text of the control pointed to by ptr,
p++;
/* Next control is on dword boundary */
- return (const WORD *)((((int)p) + 3) & ~3);
+ return (const WORD *)(((UINT_PTR)p + 3) & ~3);
}
- /***********************************************************************
+
+/***********************************************************************
* DIALOG_CreateControls32
*
* Create the control windows for a dialog.
DispatchMessageW( &msg );
}
if (dlgInfo->flags & DF_END) break;
+
+ if (bFirstEmpty && msg.message == WM_TIMER)
+ {
+ ShowWindow( hwnd, SW_SHOWNORMAL );
+ bFirstEmpty = FALSE;
+ }
}
}
if (dlgInfo->flags & DF_OWNERENABLED) DIALOG_EnableOwner( owner );
WORD signature;
WORD dlgver;
- signature = GET_WORD(p); p++;
dlgver = GET_WORD(p); p++;
+ signature = GET_WORD(p); p++;
- if (signature == 1 && dlgver == 0xffff) /* DIALOGEX resource */
+ if (dlgver == 1 && signature == 0xffff) /* DIALOGEX resource */
{
result->dialogEx = TRUE;
result->helpId = GET_DWORD(p); p += 2;
/* Get the font name */
result->pointSize = 0;
+ result->faceName = NULL;
result->weight = FW_DONTCARE;
result->italic = FALSE;
- result->faceName = NULL;
if (result->style & DS_SETFONT)
{
*/
if (result->pointSize == 0x7fff)
{
- /* We could call SystemParametersInfo here, but then we'd have
- * to convert from pixel size to point size (which can be
- * imprecise).
- */
+ /* We could call SystemParametersInfo here, but then we'd have
+ * to convert from pixel size to point size (which can be
+ * imprecise).
+ */
TRACE(" FONT: Using message box font\n");
}
else
{
if (result->dialogEx)
{
- result->weight = GET_WORD(p); p++;
- result->italic = LOBYTE(GET_WORD(p)); p++;
+ result->weight = GET_WORD(p); p++;
+ result->italic = LOBYTE(GET_WORD(p)); p++;
}
result->faceName = (LPCWSTR)p;
p += wcslen( result->faceName ) + 1;
/* If no saved focus control exists, set focus to the first visible,
non-disabled, WS_TABSTOP control in the dialog */
infoPtr->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE );
- if (!IsWindow( infoPtr->hwndFocus )) return;
+ if (!IsWindow( infoPtr->hwndFocus )) return;
}
DEFDLG_SetFocus( hwnd, infoPtr->hwndFocus );
ncMetrics.cbSize = sizeof(NONCLIENTMETRICSW);
if (SystemParametersInfoW(SPI_GETNONCLIENTMETRICS,
sizeof(NONCLIENTMETRICSW), &ncMetrics, 0))
- {
- hUserFont = CreateFontIndirectW( &ncMetrics.lfMessageFont );
- }
+ {
+ hUserFont = CreateFontIndirectW( &ncMetrics.lfMessageFont );
+ }
}
- else
+ else
{
- /* We convert the size to pixels and then make it -ve. This works
- * for both +ve and -ve template.pointSize */
- int pixels;
- pixels = MulDiv(template.pointSize, GetDeviceCaps(dc , LOGPIXELSY), 72);
- hUserFont = CreateFontW( -pixels, 0, 0, 0, template.weight,
- template.italic, FALSE, FALSE, DEFAULT_CHARSET, 0, 0,
- PROOF_QUALITY, FF_DONTCARE,
- template.faceName );
+ /* We convert the size to pixels and then make it -ve. This works
+ * for both +ve and -ve template.pointSize */
+ int pixels = MulDiv(template.pointSize, GetDeviceCaps(dc , LOGPIXELSY), 72);
+ hUserFont = CreateFontW( -pixels, 0, 0, 0, template.weight,
+ template.italic, FALSE, FALSE, DEFAULT_CHARSET, 0, 0,
+ PROOF_QUALITY, FF_DONTCARE,
+ template.faceName );
}
if (hUserFont)
{
HMONITOR monitor = 0;
MONITORINFO mon_info;
-
+
mon_info.cbSize = sizeof(mon_info);
if (template.style & DS_CENTER)
{
dlgInfo->hMenu = hMenu;
dlgInfo->xBaseUnit = xBaseUnit;
dlgInfo->yBaseUnit = yBaseUnit;
- dlgInfo->idResult = 0;
+ dlgInfo->idResult = IDOK;
dlgInfo->flags = flags;
/* dlgInfo->hDialogHeap = 0; */
if (dlgProc)
{
- if (SendMessageW( hwnd, WM_INITDIALOG, (WPARAM)dlgInfo->hwndFocus, param ) &&
+ HWND focus = GetNextDlgTabItem( hwnd, 0, FALSE );
+ if (SendMessageW( hwnd, WM_INITDIALOG, (WPARAM)focus, param ) &&
((~template.style & DS_CONTROL) || (template.style & WS_VISIBLE)))
{
- /* By returning TRUE, app has requested a default focus assignment */
+ /* By returning TRUE, app has requested a default focus assignment.
+ * WM_INITDIALOG may have changed the tab order, so find the first
+ * tabstop control again. */
dlgInfo->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE);
if( dlgInfo->hwndFocus )
SetFocus( dlgInfo->hwndFocus );
return 0;
}
+
/***********************************************************************
* DEFDLG_FindDefButton
*