Author: cwittich Date: Sun Jun 7 19:36:25 2009 New Revision: 41338
URL: http://svn.reactos.org/svn/reactos?rev=41338&view=rev Log: partial wine sync
Modified: trunk/reactos/dll/win32/user32/windows/dialog.c
Modified: trunk/reactos/dll/win32/user32/windows/dialog.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/di... ============================================================================== --- trunk/reactos/dll/win32/user32/windows/dialog.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/dialog.c [iso-8859-1] Sun Jun 7 19:36:25 2009 @@ -323,7 +323,7 @@
while (items--) { - template = (LPCSTR)DIALOG_GetControl32( (WORD *)template, &info, + template = (LPCSTR)DIALOG_GetControl32( (const WORD *)template, &info, dlgTemplate->dialogEx ); /* Is this it? */ if (info.style & WS_BORDER) @@ -842,14 +842,14 @@ return 0; }
-// dlgInfo->hwndFocus = 0; + dlgInfo->hwndFocus = 0; dlgInfo->hUserFont = hUserFont; dlgInfo->hMenu = hMenu; dlgInfo->xBaseUnit = xBaseUnit; dlgInfo->yBaseUnit = yBaseUnit; -// dlgInfo->idResult = 0; + dlgInfo->idResult = 0; dlgInfo->flags = flags; -// dlgInfo->hDialogHeap = 0; + /* dlgInfo->hDialogHeap = 0; */
if (template.helpId) SetWindowContextHelpId( hwnd, template.helpId );
@@ -864,6 +864,7 @@ if (DIALOG_CreateControls32( hwnd, dlgTemplate, &template, hInst, unicode )) { /* Send initialisation messages and set focus */ + if (dlgProc) { if (SendMessageW( hwnd, WM_INITDIALOG, (WPARAM)dlgInfo->hwndFocus, param ) && @@ -889,6 +890,7 @@ return 0; }
+ /*********************************************************************** * DEFDLG_SetFocus * @@ -909,6 +911,7 @@ SetFocus( hwndCtrl ); }
+ /*********************************************************************** * DEFDLG_SaveFocus */ @@ -922,6 +925,7 @@ infoPtr->hwndFocus = hwndFocus; /* Remove default button */ } +
/*********************************************************************** * DEFDLG_RestoreFocus @@ -946,6 +950,7 @@ sometimes losing focus when receiving WM_SETFOCUS messages. */ }
+ /*********************************************************************** * DEFDLG_FindDefButton * @@ -973,6 +978,7 @@ } return hwndChild; } +
/*********************************************************************** * DEFDLG_SetDefId @@ -1005,6 +1011,7 @@ } return TRUE; } +
/*********************************************************************** * DEFDLG_SetDefButton @@ -1042,6 +1049,7 @@ } return TRUE; } +
/*********************************************************************** * DEFDLG_Proc @@ -1084,7 +1092,7 @@ /* Window clean-up */ return DefWindowProcA( hwnd, msg, wParam, lParam );
- case WM_SHOWWINDOW: + case WM_SHOWWINDOW: if (!wParam) DEFDLG_SaveFocus( hwnd ); return DefWindowProcA( hwnd, msg, wParam, lParam );
@@ -1157,7 +1165,7 @@
// TODO: where's wine's WM_CTLCOLOR from? if ((msg >= WM_CTLCOLORMSGBOX && msg <= WM_CTLCOLORSTATIC) || - msg == WM_CTLCOLOR || msg == WM_COMPAREITEM || + msg == WM_CTLCOLOR || msg == WM_COMPAREITEM || msg == WM_VKEYTOITEM || msg == WM_CHARTOITEM || msg == WM_QUERYDRAGICON || msg == WM_INITDIALOG) return fResult; @@ -1226,7 +1234,6 @@ retWnd = DIALOG_GetNextTabItem(hwndMain,hwndMain,NULL,fPrevious ); } return retWnd ? retWnd : hwndCtrl; - }
/********************************************************************** @@ -1529,13 +1536,12 @@ WPARAM wParam, LPARAM lParam) { + DIALOGINFO *dlgInfo; WNDPROC dlgproc; BOOL result = FALSE; - DIALOGINFO * dlgInfo; - - /* if there's no dialog info property then call default windows proc?? */ - if (!(dlgInfo = DIALOG_get_info(hDlg, TRUE))) - return DefWindowProcA( hDlg, Msg, wParam, lParam ); + + /* Perform DIALOGINFO initialization if not done */ + if(!(dlgInfo = DIALOG_get_info( hDlg, TRUE ))) return -1;
SetWindowLongPtrW( hDlg, DWLP_MSGRESULT, 0 );
@@ -1590,13 +1596,12 @@ WPARAM wParam, LPARAM lParam) { + DIALOGINFO *dlgInfo; WNDPROC dlgproc; BOOL result = FALSE; - DIALOGINFO * dlgInfo; - - /* if there's no dialog info property then call default windows proc?? */ - if (!(dlgInfo = DIALOG_get_info(hDlg, TRUE))) - return DefWindowProcW( hDlg, Msg, wParam, lParam ); + + /* Perform DIALOGINFO initialization if not done */ + if(!(dlgInfo = DIALOG_get_info( hDlg, TRUE ))) return -1;
SetWindowLongPtrW( hDlg, DWLP_MSGRESULT, 0 );
@@ -1713,7 +1718,7 @@ LPCDLGTEMPLATE ptr;
if (!(hrsrc = FindResourceA( hInstance, lpTemplateName, (LPCSTR)RT_DIALOG )) || - !(ptr = (LPCDLGTEMPLATE)LoadResource(hInstance, hrsrc))) + !(ptr = LoadResource(hInstance, hrsrc))) { SetLastError(ERROR_RESOURCE_NAME_NOT_FOUND); return -1; @@ -1746,7 +1751,7 @@ LPCDLGTEMPLATE ptr;
if (!(hrsrc = FindResourceW( hInstance, lpTemplateName, (LPCWSTR)RT_DIALOG )) || - !(ptr = (LPCDLGTEMPLATE)LoadResource(hInstance, hrsrc))) + !(ptr = LoadResource(hInstance, hrsrc))) { SetLastError(ERROR_RESOURCE_NAME_NOT_FOUND); return -1;