Fixes for Open common dialog box
mehmet yasar
myasar at free.fr
Sat Apr 13 09:34:46 CDT 2002
Hi all,
This patch is fixing various issues with Open common dialog box :
1. Some program (as PowerPoint Viewer 97 and IrfanView 3.25) are giving
a template with caption (template used by GetOpenFileName), that
caused some control to be outside of dialog.
So like Windows, we are erasing WS_CAPTION style.
2. As MSDN doc says we are sending now CDN_FILEOK before FILEOKSTRING
This fixes bug with PaintShopPro 4.12 (trying opening inexistent
file).
3. Fix bug related to DWL_MSGRESUL (we were reading from wrong hwnd).
Verified with MSDN sample Comdlg2.
Mehmet YASAR
-------------- next part --------------
diff -u CVS/wine/dlls/commdlg/filedlg95.c wine/notes/filedlg95.c
--- CVS/wine/dlls/commdlg/filedlg95.c Wed Mar 27 17:48:25 2002
+++ wine/notes/filedlg95.c Tue Apr 9 13:24:13 2002
@@ -844,6 +844,11 @@
{
case WM_INITDIALOG:
{
+ /* Hide caption since some program may leave it */
+ DWORD Style = GetWindowLongA(hwnd, GWL_STYLE);
+ if (Style & WS_CAPTION)
+ SetWindowLongA(hwnd, GWL_STYLE, Style & (~WS_CAPTION));
+
FileOpenDlgInfos * fodInfos = (FileOpenDlgInfos *)lParam;
/* Adds the FileOpenDlgInfos in the property list of the dialog
@@ -1113,13 +1118,12 @@
{
/* OK button */
case IDOK:
- if(FILEDLG95_OnOpen(hwnd))
- SendCustomDlgNotificationMessage(hwnd,CDN_FILEOK);
+ FILEDLG95_OnOpen(hwnd);
break;
/* Cancel button */
case IDCANCEL:
- FILEDLG95_Clean(hwnd);
- EndDialog(hwnd, FALSE);
+ FILEDLG95_Clean(hwnd);
+ EndDialog(hwnd, FALSE);
break;
/* Filetype combo box */
case IDC_FILETYPE:
@@ -1572,15 +1576,17 @@
/* ask the hook if we can close */
if(IsHooked(fodInfos))
{
- /* FIXME we are sending ASCII-structures. Does not work with NT */
- /* first old style */
TRACE("---\n");
+ /* First send CDN_FILEOK as MSDN doc says */
+ SendCustomDlgNotificationMessage(hwnd,CDN_FILEOK);
+
+ /* FIXME we are sending ASCII-structures. Does not work with NT */
CallWindowProcA((WNDPROC)fodInfos->ofnInfos->lpfnHook,
fodInfos->DlgInfos.hwndCustomDlg,
fodInfos->HookMsg.fileokstring, 0, (LPARAM)fodInfos->ofnInfos);
- if (GetWindowLongA(hwnd, DWL_MSGRESULT))
+ if (GetWindowLongA(fodInfos->DlgInfos.hwndCustomDlg, DWL_MSGRESULT))
{
- TRACE("cancled\n");
+ TRACE("canceled\n");
ret = FALSE;
goto ret;
}
More information about the wine-patches
mailing list