https://git.reactos.org/?p=reactos.git;a=commitdiff;h=45ed51c1ba0bc22905040…
commit 45ed51c1ba0bc2290504008fde3c2ebcbe092792
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Fri Mar 9 12:54:34 2018 +0100
Commit: Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Fri Mar 9 12:54:34 2018 +0100
[COMDLG32] Sync with Wine Staging 3.3. CORE-14434
---
dll/win32/comdlg32/CMakeLists.txt | 4 +-
dll/win32/comdlg32/cdlg.h | 186 ++++++++++++++++++++++++++++--------
dll/win32/comdlg32/cdlg32.c | 17 ++++
dll/win32/comdlg32/colordlg.c | 12 +++
dll/win32/comdlg32/filedlg.c | 70 ++++++++++----
dll/win32/comdlg32/filedlg31.c | 19 ++++
dll/win32/comdlg32/filedlgbrowser.c | 22 +++++
dll/win32/comdlg32/filedlgbrowser.h | 11 +++
dll/win32/comdlg32/finddlg.c | 15 +++
dll/win32/comdlg32/fontdlg.c | 77 +++++++--------
dll/win32/comdlg32/itemdlg.c | 22 +----
dll/win32/comdlg32/precomp.h | 41 ++++++++
dll/win32/comdlg32/printdlg.c | 26 ++++-
dll/win32/comdlg32/resource.h | 138 --------------------------
dll/win32/comdlg32/rsrc.rc | 3 +-
media/doc/README.WINE | 2 +-
16 files changed, 404 insertions(+), 261 deletions(-)
diff --git a/dll/win32/comdlg32/CMakeLists.txt b/dll/win32/comdlg32/CMakeLists.txt
index 63c7252f88..37e1d7c102 100644
--- a/dll/win32/comdlg32/CMakeLists.txt
+++ b/dll/win32/comdlg32/CMakeLists.txt
@@ -16,7 +16,7 @@ list(APPEND SOURCE
fontdlg.c
#itemdlg.c /* Win 7 */
printdlg.c
- cdlg.h
+ precomp.h
${CMAKE_CURRENT_BINARY_DIR}/comdlg32_stubs.c)
add_library(comdlg32 SHARED
@@ -28,5 +28,5 @@ set_module_type(comdlg32 win32dll)
target_link_libraries(comdlg32 uuid wine)
add_delay_importlibs(comdlg32 ole32)
add_importlibs(comdlg32 shell32 shlwapi comctl32 winspool user32 gdi32 advapi32 msvcrt
kernel32 ntdll)
-add_pch(comdlg32 cdlg.h SOURCE)
+add_pch(comdlg32 precomp.h SOURCE)
add_cd_file(TARGET comdlg32 DESTINATION reactos/system32 FOR all)
diff --git a/dll/win32/comdlg32/cdlg.h b/dll/win32/comdlg32/cdlg.h
index 4ad1fafa59..849b9863e0 100644
--- a/dll/win32/comdlg32/cdlg.h
+++ b/dll/win32/comdlg32/cdlg.h
@@ -21,45 +21,7 @@
#ifndef _WINE_DLL_CDLG_H
#define _WINE_DLL_CDLG_H
-#include <wine/config.h>
-
-#include <stdio.h>
-
-#define WIN32_NO_STATUS
-#define _INC_WINDOWS
-#define COM_NO_WINDOWS_H
-
-#define COBJMACROS
-#define NONAMELESSUNION
-#define NONAMELESSSTRUCT
-
-#include <windef.h>
-#include <winbase.h>
-#include <wingdi.h>
-#include <winuser.h>
-#include <wincon.h>
-#include <winternl.h>
-#include <objbase.h>
-#include <commdlg.h>
-#include <shlobj.h>
-#include <dlgs.h>
-#include <cderr.h>
-
-/* RegGetValueW is supported by Win2k3 SP1 but headers need Win Vista */
-#undef _WIN32_WINNT
-#define _WIN32_WINNT 0x0600
-#include <winreg.h>
-
-#define NO_SHLWAPI_STREAM
-#include <shlwapi.h>
-
-#include <wine/unicode.h>
-
-#include <wine/debug.h>
-WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
-
-#include "filedlgbrowser.h"
-#include "resource.h"
+#include "dlgs.h"
/* Common dialogs implementation globals */
#define COMDLG32_Atom MAKEINTATOM(0xa000) /* MS uses this one to identify props */
@@ -82,6 +44,152 @@ typedef struct {
} user_fr;
} COMDLG32_FR_Data;
+#define PD32_PRINT_TITLE 7000
+
+#define PD32_VALUE_UREADABLE 1104
+#define PD32_INVALID_PAGE_RANGE 1105
+#define PD32_FROM_NOT_ABOVE_TO 1106
+#define PD32_MARGINS_OVERLAP 1107
+#define PD32_NR_OF_COPIES_EMPTY 1108
+#define PD32_TOO_LARGE_COPIES 1109
+#define PD32_PRINT_ERROR 1110
+#define PD32_NO_DEFAULT_PRINTER 1111
+#define PD32_CANT_FIND_PRINTER 1112
+#define PD32_OUT_OF_MEMORY 1113
+#define PD32_GENERIC_ERROR 1114
+#define PD32_DRIVER_UNKNOWN 1115
+#define PD32_NO_DEVICES 1121
+
+#define PD32_PRINTER_STATUS_READY 1536
+#define PD32_PRINTER_STATUS_PAUSED 1537
+#define PD32_PRINTER_STATUS_ERROR 1538
+#define PD32_PRINTER_STATUS_PENDING_DELETION 1539
+#define PD32_PRINTER_STATUS_PAPER_JAM 1540
+#define PD32_PRINTER_STATUS_PAPER_OUT 1541
+#define PD32_PRINTER_STATUS_MANUAL_FEED 1542
+#define PD32_PRINTER_STATUS_PAPER_PROBLEM 1543
+#define PD32_PRINTER_STATUS_OFFLINE 1544
+#define PD32_PRINTER_STATUS_IO_ACTIVE 1545
+#define PD32_PRINTER_STATUS_BUSY 1546
+#define PD32_PRINTER_STATUS_PRINTING 1547
+#define PD32_PRINTER_STATUS_OUTPUT_BIN_FULL 1548
+#define PD32_PRINTER_STATUS_NOT_AVAILABLE 1549
+#define PD32_PRINTER_STATUS_WAITING 1550
+#define PD32_PRINTER_STATUS_PROCESSING 1551
+#define PD32_PRINTER_STATUS_INITIALIZING 1552
+#define PD32_PRINTER_STATUS_WARMING_UP 1553
+#define PD32_PRINTER_STATUS_TONER_LOW 1554
+#define PD32_PRINTER_STATUS_NO_TONER 1555
+#define PD32_PRINTER_STATUS_PAGE_PUNT 1556
+#define PD32_PRINTER_STATUS_USER_INTERVENTION 1557
+#define PD32_PRINTER_STATUS_OUT_OF_MEMORY 1558
+#define PD32_PRINTER_STATUS_DOOR_OPEN 1559
+#define PD32_PRINTER_STATUS_SERVER_UNKNOWN 1560
+#define PD32_PRINTER_STATUS_POWER_SAVE 1561
+
+#define PD32_DEFAULT_PRINTER 1582
+#define PD32_NR_OF_DOCUMENTS_IN_QUEUE 1583
+
+#define PD32_MARGINS_IN_INCHES 1585
+#define PD32_MARGINS_IN_MILLIMETERS 1586
+#define PD32_MILLIMETERS 1587
+
+/* Charset names string IDs */
+
+#define IDS_CHARSET_ANSI 200
+#define IDS_CHARSET_SYMBOL 201
+#define IDS_CHARSET_JIS 202
+#define IDS_CHARSET_HANGUL 203
+#define IDS_CHARSET_GB2312 204
+#define IDS_CHARSET_BIG5 205
+#define IDS_CHARSET_GREEK 206
+#define IDS_CHARSET_TURKISH 207
+#define IDS_CHARSET_HEBREW 208
+#define IDS_CHARSET_ARABIC 209
+#define IDS_CHARSET_BALTIC 210
+#define IDS_CHARSET_VIETNAMESE 211
+#define IDS_CHARSET_RUSSIAN 212
+#define IDS_CHARSET_EE 213
+#define IDS_CHARSET_THAI 214
+#define IDS_CHARSET_JOHAB 215
+#define IDS_CHARSET_MAC 216
+#define IDS_CHARSET_OEM 217
+#define IDS_CHARSET_VISCII 218
+#define IDS_CHARSET_TCVN 219
+#define IDS_CHARSET_KOI8 220
+#define IDS_CHARSET_ISO3 221
+#define IDS_CHARSET_ISO4 222
+#define IDS_CHARSET_ISO10 223
+#define IDS_CHARSET_CELTIC 224
+
+/* Font styles */
+
+#define IDS_FONT_REGULAR 256
+#define IDS_FONT_BOLD 257
+#define IDS_FONT_ITALIC 258
+#define IDS_FONT_BOLD_ITALIC 259
+
+/* Color names string IDs */
+
+#define IDS_COLOR_BLACK 1040
+#define IDS_COLOR_MAROON 1041
+#define IDS_COLOR_GREEN 1042
+#define IDS_COLOR_OLIVE 1043
+#define IDS_COLOR_NAVY 1044
+#define IDS_COLOR_PURPLE 1045
+#define IDS_COLOR_TEAL 1046
+#define IDS_COLOR_GRAY 1047
+#define IDS_COLOR_SILVER 1048
+#define IDS_COLOR_RED 1049
+#define IDS_COLOR_LIME 1050
+#define IDS_COLOR_YELLOW 1051
+#define IDS_COLOR_BLUE 1052
+#define IDS_COLOR_FUCHSIA 1053
+#define IDS_COLOR_AQUA 1054
+#define IDS_COLOR_WHITE 1055
+
+/* Color dialog controls */
+#define IDC_COLOR_LUMBAR 702
+#define IDC_COLOR_EDIT_H 703
+#define IDC_COLOR_EDIT_S 704
+#define IDC_COLOR_EDIT_L 705
+#define IDC_COLOR_EDIT_R 706
+#define IDC_COLOR_EDIT_G 707
+#define IDC_COLOR_EDIT_B 708
+#define IDC_COLOR_RESULT 709
+#define IDC_COLOR_GRAPH 710
+#define IDC_COLOR_ADD 712
+#define IDC_COLOR_RES 713
+#define IDC_COLOR_DEFINE 719
+#define IDC_COLOR_PREDEF 720
+#define IDC_COLOR_USRDEF 721
+#define IDC_COLOR_HL 723
+#define IDC_COLOR_SL 724
+#define IDC_COLOR_LL 725
+#define IDC_COLOR_RL 726
+#define IDC_COLOR_GL 727
+#define IDC_COLOR_BL 728
+
+#define IDS_FONT_SIZE 1200
+#define IDS_SAVE_BUTTON 1201
+#define IDS_SAVE_IN 1202
+#define IDS_SAVE 1203
+#define IDS_SAVE_AS 1204
+#define IDS_OPEN_FILE 1205
+#define IDS_SELECT_FOLDER 1206
+#define IDS_FONT_SIZE_INPUT 1207
+
+#define IDS_FAKEDOCTEXT 1300
+
+#include "windef.h"
+#include "winbase.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "winnls.h"
+#include "commctrl.h"
+#include "shlobj.h"
+#include "shellapi.h"
+
/* Constructors */
HRESULT FileOpenDialog_Constructor(IUnknown *pUnkOuter, REFIID riid, void **ppv)
DECLSPEC_HIDDEN;
HRESULT FileSaveDialog_Constructor(IUnknown *pUnkOuter, REFIID riid, void **ppv)
DECLSPEC_HIDDEN;
diff --git a/dll/win32/comdlg32/cdlg32.c b/dll/win32/comdlg32/cdlg32.c
index 2a1a621411..daf03f0af4 100644
--- a/dll/win32/comdlg32/cdlg32.c
+++ b/dll/win32/comdlg32/cdlg32.c
@@ -19,8 +19,25 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include <stdarg.h>
+
+#define COBJMACROS
+
+#include "windef.h"
+#include "winbase.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "objbase.h"
+#include "rpcproxy.h"
+#include "commdlg.h"
+#include "cderr.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
+
#include "cdlg.h"
+
DECLSPEC_HIDDEN HINSTANCE COMDLG32_hInstance = 0;
static DWORD COMDLG32_TlsIndex = TLS_OUT_OF_INDEXES;
diff --git a/dll/win32/comdlg32/colordlg.c b/dll/win32/comdlg32/colordlg.c
index 7a01e47c82..bead9ba38c 100644
--- a/dll/win32/comdlg32/colordlg.c
+++ b/dll/win32/comdlg32/colordlg.c
@@ -23,8 +23,20 @@
sometimes, especially when 2 instances of the
dialog are loaded at the same time */
+#include <stdarg.h>
+#include <stdio.h>
+#include "windef.h"
+#include "winbase.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "commdlg.h"
+#include "dlgs.h"
+#include "wine/debug.h"
+#include "cderr.h"
#include "cdlg.h"
+WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
+
static INT_PTR CALLBACK ColorDlgProc( HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam
);
#define CONV_LPARAMTOPOINT(lp,p) do { (p)->x = (short)LOWORD(lp); (p)->y =
(short)HIWORD(lp); } while(0)
diff --git a/dll/win32/comdlg32/filedlg.c b/dll/win32/comdlg32/filedlg.c
index 457ee9b13e..41b796684c 100644
--- a/dll/win32/comdlg32/filedlg.c
+++ b/dll/win32/comdlg32/filedlg.c
@@ -45,9 +45,43 @@
*
*/
+#include "config.h"
+#include "wine/port.h"
+
+#include <ctype.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+
+#define COBJMACROS
+#define NONAMELESSUNION
+
+#include "windef.h"
+#include "winbase.h"
+#include "winternl.h"
+#include "winnls.h"
+#include "wingdi.h"
+#ifdef __REACTOS__
+/* RegGetValueW is supported by Win2k3 SP1 but headers need Win Vista */
+#undef _WIN32_WINNT
+#define _WIN32_WINNT 0x0600
+#endif
+#include "winreg.h"
+#include "winuser.h"
+#include "commdlg.h"
+#include "dlgs.h"
#include "cdlg.h"
+#include "cderr.h"
+#include "shellapi.h"
+#include "shlobj.h"
+#include "filedlgbrowser.h"
+#include "shlwapi.h"
+
+#include "wine/unicode.h"
+#include "wine/debug.h"
-#include <shellapi.h>
+WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
#define UNIMPLEMENTED_FLAGS \
(OFN_DONTADDTORECENT |\
@@ -442,6 +476,23 @@ static BOOL GetFileDialog95(FileOpenDlgInfos *info, UINT dlg_type)
ret = FALSE;
}
+ /* set the lpstrFileTitle */
+ if (ret && info->ofnInfos->lpstrFile &&
info->ofnInfos->lpstrFileTitle)
+ {
+ if (info->unicode)
+ {
+ LPOPENFILENAMEW ofn = info->ofnInfos;
+ WCHAR *file_title = PathFindFileNameW(ofn->lpstrFile);
+ lstrcpynW(ofn->lpstrFileTitle, file_title, ofn->nMaxFileTitle);
+ }
+ else
+ {
+ LPOPENFILENAMEA ofn = (LPOPENFILENAMEA)info->ofnInfos;
+ char *file_title = PathFindFileNameA(ofn->lpstrFile);
+ lstrcpynA(ofn->lpstrFileTitle, file_title, ofn->nMaxFileTitle);
+ }
+ }
+
if (current_dir)
{
SetCurrentDirectoryW(current_dir);
@@ -2660,23 +2711,6 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
fodInfos->ofnInfos->nFileExtension = (*lpszTemp) ? (lpszTemp -
tempFileA) + 1 : 0;
}
- /* set the lpstrFileTitle */
- if(fodInfos->ofnInfos->lpstrFileTitle)
- {
- LPWSTR lpstrFileTitle = PathFindFileNameW(lpstrPathAndFile);
- if(fodInfos->unicode)
- {
- LPOPENFILENAMEW ofn = fodInfos->ofnInfos;
- lstrcpynW(ofn->lpstrFileTitle, lpstrFileTitle, ofn->nMaxFileTitle);
- }
- else
- {
- LPOPENFILENAMEA ofn = (LPOPENFILENAMEA)fodInfos->ofnInfos;
- WideCharToMultiByte(CP_ACP, 0, lpstrFileTitle, -1,
- ofn->lpstrFileTitle, ofn->nMaxFileTitle, NULL, NULL);
- }
- }
-
/* copy currently selected filter to lpstrCustomFilter */
if (fodInfos->ofnInfos->lpstrCustomFilter)
{
diff --git a/dll/win32/comdlg32/filedlg31.c b/dll/win32/comdlg32/filedlg31.c
index 846982441b..0409915737 100644
--- a/dll/win32/comdlg32/filedlg31.c
+++ b/dll/win32/comdlg32/filedlg31.c
@@ -18,6 +18,25 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include <ctype.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+#include "windef.h"
+#include "winbase.h"
+#include "winnls.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "wine/unicode.h"
+#include "wine/debug.h"
+#include "winreg.h"
+#include "winternl.h"
+#include "commdlg.h"
+#include "shlwapi.h"
+#include "cderr.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
#include "cdlg.h"
diff --git a/dll/win32/comdlg32/filedlgbrowser.c b/dll/win32/comdlg32/filedlgbrowser.c
index e59f20a5fa..a225e9e590 100644
--- a/dll/win32/comdlg32/filedlgbrowser.c
+++ b/dll/win32/comdlg32/filedlgbrowser.c
@@ -19,7 +19,29 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+
+#define COBJMACROS
+#define NONAMELESSUNION
+
+#include "windef.h"
+#include "winbase.h"
+#include "winnls.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "winreg.h"
+
+#define NO_SHLWAPI_STREAM
+#include "shlwapi.h"
+#include "filedlgbrowser.h"
#include "cdlg.h"
+#include "shlguid.h"
+#include "servprov.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
typedef struct
{
diff --git a/dll/win32/comdlg32/filedlgbrowser.h b/dll/win32/comdlg32/filedlgbrowser.h
index 4ac957eb73..5cb5435b89 100644
--- a/dll/win32/comdlg32/filedlgbrowser.h
+++ b/dll/win32/comdlg32/filedlgbrowser.h
@@ -22,6 +22,17 @@
#ifndef SHBROWSER_H
#define SHBROWSER_H
+#ifndef RC_INVOKED
+#include <stdarg.h>
+#endif
+
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "shlobj.h"
+#include "objbase.h"
+#include "commdlg.h"
+
/***********************************************************************
* Defines and global variables
*/
diff --git a/dll/win32/comdlg32/finddlg.c b/dll/win32/comdlg32/finddlg.c
index a6d2ea93d6..bc4a31c605 100644
--- a/dll/win32/comdlg32/finddlg.c
+++ b/dll/win32/comdlg32/finddlg.c
@@ -19,8 +19,23 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include <stdarg.h>
+#include <string.h>
+#include "windef.h"
+#include "winbase.h"
+#include "winnls.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "commdlg.h"
+#include "cderr.h"
+#include "dlgs.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
+
#include "cdlg.h"
+
/*-----------------------------------------------------------------------*/
static UINT FindReplaceMessage;
diff --git a/dll/win32/comdlg32/fontdlg.c b/dll/win32/comdlg32/fontdlg.c
index d4c90df05b..768ca4a6ea 100644
--- a/dll/win32/comdlg32/fontdlg.c
+++ b/dll/win32/comdlg32/fontdlg.c
@@ -19,8 +19,25 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include <ctype.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+#include "windef.h"
+#include "winbase.h"
+#include "winnls.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "commdlg.h"
+#include "dlgs.h"
+#include "wine/debug.h"
+#include "wine/unicode.h"
+#include "cderr.h"
#include "cdlg.h"
+WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
+
typedef struct
{
HWND hWnd1;
@@ -466,6 +483,16 @@ static inline void CFn_ReleaseDC(const CHOOSEFONTW *lpcf, HDC hdc)
ReleaseDC(0, hdc);
}
+/*************************************************************************
+ * select_combo_item [internal]
+ */
+static void select_combo_item( HWND dialog, int id, int sel )
+{
+ HWND combo = GetDlgItem( dialog, id );
+ SendMessageW( combo, CB_SETCURSEL, sel, 0 );
+ SendMessageW( dialog, WM_COMMAND, MAKEWPARAM( id, CBN_SELCHANGE ), (LPARAM)combo );
+}
+
/***********************************************************************
* AddFontStyle [internal]
*/
@@ -526,10 +553,7 @@ static void CFn_FitFontSize( HWND hDlg, int points)
if (points == (int)SendDlgItemMessageW
(hDlg,cmb3, CB_GETITEMDATA,i,0))
{
- SendDlgItemMessageW(hDlg,cmb3,CB_SETCURSEL,i,0);
- SendMessageW(hDlg, WM_COMMAND,
- MAKEWPARAM(cmb3, CBN_SELCHANGE),
- (LPARAM)GetDlgItem(hDlg,cmb3));
+ select_combo_item( hDlg, cmb3, i );
return;
}
}
@@ -542,21 +566,17 @@ static BOOL CFn_FitFontStyle( HWND hDlg, LONG packedstyle )
{
LONG id;
int i;
- BOOL ret = FALSE;
/* look for fitting font style in combobox2 */
for (i=0;i<TEXT_EXTRAS;i++)
{
id = SendDlgItemMessageW(hDlg, cmb2, CB_GETITEMDATA, i, 0);
if (packedstyle == id)
{
- SendDlgItemMessageW(hDlg, cmb2, CB_SETCURSEL, i, 0);
- SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb2, CBN_SELCHANGE),
- (LPARAM)GetDlgItem(hDlg,cmb2));
- ret = TRUE;
- break;
+ select_combo_item( hDlg, cmb2, i );
+ return TRUE;
}
}
- return ret;
+ return FALSE;
}
@@ -570,16 +590,12 @@ static BOOL CFn_FitCharSet( HWND hDlg, int charset )
cs =SendDlgItemMessageW(hDlg, cmb5, CB_GETITEMDATA, i, 0);
if (charset == cs)
{
- SendDlgItemMessageW(hDlg, cmb5, CB_SETCURSEL, i, 0);
- SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb5, CBN_SELCHANGE),
- (LPARAM)GetDlgItem(hDlg,cmb2));
+ select_combo_item( hDlg, cmb5, i );
return TRUE;
}
}
/* no charset fits: select the first one in the list */
- SendDlgItemMessageW(hDlg, cmb5, CB_SETCURSEL, 0, 0);
- SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb5, CBN_SELCHANGE),
- (LPARAM)GetDlgItem(hDlg,cmb2));
+ select_combo_item( hDlg, cmb5, 0 );
return FALSE;
}
@@ -712,9 +728,7 @@ static LRESULT CFn_WMInitDialog(HWND hDlg, LPARAM lParam,
LPCHOOSEFONTW lpcf)
points = MulDiv( height, 72, GetScreenDPI());
pstyle = MAKELONG(lpxx->lfWeight > FW_MEDIUM ? FW_BOLD:
FW_NORMAL,lpxx->lfItalic !=0);
- SendDlgItemMessageW(hDlg, cmb1, CB_SETCURSEL, j, 0);
- SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb1, CBN_SELCHANGE),
- (LPARAM)GetDlgItem(hDlg,cmb1));
+ select_combo_item( hDlg, cmb1, j );
init = TRUE;
/* look for fitting font style in combobox2 */
CFn_FitFontStyle(hDlg, pstyle);
@@ -725,18 +739,10 @@ static LRESULT CFn_WMInitDialog(HWND hDlg, LPARAM lParam,
LPCHOOSEFONTW lpcf)
}
if (!init)
{
- SendDlgItemMessageW(hDlg,cmb1,CB_SETCURSEL,0,0);
- SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb1, CBN_SELCHANGE),
- (LPARAM)GetDlgItem(hDlg,cmb1));
- SendDlgItemMessageW(hDlg,cmb2,CB_SETCURSEL,0,0);
- SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb2, CBN_SELCHANGE),
- (LPARAM)GetDlgItem(hDlg,cmb1));
- SendDlgItemMessageW(hDlg,cmb3,CB_SETCURSEL,0,0);
- SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb3, CBN_SELCHANGE),
- (LPARAM)GetDlgItem(hDlg,cmb3));
- SendDlgItemMessageW(hDlg,cmb5,CB_SETCURSEL,0,0);
- SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb5, CBN_SELCHANGE),
- (LPARAM)GetDlgItem(hDlg,cmb5));
+ select_combo_item( hDlg, cmb1, 0 );
+ select_combo_item( hDlg, cmb2, 0 );
+ select_combo_item( hDlg, cmb3, 0 );
+ select_combo_item( hDlg, cmb5, 0 );
}
/* limit text length user can type in as font size */
SendDlgItemMessageW(hDlg, cmb3, CB_LIMITTEXT, 5, 0);
@@ -744,12 +750,7 @@ static LRESULT CFn_WMInitDialog(HWND hDlg, LPARAM lParam,
LPCHOOSEFONTW lpcf)
if ((lpcf->Flags & CF_USESTYLE) && lpcf->lpszStyle)
{
j=SendDlgItemMessageW(hDlg,cmb2,CB_FINDSTRING,-1,(LPARAM)lpcf->lpszStyle);
- if (j!=CB_ERR)
- {
- j=SendDlgItemMessageW(hDlg,cmb2,CB_SETCURSEL,j,0);
- SendMessageW(hDlg,WM_COMMAND,cmb2,
- MAKELONG(LOWORD(GetDlgItem(hDlg,cmb2)),CBN_SELCHANGE));
- }
+ if (j!=CB_ERR) select_combo_item( hDlg, cmb2, j );
}
CFn_ReleaseDC(lpcf, hdc);
SetCursor(hcursor);
diff --git a/dll/win32/comdlg32/itemdlg.c b/dll/win32/comdlg32/itemdlg.c
index 6b5f5db6ef..2b7a6fe6e9 100644
--- a/dll/win32/comdlg32/itemdlg.c
+++ b/dll/win32/comdlg32/itemdlg.c
@@ -4599,7 +4599,7 @@ static HRESULT FileDialog_constructor(IUnknown *pUnkOuter, REFIID
riid, void **p
if(pUnkOuter)
return CLASS_E_NOAGGREGATION;
- fdimpl = HeapAlloc(GetProcessHeap(), 0, sizeof(FileDialogImpl));
+ fdimpl = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(FileDialogImpl));
if(!fdimpl)
return E_OUTOFMEMORY;
@@ -4630,27 +4630,7 @@ static HRESULT FileDialog_constructor(IUnknown *pUnkOuter, REFIID
riid, void **p
fdimpl->custom_okbutton = StrDupW(buf);
}
- fdimpl->filterspecs = NULL;
- fdimpl->filterspec_count = 0;
- fdimpl->filetypeindex = 0;
-
- fdimpl->psia_selection = fdimpl->psia_results = NULL;
- fdimpl->psi_setfolder = fdimpl->psi_folder = NULL;
-
list_init(&fdimpl->events_clients);
- fdimpl->events_next_cookie = 0;
-
- fdimpl->dlg_hwnd = NULL;
- fdimpl->peb = NULL;
-
- fdimpl->set_filename = NULL;
- fdimpl->default_ext = NULL;
- fdimpl->custom_cancelbutton = fdimpl->custom_filenamelabel = NULL;
-
- fdimpl->client_guid = GUID_NULL;
-
- fdimpl->hmenu_opendropdown = NULL;
- fdimpl->hfont_opendropdown = NULL;
/* FIXME: The default folder setting should be restored for the
* application if it was previously set. */
diff --git a/dll/win32/comdlg32/precomp.h b/dll/win32/comdlg32/precomp.h
new file mode 100644
index 0000000000..0f5a9349d9
--- /dev/null
+++ b/dll/win32/comdlg32/precomp.h
@@ -0,0 +1,41 @@
+
+#ifndef _WINE_COMDLG32_PRECOMP_H
+#define _WINE_COMDLG32_PRECOMP_H
+
+#include <wine/config.h>
+
+#include <stdio.h>
+
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+#define COM_NO_WINDOWS_H
+
+#define COBJMACROS
+#define NONAMELESSUNION
+#define NONAMELESSSTRUCT
+
+#include <windef.h>
+#include <winbase.h>
+#include <wingdi.h>
+#include <winuser.h>
+#include <wincon.h>
+#include <winternl.h>
+#include <objbase.h>
+#include <commdlg.h>
+#include <shlobj.h>
+#include <dlgs.h>
+#include <cderr.h>
+/* RegGetValueW is supported by Win2k3 SP1 but headers need Win Vista */
+#undef _WIN32_WINNT
+#define _WIN32_WINNT 0x0600
+#include <winreg.h>
+#define NO_SHLWAPI_STREAM
+#include <shlwapi.h>
+
+#include <wine/unicode.h>
+#include <wine/debug.h>
+
+#include "cdlg.h"
+#include "filedlgbrowser.h"
+
+#endif /* !_WINE_COMDLG32_PRECOMP_H */
diff --git a/dll/win32/comdlg32/printdlg.c b/dll/win32/comdlg32/printdlg.c
index b043231fb9..83335a9503 100644
--- a/dll/win32/comdlg32/printdlg.c
+++ b/dll/win32/comdlg32/printdlg.c
@@ -21,11 +21,33 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include <ctype.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#define COBJMACROS
+#define NONAMELESSUNION
+#define NONAMELESSSTRUCT
+#include "windef.h"
+#include "winbase.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "winspool.h"
+#include "winerror.h"
+#include "objbase.h"
+#include "commdlg.h"
+
+#include "wine/unicode.h"
+#include "wine/debug.h"
+
+#include "dlgs.h"
+#include "cderr.h"
#include "cdlg.h"
-#include <assert.h>
-#include <winspool.h>
+WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
/* Yes these constants are the same, but we're just copying win98 */
#define UPDOWN_ID 0x270f
diff --git a/dll/win32/comdlg32/resource.h b/dll/win32/comdlg32/resource.h
deleted file mode 100644
index bfb798baca..0000000000
--- a/dll/win32/comdlg32/resource.h
+++ /dev/null
@@ -1,138 +0,0 @@
-#pragma once
-
-#define PD32_PRINT_TITLE 7000
-
-#define PD32_VALUE_UREADABLE 1104
-#define PD32_INVALID_PAGE_RANGE 1105
-#define PD32_FROM_NOT_ABOVE_TO 1106
-#define PD32_MARGINS_OVERLAP 1107
-#define PD32_NR_OF_COPIES_EMPTY 1108
-#define PD32_TOO_LARGE_COPIES 1109
-#define PD32_PRINT_ERROR 1110
-#define PD32_NO_DEFAULT_PRINTER 1111
-#define PD32_CANT_FIND_PRINTER 1112
-#define PD32_OUT_OF_MEMORY 1113
-#define PD32_GENERIC_ERROR 1114
-#define PD32_DRIVER_UNKNOWN 1115
-#define PD32_NO_DEVICES 1121
-
-#define PD32_PRINTER_STATUS_READY 1536
-#define PD32_PRINTER_STATUS_PAUSED 1537
-#define PD32_PRINTER_STATUS_ERROR 1538
-#define PD32_PRINTER_STATUS_PENDING_DELETION 1539
-#define PD32_PRINTER_STATUS_PAPER_JAM 1540
-#define PD32_PRINTER_STATUS_PAPER_OUT 1541
-#define PD32_PRINTER_STATUS_MANUAL_FEED 1542
-#define PD32_PRINTER_STATUS_PAPER_PROBLEM 1543
-#define PD32_PRINTER_STATUS_OFFLINE 1544
-#define PD32_PRINTER_STATUS_IO_ACTIVE 1545
-#define PD32_PRINTER_STATUS_BUSY 1546
-#define PD32_PRINTER_STATUS_PRINTING 1547
-#define PD32_PRINTER_STATUS_OUTPUT_BIN_FULL 1548
-#define PD32_PRINTER_STATUS_NOT_AVAILABLE 1549
-#define PD32_PRINTER_STATUS_WAITING 1550
-#define PD32_PRINTER_STATUS_PROCESSING 1551
-#define PD32_PRINTER_STATUS_INITIALIZING 1552
-#define PD32_PRINTER_STATUS_WARMING_UP 1553
-#define PD32_PRINTER_STATUS_TONER_LOW 1554
-#define PD32_PRINTER_STATUS_NO_TONER 1555
-#define PD32_PRINTER_STATUS_PAGE_PUNT 1556
-#define PD32_PRINTER_STATUS_USER_INTERVENTION 1557
-#define PD32_PRINTER_STATUS_OUT_OF_MEMORY 1558
-#define PD32_PRINTER_STATUS_DOOR_OPEN 1559
-#define PD32_PRINTER_STATUS_SERVER_UNKNOWN 1560
-#define PD32_PRINTER_STATUS_POWER_SAVE 1561
-
-#define PD32_DEFAULT_PRINTER 1582
-#define PD32_NR_OF_DOCUMENTS_IN_QUEUE 1583
-
-#define PD32_MARGINS_IN_INCHES 1585
-#define PD32_MARGINS_IN_MILLIMETERS 1586
-#define PD32_MILLIMETERS 1587
-
-/* Charset names string IDs */
-
-#define IDS_CHARSET_ANSI 200
-#define IDS_CHARSET_SYMBOL 201
-#define IDS_CHARSET_JIS 202
-#define IDS_CHARSET_HANGUL 203
-#define IDS_CHARSET_GB2312 204
-#define IDS_CHARSET_BIG5 205
-#define IDS_CHARSET_GREEK 206
-#define IDS_CHARSET_TURKISH 207
-#define IDS_CHARSET_HEBREW 208
-#define IDS_CHARSET_ARABIC 209
-#define IDS_CHARSET_BALTIC 210
-#define IDS_CHARSET_VIETNAMESE 211
-#define IDS_CHARSET_RUSSIAN 212
-#define IDS_CHARSET_EE 213
-#define IDS_CHARSET_THAI 214
-#define IDS_CHARSET_JOHAB 215
-#define IDS_CHARSET_MAC 216
-#define IDS_CHARSET_OEM 217
-#define IDS_CHARSET_VISCII 218
-#define IDS_CHARSET_TCVN 219
-#define IDS_CHARSET_KOI8 220
-#define IDS_CHARSET_ISO3 221
-#define IDS_CHARSET_ISO4 222
-#define IDS_CHARSET_ISO10 223
-#define IDS_CHARSET_CELTIC 224
-
-/* Font styles */
-
-#define IDS_FONT_REGULAR 256
-#define IDS_FONT_BOLD 257
-#define IDS_FONT_ITALIC 258
-#define IDS_FONT_BOLD_ITALIC 259
-
-/* Color names string IDs */
-
-#define IDS_COLOR_BLACK 1040
-#define IDS_COLOR_MAROON 1041
-#define IDS_COLOR_GREEN 1042
-#define IDS_COLOR_OLIVE 1043
-#define IDS_COLOR_NAVY 1044
-#define IDS_COLOR_PURPLE 1045
-#define IDS_COLOR_TEAL 1046
-#define IDS_COLOR_GRAY 1047
-#define IDS_COLOR_SILVER 1048
-#define IDS_COLOR_RED 1049
-#define IDS_COLOR_LIME 1050
-#define IDS_COLOR_YELLOW 1051
-#define IDS_COLOR_BLUE 1052
-#define IDS_COLOR_FUCHSIA 1053
-#define IDS_COLOR_AQUA 1054
-#define IDS_COLOR_WHITE 1055
-
-/* Color dialog controls */
-#define IDC_COLOR_LUMBAR 702
-#define IDC_COLOR_EDIT_H 703
-#define IDC_COLOR_EDIT_S 704
-#define IDC_COLOR_EDIT_L 705
-#define IDC_COLOR_EDIT_R 706
-#define IDC_COLOR_EDIT_G 707
-#define IDC_COLOR_EDIT_B 708
-#define IDC_COLOR_RESULT 709
-#define IDC_COLOR_GRAPH 710
-#define IDC_COLOR_ADD 712
-#define IDC_COLOR_RES 713
-#define IDC_COLOR_DEFINE 719
-#define IDC_COLOR_PREDEF 720
-#define IDC_COLOR_USRDEF 721
-#define IDC_COLOR_HL 723
-#define IDC_COLOR_SL 724
-#define IDC_COLOR_LL 725
-#define IDC_COLOR_RL 726
-#define IDC_COLOR_GL 727
-#define IDC_COLOR_BL 728
-
-#define IDS_FONT_SIZE 1200
-#define IDS_SAVE_BUTTON 1201
-#define IDS_SAVE_IN 1202
-#define IDS_SAVE 1203
-#define IDS_SAVE_AS 1204
-#define IDS_OPEN_FILE 1205
-#define IDS_SELECT_FOLDER 1206
-#define IDS_FONT_SIZE_INPUT 1207
-
-#define IDS_FAKEDOCTEXT 1300
diff --git a/dll/win32/comdlg32/rsrc.rc b/dll/win32/comdlg32/rsrc.rc
index 70a189c3da..3d83d96c4d 100644
--- a/dll/win32/comdlg32/rsrc.rc
+++ b/dll/win32/comdlg32/rsrc.rc
@@ -20,10 +20,9 @@
#include <windef.h>
#include <winuser.h>
-#include <dlgs.h>
+#include "cdlg.h"
#include "filedlgbrowser.h"
-#include "resource.h"
/*
* Everything that does not depend on language,
diff --git a/media/doc/README.WINE b/media/doc/README.WINE
index 1386ed960a..92cdfd8fd4 100644
--- a/media/doc/README.WINE
+++ b/media/doc/README.WINE
@@ -55,7 +55,7 @@ reactos/dll/win32/cabinet # Synced to WineStaging-3.3
reactos/dll/win32/clusapi # Synced to WineStaging-3.3
reactos/dll/win32/comcat # Synced to WineStaging-3.3
reactos/dll/win32/comctl32 # Synced to Wine-3.0
-reactos/dll/win32/comdlg32 # Synced to Wine-3.0
+reactos/dll/win32/comdlg32 # Synced to WineStaging-3.3
reactos/dll/win32/compstui # Synced to WineStaging-2.9
reactos/dll/win32/credui # Synced to WineStaging-2.9
reactos/dll/win32/crypt32 # Synced to WineStaging-2.16