[COMDLG32]

* Sync with Wine 1.7.17.
CORE-8080

svn path=/trunk/; revision=62881
This commit is contained in:
Amine Khaldi 2014-04-22 14:40:19 +00:00
parent 03535e5b35
commit 54e6209bc1
8 changed files with 130 additions and 133 deletions

View file

@ -244,9 +244,9 @@ static void CC_DrawFocusRect(CCPRIV *lpp, HWND hwnd, int x, int y, int rows, int
/*********************************************************************** /***********************************************************************
* CC_MouseCheckPredefColorArray [internal] * CC_MouseCheckPredefColorArray [internal]
* returns 1 if one of the predefined colors is clicked * returns TRUE if one of the predefined colors is clicked
*/ */
static int CC_MouseCheckPredefColorArray(CCPRIV *lpp, int rows, int cols, LPARAM lParam) static BOOL CC_MouseCheckPredefColorArray(CCPRIV *lpp, int rows, int cols, LPARAM lParam)
{ {
HWND hwnd; HWND hwnd;
POINT point; POINT point;
@ -269,17 +269,17 @@ static int CC_MouseCheckPredefColorArray(CCPRIV *lpp, int rows, int cols, LPARAM
y = point.y / dy; y = point.y / dy;
lpp->lpcc->rgbResult = predefcolors[y][x]; lpp->lpcc->rgbResult = predefcolors[y][x];
CC_DrawFocusRect(lpp, hwnd, x, y, rows, cols); CC_DrawFocusRect(lpp, hwnd, x, y, rows, cols);
return 1; return TRUE;
} }
} }
return 0; return FALSE;
} }
/*********************************************************************** /***********************************************************************
* CC_MouseCheckUserColorArray [internal] * CC_MouseCheckUserColorArray [internal]
* return 1 if the user clicked a color * return TRUE if the user clicked a color
*/ */
static int CC_MouseCheckUserColorArray(CCPRIV *lpp, int rows, int cols, LPARAM lParam) static BOOL CC_MouseCheckUserColorArray(CCPRIV *lpp, int rows, int cols, LPARAM lParam)
{ {
HWND hwnd; HWND hwnd;
POINT point; POINT point;
@ -303,10 +303,10 @@ static int CC_MouseCheckUserColorArray(CCPRIV *lpp, int rows, int cols, LPARAM l
y = point.y / dy; y = point.y / dy;
lpp->lpcc->rgbResult = crarr[x + (cols * y) ]; lpp->lpcc->rgbResult = crarr[x + (cols * y) ];
CC_DrawFocusRect(lpp, hwnd, x, y, rows, cols); CC_DrawFocusRect(lpp, hwnd, x, y, rows, cols);
return 1; return TRUE;
} }
} }
return 0; return FALSE;
} }
#define MAXVERT 240 #define MAXVERT 240
@ -322,7 +322,7 @@ static int CC_MouseCheckUserColorArray(CCPRIV *lpp, int rows, int cols, LPARAM l
/*********************************************************************** /***********************************************************************
* CC_MouseCheckColorGraph [internal] * CC_MouseCheckColorGraph [internal]
*/ */
static int CC_MouseCheckColorGraph( HWND hDlg, int dlgitem, int *hori, int *vert, LPARAM lParam ) static BOOL CC_MouseCheckColorGraph( HWND hDlg, int dlgitem, int *hori, int *vert, LPARAM lParam )
{ {
HWND hwnd; HWND hwnd;
POINT point; POINT point;
@ -335,7 +335,7 @@ static int CC_MouseCheckColorGraph( HWND hDlg, int dlgitem, int *hori, int *vert
GetWindowRect(hwnd, &rect); GetWindowRect(hwnd, &rect);
if (!PtInRect(&rect, point)) if (!PtInRect(&rect, point))
return 0; return FALSE;
GetClientRect(hwnd, &rect); GetClientRect(hwnd, &rect);
ScreenToClient(hwnd, &point); ScreenToClient(hwnd, &point);
@ -355,13 +355,13 @@ static int CC_MouseCheckColorGraph( HWND hDlg, int dlgitem, int *hori, int *vert
if (vert) if (vert)
*vert = y; *vert = y;
return 1; return TRUE;
} }
/*********************************************************************** /***********************************************************************
* CC_MouseCheckResultWindow [internal] * CC_MouseCheckResultWindow [internal]
* test if double click one of the result colors * test if double click one of the result colors
*/ */
static int CC_MouseCheckResultWindow( HWND hDlg, LPARAM lParam ) static BOOL CC_MouseCheckResultWindow( HWND hDlg, LPARAM lParam )
{ {
HWND hwnd; HWND hwnd;
POINT point; POINT point;
@ -374,9 +374,9 @@ static int CC_MouseCheckResultWindow( HWND hDlg, LPARAM lParam )
if (PtInRect(&rect, point)) if (PtInRect(&rect, point))
{ {
PostMessageA(hDlg, WM_COMMAND, IDC_COLOR_RES, 0); PostMessageA(hDlg, WM_COMMAND, IDC_COLOR_RES, 0);
return 1; return TRUE;
} }
return 0; return FALSE;
} }
/*********************************************************************** /***********************************************************************

View file

@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#pragma makedep register
[ [
helpstring("File Open Dialog"), helpstring("File Open Dialog"),
threading(apartment), threading(apartment),

View file

@ -1,71 +1,66 @@
Index: filedlg.c diff -prudN e:\Wine\dlls\comdlg32/cdlg32.c e:\reactos\dll\win32\comdlg32/cdlg32.c
=================================================================== --- e:\Wine\dlls\comdlg32/cdlg32.c 2013-10-26 22:24:27.508648000 +0100
--- filedlg.c (Revision 56893) +++ e:\reactos\dll\win32\comdlg32/cdlg32.c 2014-03-05 11:46:06.260510700 +0100
+++ filedlg.c (Arbeitskopie) @@ -174,6 +157,8 @@ DWORD WINAPI CommDlgExtendedError(void)
@@ -260,6 +260,8 @@ return 0; /* we never set an error, so there isn't one */
HRSRC hRes; }
HANDLE hDlgTmpl = 0;
HRESULT hr; +#ifndef __REACTOS__ /* Win 7 */
+ DWORD dwSize; +
+ LPDLGTEMPLATE hDialogTemplate; /*************************************************************************
* Implement the CommDlg32 class factory
/* test for missing functionality */ *
if (fodInfos->ofnInfos->Flags & UNIMPLEMENTED_FLAGS) @@ -283,7 +268,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSI
@@ -276,12 +278,17 @@ */
return FALSE; HRESULT WINAPI DllRegisterServer(void)
} {
if (!(hDlgTmpl = LoadResource(COMDLG32_hInstance, hRes )) || - return __wine_register_resources(COMDLG32_hInstance);
+ !(dwSize = SizeofResource(COMDLG32_hInstance, hRes )) || + return E_FAIL; // FIXME: __wine_register_resources(COMDLG32_hInstance);
+ !(hDialogTemplate = malloc(dwSize)) || }
!(template = LockResource( hDlgTmpl )))
{ /***********************************************************************
COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE); @@ -291,5 +276,7 @@ HRESULT WINAPI DllRegisterServer(void)
return FALSE; */
} HRESULT WINAPI DllUnregisterServer(void)
{
+ /* Copy the read only resource */ - return __wine_unregister_resources(COMDLG32_hInstance);
+ memcpy(hDialogTemplate, template, dwSize); + return E_FAIL; // FIXME: __wine_unregister_resources(COMDLG32_hInstance);
+ }
/* msdn: explorer style dialogs permit sizing by default. +
* The OFN_ENABLESIZING flag is only needed when a hook or +#endif /* Win 7 */
* custom tmeplate is provided */
@@ -291,12 +298,12 @@ diff -prudN e:\Wine\dlls\comdlg32/comdlg32.spec e:\reactos\dll\win32\comdlg32/comdlg32.spec
--- e:\Wine\dlls\comdlg32/comdlg32.spec 2011-09-16 23:22:36.026770600 +0100
if (fodInfos->ofnInfos->Flags & OFN_ENABLESIZING) +++ e:\reactos\dll\win32\comdlg32/comdlg32.spec 2012-02-15 22:32:22.456422900 +0100
{ @@ -3,9 +3,9 @@
- ((LPDLGTEMPLATEW)template)->style |= WS_SIZEBOX; @ stdcall ChooseFontA(ptr)
+ hDialogTemplate->style |= WS_SIZEBOX; @ stdcall ChooseFontW(ptr)
fodInfos->sizedlg.cx = fodInfos->sizedlg.cy = 0; @ stdcall CommDlgExtendedError()
fodInfos->initial_size.x = fodInfos->initial_size.y = 0; -@ stdcall -private DllGetClassObject(ptr ptr ptr)
} -@ stdcall -private DllRegisterServer()
else -@ stdcall -private DllUnregisterServer()
- ((LPDLGTEMPLATEW)template)->style &= ~WS_SIZEBOX; +;@ stdcall -private DllGetClassObject(ptr ptr ptr) ; Win 7
+ hDialogTemplate->style &= ~WS_SIZEBOX; +;@ stdcall -private DllRegisterServer() ; Win 7
+;@ stdcall -private DllUnregisterServer() ; Win 7
@ stdcall FindTextA(ptr)
/* old style hook messages */ @ stdcall FindTextW(ptr)
@@ -313,19 +320,21 @@ @ stdcall GetFileTitleA(str ptr long)
if (fodInfos->unicode) diff -prudN e:\Wine\dlls\comdlg32/itemdlg.c e:\reactos\dll\win32\comdlg32/itemdlg.c
lRes = DialogBoxIndirectParamW(COMDLG32_hInstance, --- e:\Wine\dlls\comdlg32/itemdlg.c 2013-10-26 22:24:27.515652700 +0100
- template, +++ e:\reactos\dll\win32\comdlg32/itemdlg.c 2013-10-15 19:32:27.803008200 +0100
+ hDialogTemplate, @@ -18,6 +18,8 @@
fodInfos->ofnInfos->hwndOwner, * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
FileOpenDlgProc95, */
(LPARAM) fodInfos);
else +#ifndef __REACTOS__ /* Win 7 */
lRes = DialogBoxIndirectParamA(COMDLG32_hInstance, +
- template, #include <stdarg.h>
+ hDialogTemplate,
fodInfos->ofnInfos->hwndOwner, #define COBJMACROS
FileOpenDlgProc95, @@ -3660,3 +3662,5 @@ HRESULT FileSaveDialog_Constructor(IUnkn
(LPARAM) fodInfos); {
- if (SUCCEEDED(hr)) return FileDialog_constructor(pUnkOuter, riid, ppv, ITEMDLG_TYPE_SAVE);
+ if (SUCCEEDED(hr)) }
OleUninitialize(); +
+#endif /* Win 7 */
+ free(hDialogTemplate);
+
/* Unable to create the dialog */
if( lRes == -1)
return FALSE;

View file

@ -431,7 +431,7 @@ static BOOL GetFileDialog95A(LPOPENFILENAMEA ofn,UINT iDlgType)
ret = GetFileName95(&fodInfos); ret = GetFileName95(&fodInfos);
break; break;
default : default :
ret = 0; ret = FALSE;
} }
if (lpstrSavDir) if (lpstrSavDir)
@ -523,7 +523,7 @@ static BOOL GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType)
ret = GetFileName95(&fodInfos); ret = GetFileName95(&fodInfos);
break; break;
default : default :
ret = 0; ret = FALSE;
} }
if (lpstrSavDir) if (lpstrSavDir)
@ -1401,9 +1401,9 @@ static inline BOOL filename_is_edit( const FileOpenDlgInfos *info )
*/ */
static LRESULT FILEDLG95_InitControls(HWND hwnd) static LRESULT FILEDLG95_InitControls(HWND hwnd)
{ {
int win2000plus = 0; BOOL win2000plus = FALSE;
int win98plus = 0; BOOL win98plus = FALSE;
int handledPath = FALSE; BOOL handledPath = FALSE;
OSVERSIONINFOW osVi; OSVERSIONINFOW osVi;
static const WCHAR szwSlash[] = { '\\', 0 }; static const WCHAR szwSlash[] = { '\\', 0 };
static const WCHAR szwStar[] = { '*',0 }; static const WCHAR szwStar[] = { '*',0 };
@ -1554,12 +1554,11 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd)
} }
/* 2. (All platforms) If initdir is not null, then use it */ /* 2. (All platforms) If initdir is not null, then use it */
if ((handledPath == FALSE) && (fodInfos->initdir!=NULL) && if (!handledPath && fodInfos->initdir && *fodInfos->initdir)
(*fodInfos->initdir!=0x00))
{ {
/* Work out the proper path as supplied one might be relative */ /* Work out the proper path as supplied one might be relative */
/* (Here because supplying '.' as dir browses to My Computer) */ /* (Here because supplying '.' as dir browses to My Computer) */
if (handledPath==FALSE) { if (!handledPath) {
WCHAR tmpBuf[MAX_PATH]; WCHAR tmpBuf[MAX_PATH];
WCHAR tmpBuf2[MAX_PATH]; WCHAR tmpBuf2[MAX_PATH];
WCHAR *nameBit; WCHAR *nameBit;
@ -1594,8 +1593,7 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd)
} }
} }
if ((handledPath == FALSE) && ((fodInfos->initdir==NULL) || if (!handledPath && (!fodInfos->initdir || !*fodInfos->initdir))
(*fodInfos->initdir==0x00)))
{ {
/* 3. All except w2k+: if filename contains a path use it */ /* 3. All except w2k+: if filename contains a path use it */
if (!win2000plus && fodInfos->filename && if (!win2000plus && fodInfos->filename &&
@ -1627,7 +1625,7 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd)
} }
/* 4. Win2000+: Recently used */ /* 4. Win2000+: Recently used */
if (handledPath == FALSE && win2000plus) { if (!handledPath && win2000plus) {
fodInfos->initdir = MemAlloc(MAX_PATH * sizeof(WCHAR)); fodInfos->initdir = MemAlloc(MAX_PATH * sizeof(WCHAR));
fodInfos->initdir[0] = '\0'; fodInfos->initdir[0] = '\0';
@ -1643,8 +1641,7 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd)
/* 5. win98+ and win2000+ if any files of specified filter types in /* 5. win98+ and win2000+ if any files of specified filter types in
current directory, use it */ current directory, use it */
if ( win98plus && handledPath == FALSE && if (win98plus && !handledPath && fodInfos->filter && *fodInfos->filter) {
fodInfos->filter && *fodInfos->filter) {
LPCWSTR lpstrPos = fodInfos->filter; LPCWSTR lpstrPos = fodInfos->filter;
WIN32_FIND_DATAW FindFileData; WIN32_FIND_DATAW FindFileData;
@ -1683,7 +1680,7 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd)
} }
/* 6. Win98+ and 2000+: Use personal files dir, others use current dir */ /* 6. Win98+ and 2000+: Use personal files dir, others use current dir */
if (handledPath == FALSE && (win2000plus || win98plus)) { if (!handledPath && (win2000plus || win98plus)) {
fodInfos->initdir = MemAlloc(MAX_PATH*sizeof(WCHAR)); fodInfos->initdir = MemAlloc(MAX_PATH*sizeof(WCHAR));
if(!COMDLG32_SHGetFolderPathW(hwnd, CSIDL_PERSONAL, 0, 0, fodInfos->initdir)) if(!COMDLG32_SHGetFolderPathW(hwnd, CSIDL_PERSONAL, 0, 0, fodInfos->initdir))
@ -1700,7 +1697,7 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd)
TRACE("No initial dir specified, using personal files dir of %s\n", debugstr_w(fodInfos->initdir)); TRACE("No initial dir specified, using personal files dir of %s\n", debugstr_w(fodInfos->initdir));
} }
handledPath = TRUE; handledPath = TRUE;
} else if (handledPath==FALSE) { } else if (!handledPath) {
fodInfos->initdir = MemAlloc(MAX_PATH*sizeof(WCHAR)); fodInfos->initdir = MemAlloc(MAX_PATH*sizeof(WCHAR));
GetCurrentDirectoryW(MAX_PATH, fodInfos->initdir); GetCurrentDirectoryW(MAX_PATH, fodInfos->initdir);
handledPath = TRUE; handledPath = TRUE;

View file

@ -58,7 +58,7 @@ typedef struct tagFD31_DATA
*/ */
static BOOL FD31_Init(void) static BOOL FD31_Init(void)
{ {
static BOOL initialized = 0; static BOOL initialized = FALSE;
if (!initialized) { if (!initialized) {
hFolder = LoadImageA( COMDLG32_hInstance, "FOLDER", IMAGE_ICON, 16, 16, LR_SHARED ); hFolder = LoadImageA( COMDLG32_hInstance, "FOLDER", IMAGE_ICON, 16, 16, LR_SHARED );
@ -70,7 +70,7 @@ static BOOL FD31_Init(void)
if (hFolder == 0 || hFolder2 == 0 || hFloppy == 0 || if (hFolder == 0 || hFolder2 == 0 || hFloppy == 0 ||
hHDisk == 0 || hCDRom == 0 || hNet == 0) hHDisk == 0 || hCDRom == 0 || hNet == 0)
{ {
ERR("Error loading icons !\n"); ERR("Error loading icons!\n");
return FALSE; return FALSE;
} }
initialized = TRUE; initialized = TRUE;

View file

@ -345,7 +345,7 @@ static INT WINAPI FontFamilyEnumProc(const ENUMLOGFONTEXW *lpElfex,
* *
* Fill font style information into combobox (without using font.c directly) * Fill font style information into combobox (without using font.c directly)
*/ */
static int SetFontStylesToCombo2(HWND hwnd, HDC hdc, const LOGFONTW *lplf) static BOOL SetFontStylesToCombo2(HWND hwnd, HDC hdc, const LOGFONTW *lplf)
{ {
#define FSTYLES 4 #define FSTYLES 4
struct FONTSTYLE struct FONTSTYLE
@ -384,19 +384,19 @@ static int SetFontStylesToCombo2(HWND hwnd, HDC hdc, const LOGFONTW *lplf)
WCHAR name[64]; WCHAR name[64];
LoadStringW(COMDLG32_hInstance, fontstyles[i].resId, name, 64); LoadStringW(COMDLG32_hInstance, fontstyles[i].resId, name, 64);
j=SendMessageW(hwnd,CB_ADDSTRING,0,(LPARAM)name ); j=SendMessageW(hwnd,CB_ADDSTRING,0,(LPARAM)name );
if (j==CB_ERR) return 1; if (j==CB_ERR) return TRUE;
j=SendMessageW(hwnd, CB_SETITEMDATA, j, j=SendMessageW(hwnd, CB_SETITEMDATA, j,
MAKELONG(tm.tmWeight,fontstyles[i].italic)); MAKELONG(tm.tmWeight,fontstyles[i].italic));
if (j==CB_ERR) return 1; if (j==CB_ERR) return TRUE;
} }
} }
return 0; return FALSE;
} }
/************************************************************************* /*************************************************************************
* AddFontSizeToCombo3 [internal] * AddFontSizeToCombo3 [internal]
*/ */
static int AddFontSizeToCombo3(HWND hwnd, UINT h, const CHOOSEFONTW *lpcf) static BOOL AddFontSizeToCombo3(HWND hwnd, UINT h, const CHOOSEFONTW *lpcf)
{ {
int j; int j;
WCHAR buffer[20]; WCHAR buffer[20];
@ -411,23 +411,23 @@ static int AddFontSizeToCombo3(HWND hwnd, UINT h, const CHOOSEFONTW *lpcf)
{ {
j=SendMessageW(hwnd, CB_ADDSTRING, 0, (LPARAM)buffer); j=SendMessageW(hwnd, CB_ADDSTRING, 0, (LPARAM)buffer);
if (j!=CB_ERR) j = SendMessageW(hwnd, CB_SETITEMDATA, j, h); if (j!=CB_ERR) j = SendMessageW(hwnd, CB_SETITEMDATA, j, h);
if (j==CB_ERR) return 1; if (j==CB_ERR) return TRUE;
} }
} }
return 0; return FALSE;
} }
/************************************************************************* /*************************************************************************
* SetFontSizesToCombo3 [internal] * SetFontSizesToCombo3 [internal]
*/ */
static int SetFontSizesToCombo3(HWND hwnd, const CHOOSEFONTW *lpcf) static BOOL SetFontSizesToCombo3(HWND hwnd, const CHOOSEFONTW *lpcf)
{ {
static const BYTE sizes[]={6,7,8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72}; static const BYTE sizes[]={6,7,8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72};
unsigned int i; unsigned int i;
for (i = 0; i < sizeof(sizes)/sizeof(sizes[0]); i++) for (i = 0; i < sizeof(sizes)/sizeof(sizes[0]); i++)
if (AddFontSizeToCombo3(hwnd, sizes[i], lpcf)) return 1; if (AddFontSizeToCombo3(hwnd, sizes[i], lpcf)) return TRUE;
return 0; return FALSE;
} }
/************************************************************************* /*************************************************************************
@ -490,16 +490,17 @@ static INT AddFontStyle( const ENUMLOGFONTEXW *lpElfex, const NEWTEXTMETRICEXW *
INT points; INT points;
points = MulDiv( lpNTM->ntmTm.tmHeight - lpNTM->ntmTm.tmInternalLeading, points = MulDiv( lpNTM->ntmTm.tmHeight - lpNTM->ntmTm.tmInternalLeading,
72, GetScreenDPI()); 72, GetScreenDPI());
i = AddFontSizeToCombo3(hcmb3, points, lpcf); if (AddFontSizeToCombo3(hcmb3, points, lpcf))
if(i) return 0; return 0;
} else if (SetFontSizesToCombo3(hcmb3, lpcf)) return 0; } else if (SetFontSizesToCombo3(hcmb3, lpcf)) return 0;
if (!SendMessageW(hcmb2, CB_GETCOUNT, 0, 0)) if (!SendMessageW(hcmb2, CB_GETCOUNT, 0, 0))
{ {
BOOL res;
if(!(hdc = CFn_GetDC(lpcf))) return 0; if(!(hdc = CFn_GetDC(lpcf))) return 0;
i=SetFontStylesToCombo2(hcmb2,hdc,lplf); res = SetFontStylesToCombo2(hcmb2,hdc,lplf);
CFn_ReleaseDC(lpcf, hdc); CFn_ReleaseDC(lpcf, hdc);
if (i) if (res)
return 0; return 0;
} }
if (!( hcmb5 = GetDlgItem(hDlg, cmb5))) return 1; if (!( hcmb5 = GetDlgItem(hDlg, cmb5))) return 1;
@ -514,10 +515,10 @@ static INT AddFontStyle( const ENUMLOGFONTEXW *lpElfex, const NEWTEXTMETRICEXW *
return 1 ; return 1 ;
} }
static INT CFn_FitFontSize( HWND hDlg, int points) static BOOL CFn_FitFontSize( HWND hDlg, int points)
{ {
int i,n; int i,n;
int ret = 0; BOOL ret = FALSE;
/* look for fitting font size in combobox3 */ /* look for fitting font size in combobox3 */
n=SendDlgItemMessageW(hDlg, cmb3, CB_GETCOUNT, 0, 0); n=SendDlgItemMessageW(hDlg, cmb3, CB_GETCOUNT, 0, 0);
for (i=0;i<n;i++) for (i=0;i<n;i++)
@ -529,17 +530,18 @@ static INT CFn_FitFontSize( HWND hDlg, int points)
SendMessageW(hDlg, WM_COMMAND, SendMessageW(hDlg, WM_COMMAND,
MAKEWPARAM(cmb3, CBN_SELCHANGE), MAKEWPARAM(cmb3, CBN_SELCHANGE),
(LPARAM)GetDlgItem(hDlg,cmb3)); (LPARAM)GetDlgItem(hDlg,cmb3));
ret = 1; ret = TRUE;
break; break;
} }
} }
return ret; return ret;
} }
static INT CFn_FitFontStyle( HWND hDlg, LONG packedstyle ) static BOOL CFn_FitFontStyle( HWND hDlg, LONG packedstyle )
{ {
LONG id; LONG id;
int i, ret = 0; int i;
BOOL ret = FALSE;
/* look for fitting font style in combobox2 */ /* look for fitting font style in combobox2 */
for (i=0;i<TEXT_EXTRAS;i++) for (i=0;i<TEXT_EXTRAS;i++)
{ {
@ -549,7 +551,7 @@ static INT CFn_FitFontStyle( HWND hDlg, LONG packedstyle )
SendDlgItemMessageW(hDlg, cmb2, CB_SETCURSEL, i, 0); SendDlgItemMessageW(hDlg, cmb2, CB_SETCURSEL, i, 0);
SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb2, CBN_SELCHANGE), SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb2, CBN_SELCHANGE),
(LPARAM)GetDlgItem(hDlg,cmb2)); (LPARAM)GetDlgItem(hDlg,cmb2));
ret = 1; ret = TRUE;
break; break;
} }
} }
@ -557,7 +559,7 @@ static INT CFn_FitFontStyle( HWND hDlg, LONG packedstyle )
} }
static INT CFn_FitCharSet( HWND hDlg, int charset ) static BOOL CFn_FitCharSet( HWND hDlg, int charset )
{ {
int i,n,cs; int i,n,cs;
/* look for fitting char set in combobox5 */ /* look for fitting char set in combobox5 */
@ -570,14 +572,14 @@ static INT CFn_FitCharSet( HWND hDlg, int charset )
SendDlgItemMessageW(hDlg, cmb5, CB_SETCURSEL, i, 0); SendDlgItemMessageW(hDlg, cmb5, CB_SETCURSEL, i, 0);
SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb5, CBN_SELCHANGE), SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb5, CBN_SELCHANGE),
(LPARAM)GetDlgItem(hDlg,cmb2)); (LPARAM)GetDlgItem(hDlg,cmb2));
return 1; return TRUE;
} }
} }
/* no charset fits: select the first one in the list */ /* no charset fits: select the first one in the list */
SendDlgItemMessageW(hDlg, cmb5, CB_SETCURSEL, 0, 0); SendDlgItemMessageW(hDlg, cmb5, CB_SETCURSEL, 0, 0);
SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb5, CBN_SELCHANGE), SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb5, CBN_SELCHANGE),
(LPARAM)GetDlgItem(hDlg,cmb2)); (LPARAM)GetDlgItem(hDlg,cmb2));
return 0; return FALSE;
} }
/*********************************************************************** /***********************************************************************
@ -600,7 +602,8 @@ static INT WINAPI FontStyleEnumProc( const ENUMLOGFONTEXW *lpElfex,
static LRESULT CFn_WMInitDialog(HWND hDlg, LPARAM lParam, LPCHOOSEFONTW lpcf) static LRESULT CFn_WMInitDialog(HWND hDlg, LPARAM lParam, LPCHOOSEFONTW lpcf)
{ {
HDC hdc; HDC hdc;
int i,j,init=0; int i,j;
BOOL init = FALSE;
long pstyle; long pstyle;
CFn_ENUMSTRUCT s; CFn_ENUMSTRUCT s;
LPLOGFONTW lpxx; LPLOGFONTW lpxx;
@ -613,7 +616,7 @@ static LRESULT CFn_WMInitDialog(HWND hDlg, LPARAM lParam, LPCHOOSEFONTW lpcf)
if (lpcf->lStructSize != sizeof(CHOOSEFONTW)) if (lpcf->lStructSize != sizeof(CHOOSEFONTW))
{ {
ERR("structure size failure !!!\n"); ERR("structure size failure!!!\n");
EndDialog (hDlg, 0); EndDialog (hDlg, 0);
return FALSE; return FALSE;
} }
@ -711,7 +714,7 @@ static LRESULT CFn_WMInitDialog(HWND hDlg, LPARAM lParam, LPCHOOSEFONTW lpcf)
SendDlgItemMessageW(hDlg, cmb1, CB_SETCURSEL, j, 0); SendDlgItemMessageW(hDlg, cmb1, CB_SETCURSEL, j, 0);
SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb1, CBN_SELCHANGE), SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb1, CBN_SELCHANGE),
(LPARAM)GetDlgItem(hDlg,cmb1)); (LPARAM)GetDlgItem(hDlg,cmb1));
init=1; init = TRUE;
/* look for fitting font style in combobox2 */ /* look for fitting font style in combobox2 */
CFn_FitFontStyle(hDlg, pstyle); CFn_FitFontStyle(hDlg, pstyle);
/* look for fitting font size in combobox3 */ /* look for fitting font size in combobox3 */

