Commit b97542ce authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

comdlg32: Use wide-char string literals.

parent aa889178
...@@ -63,9 +63,6 @@ static const COLORREF predefcolors[6][8]= ...@@ -63,9 +63,6 @@ static const COLORREF predefcolors[6][8]=
0x00808040L, 0x00C0C0C0L, 0x00400040L, 0x00FFFFFFL }, 0x00808040L, 0x00C0C0C0L, 0x00400040L, 0x00FFFFFFL },
}; };
static const WCHAR szColourDialogProp[] = {
'c','o','l','o','u','r','d','i','a','l','o','g','p','r','o','p',0 };
/* Chose Color PRIVATE Structure: /* Chose Color PRIVATE Structure:
* *
* This structure is duplicated in the 16 bit code with * This structure is duplicated in the 16 bit code with
...@@ -866,7 +863,7 @@ static LRESULT CC_WMInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam ) ...@@ -866,7 +863,7 @@ static LRESULT CC_WMInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam )
lpp->lpcc = cc; lpp->lpcc = cc;
lpp->hwndSelf = hDlg; lpp->hwndSelf = hDlg;
SetPropW( hDlg, szColourDialogProp, lpp ); SetPropW( hDlg, L"colourdialogprop", lpp );
if (!(lpp->lpcc->Flags & CC_SHOWHELP)) if (!(lpp->lpcc->Flags & CC_SHOWHELP))
ShowWindow(GetDlgItem(hDlg, pshHelp), SW_HIDE); ShowWindow(GetDlgItem(hDlg, pshHelp), SW_HIDE);
...@@ -1194,7 +1191,7 @@ static INT_PTR CALLBACK ColorDlgProc( HWND hDlg, UINT message, ...@@ -1194,7 +1191,7 @@ static INT_PTR CALLBACK ColorDlgProc( HWND hDlg, UINT message,
{ {
int res; int res;
CCPRIV *lpp = GetPropW( hDlg, szColourDialogProp ); CCPRIV *lpp = GetPropW( hDlg, L"colourdialogprop" );
if (message != WM_INITDIALOG) if (message != WM_INITDIALOG)
{ {
...@@ -1220,7 +1217,7 @@ static INT_PTR CALLBACK ColorDlgProc( HWND hDlg, UINT message, ...@@ -1220,7 +1217,7 @@ static INT_PTR CALLBACK ColorDlgProc( HWND hDlg, UINT message,
DeleteDC(lpp->hdcMem); DeleteDC(lpp->hdcMem);
DeleteObject(lpp->hbmMem); DeleteObject(lpp->hbmMem);
heap_free(lpp); heap_free(lpp);
RemovePropW( hDlg, szColourDialogProp ); RemovePropW( hDlg, L"colourdialogprop" );
break; break;
case WM_COMMAND: case WM_COMMAND:
if (CC_WMCommand(lpp, wParam, lParam, HIWORD(wParam), (HWND) lParam)) if (CC_WMCommand(lpp, wParam, lParam, HIWORD(wParam), (HWND) lParam))
...@@ -1301,8 +1298,7 @@ BOOL WINAPI ChooseColorW( CHOOSECOLORW *lpChCol ) ...@@ -1301,8 +1298,7 @@ BOOL WINAPI ChooseColorW( CHOOSECOLORW *lpChCol )
{ {
HRSRC hResInfo; HRSRC hResInfo;
HGLOBAL hDlgTmpl; HGLOBAL hDlgTmpl;
static const WCHAR wszCHOOSE_COLOR[] = {'C','H','O','O','S','E','_','C','O','L','O','R',0}; if (!(hResInfo = FindResourceW(COMDLG32_hInstance, L"CHOOSE_COLOR", (LPWSTR)RT_DIALOG)))
if (!(hResInfo = FindResourceW(COMDLG32_hInstance, wszCHOOSE_COLOR, (LPWSTR)RT_DIALOG)))
{ {
COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE); COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
return FALSE; return FALSE;
......
...@@ -43,9 +43,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(commdlg); ...@@ -43,9 +43,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
#define BUFFILE 512 #define BUFFILE 512
#define BUFFILEALLOC 512 * sizeof(WCHAR) #define BUFFILEALLOC 512 * sizeof(WCHAR)
static const WCHAR FILE_star[] = {'*','.','*', 0};
static const WCHAR FILE_bslash[] = {'\\', 0};
static const WCHAR FILE_specc[] = {'%','c',':', 0};
static const int fldrHeight = 16; static const int fldrHeight = 16;
static const int fldrWidth = 20; static const int fldrWidth = 20;
...@@ -167,7 +164,7 @@ static LPCWSTR FD31_GetFileType(LPCWSTR cfptr, LPCWSTR fptr, const WORD index) ...@@ -167,7 +164,7 @@ static LPCWSTR FD31_GetFileType(LPCWSTR cfptr, LPCWSTR fptr, const WORD index)
return fptr; return fptr;
fptr += lstrlenW(fptr) + 1; fptr += lstrlenW(fptr) + 1;
} }
return FILE_star; /* FIXME */ return L"*.*"; /* FIXME */
} }
/*********************************************************************** /***********************************************************************
...@@ -210,7 +207,7 @@ static BOOL FD31_ScanDir(const OPENFILENAMEW *ofn, HWND hWnd, LPCWSTR newPath) ...@@ -210,7 +207,7 @@ static BOOL FD31_ScanDir(const OPENFILENAMEW *ofn, HWND hWnd, LPCWSTR newPath)
} }
/* list of directories */ /* list of directories */
lstrcpyW(buffer, FILE_star); lstrcpyW(buffer, L"*.*");
if (GetDlgItem(hWnd, lst2) != 0) { if (GetDlgItem(hWnd, lst2) != 0) {
lRet = DlgDirListW(hWnd, buffer, lst2, stc1, DDL_EXCLUSIVE | DDL_DIRECTORY); lRet = DlgDirListW(hWnd, buffer, lst2, stc1, DDL_EXCLUSIVE | DDL_DIRECTORY);
...@@ -429,7 +426,7 @@ static LRESULT FD31_DirListDblClick( const FD31_DATA *lfs ) ...@@ -429,7 +426,7 @@ static LRESULT FD31_DirListDblClick( const FD31_DATA *lfs )
tmpstr[lstrlenW(tmpstr) - 1] = 0; tmpstr[lstrlenW(tmpstr) - 1] = 0;
lstrcpyW(tmpstr,tmpstr+1); lstrcpyW(tmpstr,tmpstr+1);
} }
lstrcatW(tmpstr, FILE_bslash); lstrcatW(tmpstr, L"\\");
FD31_ScanDir(lfs->ofnW, hWnd, tmpstr); FD31_ScanDir(lfs->ofnW, hWnd, tmpstr);
/* notify the app */ /* notify the app */
...@@ -515,7 +512,7 @@ static LRESULT FD31_TestPath( const FD31_DATA *lfs, LPWSTR path ) ...@@ -515,7 +512,7 @@ static LRESULT FD31_TestPath( const FD31_DATA *lfs, LPWSTR path )
pstr2 = path + lstrlenW(path); pstr2 = path + lstrlenW(path);
if (pBeginFileName == NULL || *(pBeginFileName + 1) != 0) if (pBeginFileName == NULL || *(pBeginFileName + 1) != 0)
lstrcatW(path, FILE_bslash); lstrcatW(path, L"\\");
/* if ScanDir succeeds, we have changed the directory */ /* if ScanDir succeeds, we have changed the directory */
if (FD31_ScanDir(lfs->ofnW, hWnd, path)) if (FD31_ScanDir(lfs->ofnW, hWnd, path))
...@@ -627,7 +624,7 @@ static LRESULT FD31_DiskChange( const FD31_DATA *lfs ) ...@@ -627,7 +624,7 @@ static LRESULT FD31_DiskChange( const FD31_DATA *lfs )
pstr = heap_alloc(BUFFILEALLOC); pstr = heap_alloc(BUFFILEALLOC);
SendDlgItemMessageW(hWnd, cmb2, CB_GETLBTEXT, lRet, SendDlgItemMessageW(hWnd, cmb2, CB_GETLBTEXT, lRet,
(LPARAM)pstr); (LPARAM)pstr);
wsprintfW(diskname, FILE_specc, pstr[2]); wsprintfW(diskname, L"%c:", pstr[2]);
heap_free(pstr); heap_free(pstr);
return FD31_Validate( lfs, diskname, cmb2, lRet, TRUE ); return FD31_Validate( lfs, diskname, cmb2, lRet, TRUE );
......
...@@ -47,11 +47,8 @@ typedef struct ...@@ -47,11 +47,8 @@ typedef struct
} CFn_ENUMSTRUCT, *LPCFn_ENUMSTRUCT; } CFn_ENUMSTRUCT, *LPCFn_ENUMSTRUCT;
static const WCHAR strWineFontData[] = {'_','_','W','I','N','E','_','F','O','N','T','D','L','G','D','A','T','A',0}; static const WCHAR strWineFontData[] = L"__WINE_FONTDLGDATA";
static const WCHAR strWineFontData_a[] = static const WCHAR strWineFontData_a[] = L"__WINE_FONTDLGDATA_A";
{'_','_','W','I','N','E','_','F','O','N','T','D','L','G','D','A','T','A','_','A',0};
static const WCHAR chooseFontW[] = {'C','H','O','O','S','E','_','F','O','N','T',0};
static const WCHAR fontsizefmtW[] = {'%','d',0};
/* image list with TrueType bitmaps and more */ /* image list with TrueType bitmaps and more */
static HIMAGELIST himlTT = 0; static HIMAGELIST himlTT = 0;
...@@ -67,43 +64,37 @@ static INT_PTR CALLBACK FormatCharDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam, ...@@ -67,43 +64,37 @@ static INT_PTR CALLBACK FormatCharDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam,
#define CI(cs) ((IDS_CHARSET_##cs)-IDS_CHARSET_ANSI) #define CI(cs) ((IDS_CHARSET_##cs)-IDS_CHARSET_ANSI)
static const WCHAR stWestern[]={'A','a','B','b','Y','y','Z','z',0}; /* Western and default */
static const WCHAR stSymbol[]={'S','y','m','b','o','l',0}; /* Symbol */
static const WCHAR stShiftJis[]={'A','a',0x3042,0x3041,0x30a2,0x30a1,0x4e9c,0x5b87,0}; /* Shift JIS */
static const WCHAR stHangul[]={0xac00,0xb098,0xb2e4,'A','a','B','Y','y','Z','z',0}; /* Hangul */
static const WCHAR stGB2312[]={0x5fae,0x8f6f,0x4e2d,0x6587,0x8f6f,0x4ef6,0}; /* GB2312 */
static const WCHAR stBIG5[]={0x4e2d,0x6587,0x5b57,0x578b,0x7bc4,0x4f8b,0}; /* BIG5 */
static const WCHAR stGreek[]={'A','a','B','b',0x0391,0x03b1,0x0392,0x03b2,0}; /* Greek */
static const WCHAR stTurkish[]={'A','a','B','b',0x011e,0x011f,0x015e,0x015f,0}; /* Turkish */
static const WCHAR stHebrew[]={'A','a','B','b',0x05e0,0x05e1,0x05e9,0x05ea,0}; /* Hebrew */
static const WCHAR stArabic[]={'A','a','B','b',0x0627,0x0628,0x062c,0x062f,0x0647,0x0648,0x0632,0};/* Arabic */
static const WCHAR stBaltic[]={'A','a','B','b','Y','y','Z','z',0}; /* Baltic */
static const WCHAR stVietname[]={'A','a','B','b',0x01a0,0x01a1,0x01af,0x01b0,0}; /* Vietnamese */
static const WCHAR stCyrillic[]={'A','a','B','b',0x0411,0x0431,0x0424,0x0444,0}; /* Cyrillic */
static const WCHAR stEastEur[]={'A','a','B','b',0xc1,0xe1,0xd4,0xf4,0}; /* East European */
static const WCHAR stThai[]={'A','a','B','b',0x0e2d,0x0e31,0x0e01,0x0e29,0x0e23,0x0e44,0x0e17,0x0e22,0}; /* Thai */
static const WCHAR stJohab[]={0xac00,0xb098,0xb2e4,'A','a','B','Y','y','Z','z',0}; /* Johab */
static const WCHAR stMac[]={'A','a','B','b','Y','y','Z','z',0}; /* Mac */
static const WCHAR stOEM[]={'A','a','B','b',0xf8,0xf1,0xfd,0}; /* OEM */
/* the following character sets actually behave different (Win2K observation):
* the sample string is 'sticky': it uses the sample string of the previous
* selected character set. That behaviour looks like some default, which is
* not (yet) implemented. */
static const WCHAR stVISCII[]={'A','a','B','b',0}; /* VISCII */
static const WCHAR stTCVN[]={'A','a','B','b',0}; /* TCVN */
static const WCHAR stKOI8[]={'A','a','B','b',0}; /* KOI-8 */
static const WCHAR stIso88593[]={'A','a','B','b',0}; /* ISO-8859-3 */
static const WCHAR stIso88594[]={'A','a','B','b',0}; /* ISO-8859-4 */
static const WCHAR stIso885910[]={'A','a','B','b',0}; /* ISO-8859-10 */
static const WCHAR stCeltic[]={'A','a','B','b',0};/* Celtic */
static const WCHAR * const sample_lang_text[]={ static const WCHAR * const sample_lang_text[]={
stWestern,stSymbol,stShiftJis,stHangul,stGB2312, L"AaBbYyZz", /* Western and default */
stBIG5,stGreek,stTurkish,stHebrew,stArabic, L"Symbol", /* Symbol */
stBaltic,stVietname,stCyrillic,stEastEur,stThai, L"Aa\x3042\x3041\x30a2\x30a1\x4e9c\x5b87", /* Shift JIS */
stJohab,stMac,stOEM,stVISCII,stTCVN, L"\xac00\xb098\xb2e4" "AaBYyZz", /* Hangul */
stKOI8,stIso88593,stIso88594,stIso885910,stCeltic}; L"\x5fae\x8f6f\x4e2d\x6587\x8f6f\x4ef6", /* GB2312 */
L"\x4e2d\x6587\x5b57\x578b\x7bc4\x4f8b", /* BIG5 */
L"AaBb\x0391\x03b1\x0392\x03b2", /* Greek */
L"AaBb\x011e\x011f\x015e\x015f", /* Turkish */
L"AaBb\x05e0\x05e1\x05e9\x05ea", /* Hebrew */
L"AaBb\x0627\x0628\x062c\x062f\x0647\x0648\x0632", /* Arabic */
L"AaBbYyZz", /* Baltic */
L"AaBb\x01a0\x01a1\x01af\x01b0", /* Vietnamese */
L"AaBb\x0411\x0431\x0424\x0444", /* Cyrillic */
L"AaBb\x00c1\x00e1\x00d4\x00f4", /* East European */
L"AaBb\x0e2d\x0e31\x0e01\x0e29\x0e23\x0e44\x0e17\x0e22", /* Thai */
L"\xac00\xb098\xb2e4" "AaBYyZz", /* Johab */
L"AaBbYyZz", /* Mac */
L"AaBb\x00f8\x00f1\x00fd", /* OEM */
/* the following character sets actually behave different (Win2K observation):
* the sample string is 'sticky': it uses the sample string of the previous
* selected character set. That behaviour looks like some default, which is
* not (yet) implemented. */
L"AaBb", /* VISCII */
L"AaBb", /* TCVN */
L"AaBb", /* KOI-8 */
L"AaBb", /* ISO-8859-3 */
L"AaBb", /* ISO-8859-4 */
L"AaBb", /* ISO-8859-10 */
L"AaBb" /* Celtic */
};
static const BYTE CHARSET_ORDER[256]={ static const BYTE CHARSET_ORDER[256]={
...@@ -207,7 +198,7 @@ BOOL WINAPI ChooseFontW(LPCHOOSEFONTW lpChFont) ...@@ -207,7 +198,7 @@ BOOL WINAPI ChooseFontW(LPCHOOSEFONTW lpChFont)
} else } else
{ {
hDlginst=COMDLG32_hInstance; hDlginst=COMDLG32_hInstance;
if (!(hResInfo = FindResourceW(hDlginst, chooseFontW, (LPWSTR)RT_DIALOG))) if (!(hResInfo = FindResourceW(hDlginst, L"CHOOSE_FONT", (LPWSTR)RT_DIALOG)))
{ {
COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE); COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
return FALSE; return FALSE;
...@@ -261,7 +252,7 @@ BOOL WINAPI ChooseFontA(LPCHOOSEFONTA lpChFont) ...@@ -261,7 +252,7 @@ BOOL WINAPI ChooseFontA(LPCHOOSEFONTA lpChFont)
} else } else
{ {
hDlginst=COMDLG32_hInstance; hDlginst=COMDLG32_hInstance;
if (!(hResInfo = FindResourceW(hDlginst, chooseFontW, (LPWSTR)RT_DIALOG))) if (!(hResInfo = FindResourceW(hDlginst, L"CHOOSE_FONT", (LPWSTR)RT_DIALOG)))
{ {
COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE); COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
return FALSE; return FALSE;
...@@ -422,7 +413,7 @@ static BOOL AddFontSizeToCombo3(HWND hwnd, UINT h, const CHOOSEFONTW *lpcf) ...@@ -422,7 +413,7 @@ static BOOL AddFontSizeToCombo3(HWND hwnd, UINT h, const CHOOSEFONTW *lpcf)
if ( (!(lpcf->Flags & CF_LIMITSIZE)) || if ( (!(lpcf->Flags & CF_LIMITSIZE)) ||
((lpcf->Flags & CF_LIMITSIZE) && (h >= lpcf->nSizeMin) && (h <= lpcf->nSizeMax))) ((lpcf->Flags & CF_LIMITSIZE) && (h >= lpcf->nSizeMin) && (h <= lpcf->nSizeMax)))
{ {
swprintf(buffer, ARRAY_SIZE(buffer), fontsizefmtW, h); swprintf(buffer, ARRAY_SIZE(buffer), L"%d", h);
j=SendMessageW(hwnd, CB_FINDSTRINGEXACT, -1, (LPARAM)buffer); j=SendMessageW(hwnd, CB_FINDSTRINGEXACT, -1, (LPARAM)buffer);
if (j==CB_ERR) if (j==CB_ERR)
{ {
...@@ -625,7 +616,6 @@ static LRESULT CFn_WMInitDialog(HWND hDlg, LPARAM lParam, LPCHOOSEFONTW lpcf) ...@@ -625,7 +616,6 @@ static LRESULT CFn_WMInitDialog(HWND hDlg, LPARAM lParam, LPCHOOSEFONTW lpcf)
CFn_ENUMSTRUCT s; CFn_ENUMSTRUCT s;
LPLOGFONTW lpxx; LPLOGFONTW lpxx;
HCURSOR hcursor=SetCursor(LoadCursorW(0,(LPWSTR)IDC_WAIT)); HCURSOR hcursor=SetCursor(LoadCursorW(0,(LPWSTR)IDC_WAIT));
static const WCHAR strColorName[] = {'[','c','o','l','o','r',' ','n','a','m','e',']',0};
SetPropW(hDlg, strWineFontData, lpcf); SetPropW(hDlg, strWineFontData, lpcf);
lpxx=lpcf->lpLogFont; lpxx=lpcf->lpLogFont;
...@@ -662,11 +652,8 @@ static LRESULT CFn_WMInitDialog(HWND hDlg, LPARAM lParam, LPCHOOSEFONTW lpcf) ...@@ -662,11 +652,8 @@ static LRESULT CFn_WMInitDialog(HWND hDlg, LPARAM lParam, LPCHOOSEFONTW lpcf)
{ {
WCHAR name[30]; WCHAR name[30];
if( LoadStringW(COMDLG32_hInstance, IDS_COLOR_BLACK+i, name, if (LoadStringW(COMDLG32_hInstance, IDS_COLOR_BLACK+i, name, ARRAY_SIZE(name)) == 0)
ARRAY_SIZE(name)) == 0 ) lstrcpyW(name, L"[color name]");
{
memcpy(name, strColorName, sizeof(strColorName));
}
j=SendDlgItemMessageW(hDlg, cmb4, CB_ADDSTRING, 0, (LPARAM)name); j=SendDlgItemMessageW(hDlg, cmb4, CB_ADDSTRING, 0, (LPARAM)name);
SendDlgItemMessageW(hDlg, cmb4, CB_SETITEMDATA, j, textcolors[i]); SendDlgItemMessageW(hDlg, cmb4, CB_SETITEMDATA, j, textcolors[i]);
/* look for a fitting value in color combobox */ /* look for a fitting value in color combobox */
......
...@@ -48,10 +48,6 @@ DEFINE_GUID(IID_IFileDialogCustomizeAlt, 0x8016B7B3, 0x3D49, 0x4504, 0xA0,0xAA, ...@@ -48,10 +48,6 @@ DEFINE_GUID(IID_IFileDialogCustomizeAlt, 0x8016B7B3, 0x3D49, 0x4504, 0xA0,0xAA,
WINE_DEFAULT_DEBUG_CHANNEL(commdlg); WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
static const WCHAR notifysink_childW[] = {'n','f','s','_','c','h','i','l','d',0};
static const WCHAR floatnotifysinkW[] = {'F','l','o','a','t','N','o','t','i','f','y','S','i','n','k',0};
static const WCHAR radiobuttonlistW[] = {'R','a','d','i','o','B','u','t','t','o','n','L','i','s','t',0};
enum ITEMDLG_TYPE { enum ITEMDLG_TYPE {
ITEMDLG_TYPE_OPEN, ITEMDLG_TYPE_OPEN,
ITEMDLG_TYPE_SAVE ITEMDLG_TYPE_SAVE
...@@ -555,8 +551,6 @@ static HRESULT on_default_action(FileDialogImpl *This) ...@@ -555,8 +551,6 @@ static HRESULT on_default_action(FileDialogImpl *This)
/* Add the proper extension */ /* Add the proper extension */
if(open_action == ONOPEN_OPEN) if(open_action == ONOPEN_OPEN)
{ {
static const WCHAR dotW[] = {'.',0};
if(This->dlg_type == ITEMDLG_TYPE_SAVE) if(This->dlg_type == ITEMDLG_TYPE_SAVE)
{ {
WCHAR extbuf[MAX_PATH], *newext = NULL; WCHAR extbuf[MAX_PATH], *newext = NULL;
...@@ -567,7 +561,7 @@ static HRESULT on_default_action(FileDialogImpl *This) ...@@ -567,7 +561,7 @@ static HRESULT on_default_action(FileDialogImpl *This)
} }
else if(This->default_ext) else if(This->default_ext)
{ {
lstrcpyW(extbuf, dotW); lstrcpyW(extbuf, L".");
lstrcatW(extbuf, This->default_ext); lstrcatW(extbuf, This->default_ext);
newext = extbuf; newext = extbuf;
} }
...@@ -586,7 +580,7 @@ static HRESULT on_default_action(FileDialogImpl *This) ...@@ -586,7 +580,7 @@ static HRESULT on_default_action(FileDialogImpl *This)
{ {
if(This->default_ext) if(This->default_ext)
{ {
lstrcatW(canon_filename, dotW); lstrcatW(canon_filename, L".");
lstrcatW(canon_filename, This->default_ext); lstrcatW(canon_filename, This->default_ext);
if(!PathFileExistsW(canon_filename)) if(!PathFileExistsW(canon_filename))
...@@ -1122,7 +1116,7 @@ static LRESULT CALLBACK notifysink_proc(HWND hwnd, UINT message, WPARAM wparam, ...@@ -1122,7 +1116,7 @@ static LRESULT CALLBACK notifysink_proc(HWND hwnd, UINT message, WPARAM wparam,
case WM_COMMAND: return notifysink_on_wm_command(This, hwnd, wparam, lparam); case WM_COMMAND: return notifysink_on_wm_command(This, hwnd, wparam, lparam);
case WM_NOTIFY: return notifysink_on_wm_notify(This, hwnd, wparam, lparam); case WM_NOTIFY: return notifysink_on_wm_notify(This, hwnd, wparam, lparam);
case WM_SIZE: case WM_SIZE:
hwnd_child = GetPropW(hwnd, notifysink_childW); hwnd_child = GetPropW(hwnd, L"nfs_child");
ctrl = (customctrl*)GetWindowLongPtrW(hwnd_child, GWLP_USERDATA); ctrl = (customctrl*)GetWindowLongPtrW(hwnd_child, GWLP_USERDATA);
if(ctrl && ctrl->type != IDLG_CCTRL_VISUALGROUP) if(ctrl && ctrl->type != IDLG_CCTRL_VISUALGROUP)
{ {
...@@ -1151,7 +1145,7 @@ static HRESULT cctrl_create_new(FileDialogImpl *This, DWORD id, ...@@ -1151,7 +1145,7 @@ static HRESULT cctrl_create_new(FileDialogImpl *This, DWORD id,
else else
parent_hwnd = This->cctrls_hwnd; parent_hwnd = This->cctrls_hwnd;
ns_hwnd = CreateWindowExW(0, floatnotifysinkW, NULL, wsflags, ns_hwnd = CreateWindowExW(0, L"FloatNotifySink", NULL, wsflags,
0, 0, This->cctrl_width, height, parent_hwnd, 0, 0, This->cctrl_width, height, parent_hwnd,
(HMENU)This->cctrl_next_dlgid, COMDLG32_hInstance, This); (HMENU)This->cctrl_next_dlgid, COMDLG32_hInstance, This);
control_hwnd = CreateWindowExW(ctrl_exflags, wndclass, text, wsflags | ctrl_wsflags, control_hwnd = CreateWindowExW(ctrl_exflags, wndclass, text, wsflags | ctrl_wsflags,
...@@ -1167,7 +1161,7 @@ static HRESULT cctrl_create_new(FileDialogImpl *This, DWORD id, ...@@ -1167,7 +1161,7 @@ static HRESULT cctrl_create_new(FileDialogImpl *This, DWORD id,
return E_FAIL; return E_FAIL;
} }
SetPropW(ns_hwnd, notifysink_childW, control_hwnd); SetPropW(ns_hwnd, L"nfs_child", control_hwnd);
ctrl = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(customctrl)); ctrl = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(customctrl));
if(!ctrl) if(!ctrl)
...@@ -1492,8 +1486,7 @@ static HRESULT init_custom_controls(FileDialogImpl *This) ...@@ -1492,8 +1486,7 @@ static HRESULT init_custom_controls(FileDialogImpl *This)
{ {
WNDCLASSW wc; WNDCLASSW wc;
HDC hdc; HDC hdc;
static const WCHAR ctrl_container_classname[] = static const WCHAR ctrl_container_classname[] = L"idlg_container_pane";
{'i','d','l','g','_','c','o','n','t','a','i','n','e','r','_','p','a','n','e',0};
InitCommonControlsEx(NULL); InitCommonControlsEx(NULL);
...@@ -1537,7 +1530,7 @@ static HRESULT init_custom_controls(FileDialogImpl *This) ...@@ -1537,7 +1530,7 @@ static HRESULT init_custom_controls(FileDialogImpl *This)
SetWindowLongW(This->cctrls_hwnd, GWL_STYLE, WS_TABSTOP); SetWindowLongW(This->cctrls_hwnd, GWL_STYLE, WS_TABSTOP);
/* Register class for */ /* Register class for */
if( !GetClassInfoW(COMDLG32_hInstance, floatnotifysinkW, &wc) || if (!GetClassInfoW(COMDLG32_hInstance, L"FloatNotifySink", &wc) ||
wc.hInstance != COMDLG32_hInstance) wc.hInstance != COMDLG32_hInstance)
{ {
wc.style = CS_HREDRAW | CS_VREDRAW; wc.style = CS_HREDRAW | CS_VREDRAW;
...@@ -1549,13 +1542,13 @@ static HRESULT init_custom_controls(FileDialogImpl *This) ...@@ -1549,13 +1542,13 @@ static HRESULT init_custom_controls(FileDialogImpl *This)
wc.hCursor = LoadCursorW(0, (LPWSTR)IDC_ARROW); wc.hCursor = LoadCursorW(0, (LPWSTR)IDC_ARROW);
wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1); wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
wc.lpszMenuName = NULL; wc.lpszMenuName = NULL;
wc.lpszClassName = floatnotifysinkW; wc.lpszClassName = L"FloatNotifySink";
if (!RegisterClassW(&wc)) if (!RegisterClassW(&wc))
ERR("Failed to register FloatNotifySink window class.\n"); ERR("Failed to register FloatNotifySink window class.\n");
} }
if( !GetClassInfoW(COMDLG32_hInstance, radiobuttonlistW, &wc) || if (!GetClassInfoW(COMDLG32_hInstance, L"RadioButtonList", &wc) ||
wc.hInstance != COMDLG32_hInstance) wc.hInstance != COMDLG32_hInstance)
{ {
wc.style = CS_HREDRAW | CS_VREDRAW; wc.style = CS_HREDRAW | CS_VREDRAW;
...@@ -1567,7 +1560,7 @@ static HRESULT init_custom_controls(FileDialogImpl *This) ...@@ -1567,7 +1560,7 @@ static HRESULT init_custom_controls(FileDialogImpl *This)
wc.hCursor = LoadCursorW(0, (LPWSTR)IDC_ARROW); wc.hCursor = LoadCursorW(0, (LPWSTR)IDC_ARROW);
wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1); wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
wc.lpszMenuName = NULL; wc.lpszMenuName = NULL;
wc.lpszClassName = radiobuttonlistW; wc.lpszClassName = L"RadioButtonList";
if (!RegisterClassW(&wc)) if (!RegisterClassW(&wc))
ERR("Failed to register RadioButtonList window class.\n"); ERR("Failed to register RadioButtonList window class.\n");
...@@ -1970,12 +1963,9 @@ static void update_control_text(FileDialogImpl *This) ...@@ -1970,12 +1963,9 @@ static void update_control_text(FileDialogImpl *This)
static LRESULT CALLBACK dropdown_subclass_proc(HWND hwnd, UINT umessage, WPARAM wparam, LPARAM lparam) static LRESULT CALLBACK dropdown_subclass_proc(HWND hwnd, UINT umessage, WPARAM wparam, LPARAM lparam)
{ {
static const WCHAR prop_this[] = {'i','t','e','m','d','l','g','_','T','h','i','s',0};
static const WCHAR prop_oldwndproc[] = {'i','t','e','m','d','l','g','_','o','l','d','w','n','d','p','r','o','c',0};
if (umessage == WM_LBUTTONDOWN) if (umessage == WM_LBUTTONDOWN)
{ {
FileDialogImpl *This = GetPropW(hwnd, prop_this); FileDialogImpl *This = GetPropW(hwnd, L"itemdlg_This");
SendMessageW(hwnd, BM_SETCHECK, BST_CHECKED, 0); SendMessageW(hwnd, BM_SETCHECK, BST_CHECKED, 0);
show_opendropdown(This); show_opendropdown(This);
...@@ -1984,7 +1974,7 @@ static LRESULT CALLBACK dropdown_subclass_proc(HWND hwnd, UINT umessage, WPARAM ...@@ -1984,7 +1974,7 @@ static LRESULT CALLBACK dropdown_subclass_proc(HWND hwnd, UINT umessage, WPARAM
return 0; return 0;
} }
return CallWindowProcW((WNDPROC)GetPropW(hwnd, prop_oldwndproc), hwnd, umessage, wparam, lparam); return CallWindowProcW((WNDPROC)GetPropW(hwnd, L"itemdlg_oldwndproc"), hwnd, umessage, wparam, lparam);
} }
static LRESULT on_wm_initdialog(HWND hwnd, LPARAM lParam) static LRESULT on_wm_initdialog(HWND hwnd, LPARAM lParam)
...@@ -2047,9 +2037,6 @@ static LRESULT on_wm_initdialog(HWND hwnd, LPARAM lParam) ...@@ -2047,9 +2037,6 @@ static LRESULT on_wm_initdialog(HWND hwnd, LPARAM lParam)
HWND dropdown_hwnd; HWND dropdown_hwnd;
LOGFONTW lfw, lfw_marlett; LOGFONTW lfw, lfw_marlett;
HFONT dialog_font; HFONT dialog_font;
static const WCHAR marlett[] = {'M','a','r','l','e','t','t',0};
static const WCHAR prop_this[] = {'i','t','e','m','d','l','g','_','T','h','i','s',0};
static const WCHAR prop_oldwndproc[] = {'i','t','e','m','d','l','g','_','o','l','d','w','n','d','p','r','o','c',0};
dropdown_hwnd = GetDlgItem(This->dlg_hwnd, psh1); dropdown_hwnd = GetDlgItem(This->dlg_hwnd, psh1);
...@@ -2059,7 +2046,7 @@ static LRESULT on_wm_initdialog(HWND hwnd, LPARAM lParam) ...@@ -2059,7 +2046,7 @@ static LRESULT on_wm_initdialog(HWND hwnd, LPARAM lParam)
GetObjectW(dialog_font, sizeof(lfw), &lfw); GetObjectW(dialog_font, sizeof(lfw), &lfw);
memset(&lfw_marlett, 0, sizeof(lfw_marlett)); memset(&lfw_marlett, 0, sizeof(lfw_marlett));
lstrcpyW(lfw_marlett.lfFaceName, marlett); lstrcpyW(lfw_marlett.lfFaceName, L"Marlett");
lfw_marlett.lfHeight = lfw.lfHeight; lfw_marlett.lfHeight = lfw.lfHeight;
lfw_marlett.lfCharSet = SYMBOL_CHARSET; lfw_marlett.lfCharSet = SYMBOL_CHARSET;
...@@ -2068,8 +2055,8 @@ static LRESULT on_wm_initdialog(HWND hwnd, LPARAM lParam) ...@@ -2068,8 +2055,8 @@ static LRESULT on_wm_initdialog(HWND hwnd, LPARAM lParam)
SendMessageW(dropdown_hwnd, WM_SETFONT, (LPARAM)This->hfont_opendropdown, 0); SendMessageW(dropdown_hwnd, WM_SETFONT, (LPARAM)This->hfont_opendropdown, 0);
/* Subclass button so we can handle LBUTTONDOWN */ /* Subclass button so we can handle LBUTTONDOWN */
SetPropW(dropdown_hwnd, prop_this, This); SetPropW(dropdown_hwnd, L"itemdlg_This", This);
SetPropW(dropdown_hwnd, prop_oldwndproc, SetPropW(dropdown_hwnd, L"itemdlg_oldwndproc",
(HANDLE)SetWindowLongPtrW(dropdown_hwnd, GWLP_WNDPROC, (LONG_PTR)dropdown_subclass_proc)); (HANDLE)SetWindowLongPtrW(dropdown_hwnd, GWLP_WNDPROC, (LONG_PTR)dropdown_subclass_proc));
} }
...@@ -3837,7 +3824,7 @@ static HRESULT WINAPI IFileDialogCustomize_fnAddRadioButtonList(IFileDialogCusto ...@@ -3837,7 +3824,7 @@ static HRESULT WINAPI IFileDialogCustomize_fnAddRadioButtonList(IFileDialogCusto
HRESULT hr; HRESULT hr;
TRACE("%p (%d)\n", This, dwIDCtl); TRACE("%p (%d)\n", This, dwIDCtl);
hr = cctrl_create_new(This, dwIDCtl, NULL, radiobuttonlistW, 0, 0, 0, &ctrl); hr = cctrl_create_new(This, dwIDCtl, NULL, L"RadioButtonList", 0, 0, 0, &ctrl);
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
{ {
ctrl->type = IDLG_CCTRL_RADIOBUTTONLIST; ctrl->type = IDLG_CCTRL_RADIOBUTTONLIST;
......
...@@ -141,13 +141,8 @@ static WNDPROC lpfnStaticWndProc; ...@@ -141,13 +141,8 @@ static WNDPROC lpfnStaticWndProc;
static WNDPROC edit_wndproc; static WNDPROC edit_wndproc;
/* the text of the fake document to render for the Page Setup dialog */ /* the text of the fake document to render for the Page Setup dialog */
static WCHAR wszFakeDocumentText[1024]; static WCHAR wszFakeDocumentText[1024];
static const WCHAR pd32_collateW[] = { 'P', 'D', '3', '2', '_', 'C', 'O', 'L', 'L', 'A', 'T', 'E', 0 }; static const WCHAR printdlg_prop[] = L"__WINE_PRINTDLGDATA";
static const WCHAR pd32_nocollateW[] = { 'P', 'D', '3', '2', '_', 'N', 'O', 'C', 'O', 'L', 'L', 'A', 'T', 'E', 0 }; static const WCHAR pagesetupdlg_prop[] = L"__WINE_PAGESETUPDLGDATA";
static const WCHAR pd32_portraitW[] = { 'P', 'D', '3', '2', '_', 'P', 'O', 'R', 'T', 'R', 'A', 'I', 'T', 0 };
static const WCHAR pd32_landscapeW[] = { 'P', 'D', '3', '2', '_', 'L', 'A', 'N', 'D', 'S', 'C', 'A', 'P', 'E', 0 };
static const WCHAR printdlg_prop[] = {'_','_','W','I','N','E','_','P','R','I','N','T','D','L','G','D','A','T','A',0};
static const WCHAR pagesetupdlg_prop[] = { '_', '_', 'W', 'I', 'N', 'E', '_', 'P', 'A', 'G', 'E',
'S', 'E', 'T', 'U', 'P', 'D', 'L', 'G', 'D', 'A', 'T', 'A', 0 };
static LPWSTR strdupW(LPCWSTR p) static LPWSTR strdupW(LPCWSTR p)
...@@ -735,7 +730,7 @@ static BOOL PRINTDLG_UpdatePrintDlgW(HWND hDlg, ...@@ -735,7 +730,7 @@ static BOOL PRINTDLG_UpdatePrintDlgW(HWND hDlg,
lppd->Flags &= ~PD_SELECTION; lppd->Flags &= ~PD_SELECTION;
if (IsDlgButtonChecked(hDlg, chx1) == BST_CHECKED) {/* Print to file */ if (IsDlgButtonChecked(hDlg, chx1) == BST_CHECKED) {/* Print to file */
static WCHAR file[] = {'F','I','L','E',':',0}; static WCHAR file[] = L"FILE:";
lppd->Flags |= PD_PRINTTOFILE; lppd->Flags |= PD_PRINTTOFILE;
pi->pPortName = file; pi->pPortName = file;
} }
...@@ -1039,7 +1034,6 @@ static void PRINTDLG_UpdatePrinterInfoTextsW(HWND hDlg, const PRINTER_INFO_2W *p ...@@ -1039,7 +1034,6 @@ static void PRINTDLG_UpdatePrinterInfoTextsW(HWND hDlg, const PRINTER_INFO_2W *p
{ {
WCHAR StatusMsg[256]; WCHAR StatusMsg[256];
WCHAR ResourceString[256]; WCHAR ResourceString[256];
static const WCHAR emptyW[] = {0};
int i; int i;
/* Status Message */ /* Status Message */
...@@ -1067,7 +1061,7 @@ static void PRINTDLG_UpdatePrinterInfoTextsW(HWND hDlg, const PRINTER_INFO_2W *p ...@@ -1067,7 +1061,7 @@ static void PRINTDLG_UpdatePrinterInfoTextsW(HWND hDlg, const PRINTER_INFO_2W *p
SetDlgItemTextW(hDlg, stc14, pi->pLocation); SetDlgItemTextW(hDlg, stc14, pi->pLocation);
else else
SetDlgItemTextW(hDlg, stc14, pi->pPortName); SetDlgItemTextW(hDlg, stc14, pi->pPortName);
SetDlgItemTextW(hDlg, stc13, pi->pComment ? pi->pComment : emptyW); SetDlgItemTextW(hDlg, stc13, pi->pComment ? pi->pComment : L"");
} }
...@@ -1582,15 +1576,15 @@ static LRESULT PRINTDLG_WMInitDialogW(HWND hDlg, ...@@ -1582,15 +1576,15 @@ static LRESULT PRINTDLG_WMInitDialogW(HWND hDlg,
/* We load these with LoadImage because they are not a standard /* We load these with LoadImage because they are not a standard
size and we don't want them rescaled */ size and we don't want them rescaled */
PrintStructures->hCollateIcon = PrintStructures->hCollateIcon =
LoadImageW(COMDLG32_hInstance, pd32_collateW, IMAGE_ICON, 0, 0, 0); LoadImageW(COMDLG32_hInstance, L"PD32_COLLATE", IMAGE_ICON, 0, 0, 0);
PrintStructures->hNoCollateIcon = PrintStructures->hNoCollateIcon =
LoadImageW(COMDLG32_hInstance, pd32_nocollateW, IMAGE_ICON, 0, 0, 0); LoadImageW(COMDLG32_hInstance, L"PD32_NOCOLLATE", IMAGE_ICON, 0, 0, 0);
/* These can be done with LoadIcon */ /* These can be done with LoadIcon */
PrintStructures->hPortraitIcon = PrintStructures->hPortraitIcon =
LoadIconW(COMDLG32_hInstance, pd32_portraitW); LoadIconW(COMDLG32_hInstance, L"PD32_PORTRAIT");
PrintStructures->hLandscapeIcon = PrintStructures->hLandscapeIcon =
LoadIconW(COMDLG32_hInstance, pd32_landscapeW); LoadIconW(COMDLG32_hInstance, L"PD32_LANDSCAPE");
/* display the collate/no_collate icon */ /* display the collate/no_collate icon */
SendDlgItemMessageW(hDlg, ico3, STM_SETIMAGE, IMAGE_ICON, SendDlgItemMessageW(hDlg, ico3, STM_SETIMAGE, IMAGE_ICON,
...@@ -2140,8 +2134,6 @@ static HGLOBAL PRINTDLG_GetDlgTemplateW(const PRINTDLGW *lppd) ...@@ -2140,8 +2134,6 @@ static HGLOBAL PRINTDLG_GetDlgTemplateW(const PRINTDLGW *lppd)
{ {
HRSRC hResInfo; HRSRC hResInfo;
HGLOBAL hDlgTmpl; HGLOBAL hDlgTmpl;
static const WCHAR xpsetup[] = { 'P','R','I','N','T','3','2','_','S','E','T','U','P',0};
static const WCHAR xprint[] = { 'P','R','I','N','T','3','2',0};
if (lppd->Flags & PD_PRINTSETUP) { if (lppd->Flags & PD_PRINTSETUP) {
if(lppd->Flags & PD_ENABLESETUPTEMPLATEHANDLE) { if(lppd->Flags & PD_ENABLESETUPTEMPLATEHANDLE) {
...@@ -2151,7 +2143,7 @@ static HGLOBAL PRINTDLG_GetDlgTemplateW(const PRINTDLGW *lppd) ...@@ -2151,7 +2143,7 @@ static HGLOBAL PRINTDLG_GetDlgTemplateW(const PRINTDLGW *lppd)
lppd->lpSetupTemplateName, (LPWSTR)RT_DIALOG); lppd->lpSetupTemplateName, (LPWSTR)RT_DIALOG);
hDlgTmpl = LoadResource(lppd->hInstance, hResInfo); hDlgTmpl = LoadResource(lppd->hInstance, hResInfo);
} else { } else {
hResInfo = FindResourceW(COMDLG32_hInstance, xpsetup, (LPWSTR)RT_DIALOG); hResInfo = FindResourceW(COMDLG32_hInstance, L"PRINT32_SETUP", (LPWSTR)RT_DIALOG);
hDlgTmpl = LoadResource(COMDLG32_hInstance, hResInfo); hDlgTmpl = LoadResource(COMDLG32_hInstance, hResInfo);
} }
} else { } else {
...@@ -2163,7 +2155,7 @@ static HGLOBAL PRINTDLG_GetDlgTemplateW(const PRINTDLGW *lppd) ...@@ -2163,7 +2155,7 @@ static HGLOBAL PRINTDLG_GetDlgTemplateW(const PRINTDLGW *lppd)
(LPWSTR)RT_DIALOG); (LPWSTR)RT_DIALOG);
hDlgTmpl = LoadResource(lppd->hInstance, hResInfo); hDlgTmpl = LoadResource(lppd->hInstance, hResInfo);
} else { } else {
hResInfo = FindResourceW(COMDLG32_hInstance, xprint, (LPWSTR)RT_DIALOG); hResInfo = FindResourceW(COMDLG32_hInstance, L"PRINT32", (LPWSTR)RT_DIALOG);
hDlgTmpl = LoadResource(COMDLG32_hInstance, hResInfo); hDlgTmpl = LoadResource(COMDLG32_hInstance, hResInfo);
} }
} }
...@@ -2608,7 +2600,7 @@ static WCHAR get_decimal_sep(void) ...@@ -2608,7 +2600,7 @@ static WCHAR get_decimal_sep(void)
if(!sep) if(!sep)
{ {
WCHAR buf[] = {'.', 0}; WCHAR buf[] = L".";
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, buf, ARRAY_SIZE(buf)); GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, buf, ARRAY_SIZE(buf));
sep = buf[0]; sep = buf[0];
} }
...@@ -2617,25 +2609,21 @@ static WCHAR get_decimal_sep(void) ...@@ -2617,25 +2609,21 @@ static WCHAR get_decimal_sep(void)
static void size2str(const pagesetup_data *data, DWORD size, LPWSTR strout) static void size2str(const pagesetup_data *data, DWORD size, LPWSTR strout)
{ {
static const WCHAR integer_fmt[] = {'%','d',0};
static const WCHAR hundredths_fmt[] = {'%','d','%','c','%','0','2','d',0};
static const WCHAR thousandths_fmt[] = {'%','d','%','c','%','0','3','d',0};
/* FIXME use LOCALE_SDECIMAL when the edit parsing code can cope */ /* FIXME use LOCALE_SDECIMAL when the edit parsing code can cope */
if (is_metric(data)) if (is_metric(data))
{ {
if(size % 100) if(size % 100)
wsprintfW(strout, hundredths_fmt, size / 100, get_decimal_sep(), size % 100); wsprintfW(strout, L"%d%c%02d", size / 100, get_decimal_sep(), size % 100);
else else
wsprintfW(strout, integer_fmt, size / 100); wsprintfW(strout, L"%d", size / 100);
} }
else else
{ {
if(size % 1000) if(size % 1000)
wsprintfW(strout, thousandths_fmt, size / 1000, get_decimal_sep(), size % 1000); wsprintfW(strout, L"%d%c%03d", size / 1000, get_decimal_sep(), size % 1000);
else else
wsprintfW(strout, integer_fmt, size / 1000); wsprintfW(strout, L"%d", size / 1000);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment