UINT id;
LPCWSTR className;
LPCWSTR windowName;
- BOOL windowNameFree;
+ BOOL windowNameFree; // ReactOS
LPCVOID data;
} DLG_CONTROL_INFO;
if (!(dlgInfo = GETDLGINFO(hwnd))) return FALSE;
+ TRACE(" BEGIN\n" );
while (items--)
{
template = (LPCSTR)DIALOG_GetControl32( (const WORD *)template, &info,
dlgInfo->idResult = GetWindowLongPtrA( hwndCtrl, GWLP_ID );
}
}
+ TRACE(" END\n" );
return TRUE;
}
- /***********************************************************************
- * DIALOG_FindMsgDestination
- *
- * The messages that IsDialogMessage sends may not go to the dialog
- * calling IsDialogMessage if that dialog is a child, and it has the
- * DS_CONTROL style set.
- * We propagate up until we hit one that does not have DS_CONTROL, or
- * whose parent is not a dialog.
- *
- * This is undocumented behaviour.
- */
-static HWND DIALOG_FindMsgDestination( HWND hwndDlg )
-{
- while (GetWindowLongA(hwndDlg, GWL_STYLE) & DS_CONTROL)
- {
- PWND pWnd;
- HWND hParent = GetParent(hwndDlg);
- if (!hParent) break;
-// ReactOS
- if (!IsWindow(hParent)) break;
-
- pWnd = ValidateHwnd(hParent);
- // FIXME: Use pWnd->fnid == FNID_DESKTOP
- if (!pWnd || hParent == GetDesktopWindow()) break;
-
- if (!(pWnd->state & WNDS_DIALOGWINDOW))
- {
- break;
- }
-
- hwndDlg = hParent;
- }
-
- return hwndDlg;
-}
/***********************************************************************
* DIALOG_IsAccelerator
DWORD style = GetWindowLongPtrW( hwndControl, GWL_STYLE );
if ((style & (WS_VISIBLE | WS_DISABLED)) == WS_VISIBLE)
{
- dlgCode = SendMessageA( hwndControl, WM_GETDLGCODE, 0, 0 );
+ dlgCode = SendMessageW( hwndControl, WM_GETDLGCODE, 0, 0 );
if ( (dlgCode & (DLGC_BUTTON | DLGC_STATIC)) &&
GetWindowTextW( hwndControl, buffer, sizeof(buffer)/sizeof(WCHAR) ))
{
do
{
- p = wcschr( p + 2, '&' );
+ p = strchrW( p + 2, '&' );
}
while (p != NULL && p[1] == '&');
return FALSE;
}
+ /***********************************************************************
+ * DIALOG_FindMsgDestination
+ *
+ * The messages that IsDialogMessage sends may not go to the dialog
+ * calling IsDialogMessage if that dialog is a child, and it has the
+ * DS_CONTROL style set.
+ * We propagate up until we hit one that does not have DS_CONTROL, or
+ * whose parent is not a dialog.
+ *
+ * This is undocumented behaviour.
+ */
+static HWND DIALOG_FindMsgDestination( HWND hwndDlg )
+{
+ while (GetWindowLongA(hwndDlg, GWL_STYLE) & DS_CONTROL)
+ {
+ PWND pWnd;
+ HWND hParent = GetParent(hwndDlg);
+ if (!hParent) break;
+// ReactOS
+ if (!IsWindow(hParent)) break;
+
+ pWnd = ValidateHwnd(hParent);
+ // FIXME: Use pWnd->fnid == FNID_DESKTOP
+ if (!pWnd || hParent == GetDesktopWindow()) break;
+
+ if (!(pWnd->state & WNDS_DIALOGWINDOW))
+ {
+ break;
+ }
+
+ hwndDlg = hParent;
+ }
+
+ return hwndDlg;
+}
+
/***********************************************************************
* DIALOG_DoDialogBox
*/
/* No message present -> send ENTERIDLE and wait */
SendMessageW( ownerMsg, WM_ENTERIDLE, MSGF_DIALOGBOX, (LPARAM)hwnd );
}
- if (!GetMessageW( &msg, 0, 0, 0 )) break;
+ GetMessageW( &msg, 0, 0, 0 );
}
+ if (msg.message == WM_QUIT)
+ {
+ PostQuitMessage( msg.wParam );
+ if (!IsWindow( hwnd )) return 0;
+ break;
+ }
if (!IsWindow( hwnd )) return 0;
if (!(dlgInfo->flags & DF_END) && !IsDialogMessageW( hwnd, &msg))
{
TranslateMessage( &msg );
DispatchMessageW( &msg );
}
+ if (!IsWindow( hwnd )) return 0;
if (dlgInfo->flags & DF_END) break;
if (bFirstEmpty && msg.message == WM_TIMER)
result->y = GET_WORD(p); p++;
result->cx = GET_WORD(p); p++;
result->cy = GET_WORD(p); p++;
+ TRACE("DIALOG%s %d, %d, %d, %d, %d\n",
+ result->dialogEx ? "EX" : "", result->x, result->y,
+ result->cx, result->cy, result->helpId );
+ TRACE(" STYLE 0x%08x\n", result->style );
+ TRACE(" EXSTYLE 0x%08x\n", result->exStyle );
/* Get the menu name */
case 0xffff:
result->menuName = (LPCWSTR)(UINT_PTR)GET_WORD( p + 1 );
p += 2;
+ TRACE(" MENU %04x\n", LOWORD(result->menuName) );
break;
default:
result->menuName = (LPCWSTR)p;
+ TRACE(" MENU %s\n", debugstr_w(result->menuName) );
p += strlenW( result->menuName ) + 1;
break;
}
case 0xffff:
result->className = (LPCWSTR)(UINT_PTR)GET_WORD( p + 1 );
p += 2;
+ TRACE(" CLASS %04x\n", LOWORD(result->className) );
break;
default:
result->className = (LPCWSTR)p;
+ TRACE(" CLASS %s\n", debugstr_w( result->className ));
p += strlenW( result->className ) + 1;
break;
}
result->caption = (LPCWSTR)p;
p += strlenW( result->caption ) + 1;
+ TRACE(" CAPTION %s\n", debugstr_w( result->caption ) );
/* Get the font name */
}
result->faceName = (LPCWSTR)p;
p += strlenW( result->faceName ) + 1;
+
+ TRACE(" FONT %d, %s, %d, %s\n",
+ result->pointSize, debugstr_w( result->faceName ),
+ result->weight, result->italic ? "TRUE" : "FALSE" );
}
}
if (dlgProc)
{
HWND focus = GetNextDlgTabItem( hwnd, 0, FALSE );
- if (SendMessageW( hwnd, WM_INITDIALOG, (WPARAM)focus, param ) &&
+ if (SendMessageW( hwnd, WM_INITDIALOG, (WPARAM)focus, param ) && IsWindow( hwnd ) &&
((~template.style & DS_CONTROL) || (template.style & WS_VISIBLE)))
{
/* 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);
+ dlgInfo->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE );
if( dlgInfo->hwndFocus )
SetFocus( dlgInfo->hwndFocus );
}
return retWnd ? retWnd : hwndCtrl;
}
+
/**********************************************************************
* DIALOG_DlgDirListW
*
((attrib & DDL_POSTMSGS) ? PostMessageW( hwnd, msg, wparam, lparam ) \
: SendMessageW( hwnd, msg, wparam, lparam ))
-// TRACE("%p '%s' %d %d %04x\n",
-// hDlg, spec ? spec : "NULL", idLBox, idStatic, attrib );
+ TRACE("%p %s %d %d %04x\n", hDlg, debugstr_w(spec), idLBox, idStatic, attrib );
/* If the path exists and is a directory, chdir to it */
if (!spec || !spec[0] || SetCurrentDirectoryW( spec )) spec = any;
#undef SENDMSG
}
+
/**********************************************************************
* DIALOG_DlgDirListA
*
BOOL *lpTranslated,
BOOL bSigned)
{
- char str[30];
+ char str[30];
char * endptr;
long result = 0;
}
}
+/***********************************************************************
+ * DIALOG_IdToHwnd
+ *
+ * A recursive version of GetDlgItem
+ *
+ * RETURNS
+ * The HWND for a Child ID.
+ */
+static HWND DIALOG_IdToHwnd( HWND hwndDlg, INT id )
+{
+ int i;
+ HWND *list = WIN_ListChildren( hwndDlg );
+ HWND ret = 0;
+
+ if (!list) return 0;
+
+ for (i = 0; list[i]; i++)
+ {
+ if (GetWindowLongPtrW( list[i], GWLP_ID ) == id)
+ {
+ ret = list[i];
+ break;
+ }
+
+ /* Recurse into every child */
+ if ((ret = DIALOG_IdToHwnd( list[i], id ))) break;
+ }
+
+ HeapFree( GetProcessHeap(), 0, list );
+ return ret;
+}
+
+
/*
* @implemented
*/
}
else if (DC_HASDEFID == HIWORD(dw = SendMessageW (hDlg, DM_GETDEFID, 0, 0)))
{
- HWND hwndDef = GetDlgItem(hDlg, LOWORD(dw));
+ HWND hwndDef = DIALOG_IdToHwnd(hDlg, LOWORD(dw));
if (hwndDef ? IsWindowEnabled(hwndDef) : LOWORD(dw)==IDOK)
SendMessageW( hDlg, WM_COMMAND, MAKEWPARAM( LOWORD(dw), BN_CLICKED ), (LPARAM)hwndDef);
}