View file

@ -1473,7 +1473,7 @@ static LRESULT PRINTDLG_WMInitDialog(HWND hDlg,
PrintStructures->hNoCollateIcon == 0 || PrintStructures->hNoCollateIcon == 0 ||
PrintStructures->hPortraitIcon == 0 || PrintStructures->hPortraitIcon == 0 ||
PrintStructures->hLandscapeIcon == 0) { PrintStructures->hLandscapeIcon == 0) {
ERR("no icon in resourcefile\n"); ERR("no icon in resource file\n");
COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE); COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
EndDialog(hDlg, FALSE); EndDialog(hDlg, FALSE);
} }
@ -1581,7 +1581,7 @@ static LRESULT PRINTDLG_WMInitDialogW(HWND hDlg,
PrintStructures->hNoCollateIcon == 0 || PrintStructures->hNoCollateIcon == 0 ||
PrintStructures->hPortraitIcon == 0 || PrintStructures->hPortraitIcon == 0 ||
PrintStructures->hLandscapeIcon == 0) { PrintStructures->hLandscapeIcon == 0) {
ERR("no icon in resourcefile\n"); ERR("no icon in resource file\n");
COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE); COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
EndDialog(hDlg, FALSE); EndDialog(hDlg, FALSE);
} }
@ -2241,7 +2241,7 @@ BOOL WINAPI PrintDlgA(LPPRINTDLGA lppd)
} }
if(lppd->lStructSize != sizeof(PRINTDLGA)) { if(lppd->lStructSize != sizeof(PRINTDLGA)) {
WARN("structure size failure !!!\n"); WARN("structure size failure!!!\n");
COMDLG32_SetCommDlgExtendedError(CDERR_STRUCTSIZE); COMDLG32_SetCommDlgExtendedError(CDERR_STRUCTSIZE);
return FALSE; return FALSE;
} }
@ -2392,7 +2392,7 @@ BOOL WINAPI PrintDlgW(LPPRINTDLGW lppd)
} }
if(lppd->lStructSize != sizeof(PRINTDLGW)) { if(lppd->lStructSize != sizeof(PRINTDLGW)) {
WARN("structure size failure !!!\n"); WARN("structure size failure!!!\n");
COMDLG32_SetCommDlgExtendedError(CDERR_STRUCTSIZE); COMDLG32_SetCommDlgExtendedError(CDERR_STRUCTSIZE);
return FALSE; return FALSE;
} }

View file

@ -61,7 +61,7 @@ reactos/dll/win32/cabinet # Synced to Wine-1.7.17
reactos/dll/win32/clusapi # Synced to Wine-1.7.1 reactos/dll/win32/clusapi # Synced to Wine-1.7.1
reactos/dll/win32/comcat # Synced to Wine-1.7.1 reactos/dll/win32/comcat # Synced to Wine-1.7.1
reactos/dll/win32/comctl32 # Synced to Wine 1.7.17 reactos/dll/win32/comctl32 # Synced to Wine 1.7.17
reactos/dll/win32/comdlg32 # Synced to Wine 1.7.1 reactos/dll/win32/comdlg32 # Synced to Wine 1.7.17
reactos/dll/win32/compstui # Synced to Wine-1.7.1 reactos/dll/win32/compstui # Synced to Wine-1.7.1
reactos/dll/win32/credui # Synced to Wine-1.7.1 reactos/dll/win32/credui # Synced to Wine-1.7.1
reactos/dll/win32/crypt32 # Synced to Wine-1.7.1 reactos/dll/win32/crypt32 # Synced to Wine-1.7.1