wineconsole: Use the explicit W types/functions in dialog.c.

This commit is contained in:
Michael Stefaniuc 2010-04-28 01:08:48 +02:00 committed by Alexandre Julliard
parent f6217640be
commit fe0c5cb68a
1 changed files with 126 additions and 129 deletions

View File

@ -65,23 +65,23 @@ static INT_PTR WINAPI WCUSER_OptionDlgProc(HWND hDlg, UINT msg, WPARAM wParam, L
case WM_INITDIALOG:
di = (struct dialog_info*)((PROPSHEETPAGEA*)lParam)->lParam;
di->hDlg = hDlg;
SetWindowLongPtr(hDlg, DWLP_USER, (LONG_PTR)di);
SetWindowLongPtrW(hDlg, DWLP_USER, (LONG_PTR)di);
SendMessage(GetDlgItem(hDlg,IDC_OPT_HIST_SIZE_UD), UDM_SETRANGE, 0, MAKELPARAM (500, 0));
SendMessageW(GetDlgItem(hDlg,IDC_OPT_HIST_SIZE_UD), UDM_SETRANGE, 0, MAKELPARAM(500, 0));
if (di->config.cursor_size <= 25) idc = IDC_OPT_CURSOR_SMALL;
else if (di->config.cursor_size <= 50) idc = IDC_OPT_CURSOR_MEDIUM;
else idc = IDC_OPT_CURSOR_LARGE;
SendDlgItemMessage(hDlg, idc, BM_SETCHECK, BST_CHECKED, 0L);
SendDlgItemMessageW(hDlg, idc, BM_SETCHECK, BST_CHECKED, 0);
SetDlgItemInt(hDlg, IDC_OPT_HIST_SIZE, di->config.history_size, FALSE);
SendDlgItemMessage(hDlg, IDC_OPT_HIST_NODOUBLE, BM_SETCHECK,
(di->config.history_nodup) ? BST_CHECKED : BST_UNCHECKED, 0L);
SendDlgItemMessage(hDlg, IDC_OPT_CONF_CTRL, BM_SETCHECK,
(di->config.menu_mask & MK_CONTROL) ? BST_CHECKED : BST_UNCHECKED, 0L);
SendDlgItemMessage(hDlg, IDC_OPT_CONF_SHIFT, BM_SETCHECK,
(di->config.menu_mask & MK_SHIFT) ? BST_CHECKED : BST_UNCHECKED, 0L);
SendDlgItemMessage(hDlg, IDC_OPT_QUICK_EDIT, BM_SETCHECK,
(di->config.quick_edit) ? BST_CHECKED : BST_UNCHECKED, 0L);
SendDlgItemMessageW(hDlg, IDC_OPT_HIST_NODOUBLE, BM_SETCHECK,
(di->config.history_nodup) ? BST_CHECKED : BST_UNCHECKED, 0);
SendDlgItemMessageW(hDlg, IDC_OPT_CONF_CTRL, BM_SETCHECK,
(di->config.menu_mask & MK_CONTROL) ? BST_CHECKED : BST_UNCHECKED, 0);
SendDlgItemMessageW(hDlg, IDC_OPT_CONF_SHIFT, BM_SETCHECK,
(di->config.menu_mask & MK_SHIFT) ? BST_CHECKED : BST_UNCHECKED, 0);
SendDlgItemMessageW(hDlg, IDC_OPT_QUICK_EDIT, BM_SETCHECK,
(di->config.quick_edit) ? BST_CHECKED : BST_UNCHECKED, 0);
return FALSE; /* because we set the focus */
case WM_COMMAND:
break;
@ -91,7 +91,7 @@ static INT_PTR WINAPI WCUSER_OptionDlgProc(HWND hDlg, UINT msg, WPARAM wParam, L
DWORD val;
BOOL done;
di = (struct dialog_info*)GetWindowLongPtr(hDlg, DWLP_USER);
di = (struct dialog_info*)GetWindowLongPtrW(hDlg, DWLP_USER);
switch (nmhdr->code)
{
@ -106,7 +106,7 @@ static INT_PTR WINAPI WCUSER_OptionDlgProc(HWND hDlg, UINT msg, WPARAM wParam, L
idc = IDC_OPT_CURSOR_MEDIUM;
else
idc = IDC_OPT_CURSOR_LARGE;
PostMessage(hDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hDlg, idc), TRUE);
PostMessageW(hDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hDlg, idc), TRUE);
di->hDlg = hDlg;
break;
case PSN_APPLY:
@ -129,7 +129,7 @@ static INT_PTR WINAPI WCUSER_OptionDlgProc(HWND hDlg, UINT msg, WPARAM wParam, L
val = (IsDlgButtonChecked(hDlg, IDC_OPT_QUICK_EDIT) & BST_CHECKED) ? TRUE : FALSE;
di->config.quick_edit = val;
SetWindowLongPtr(hDlg, DWLP_MSGRESULT, PSNRET_NOERROR);
SetWindowLongPtrW(hDlg, DWLP_MSGRESULT, PSNRET_NOERROR);
return TRUE;
default:
return FALSE;
@ -152,12 +152,12 @@ static LRESULT WINAPI WCUSER_FontPreviewProc(HWND hWnd, UINT msg, WPARAM wParam,
switch (msg)
{
case WM_CREATE:
SetWindowLongPtr(hWnd, 0, 0);
SetWindowLongPtrW(hWnd, 0, 0);
break;
case WM_GETFONT:
return GetWindowLongPtr(hWnd, 0);
return GetWindowLongPtrW(hWnd, 0);
case WM_SETFONT:
SetWindowLongPtr(hWnd, 0, wParam);
SetWindowLongPtrW(hWnd, 0, wParam);
if (LOWORD(lParam))
{
InvalidateRect(hWnd, NULL, TRUE);
@ -166,7 +166,7 @@ static LRESULT WINAPI WCUSER_FontPreviewProc(HWND hWnd, UINT msg, WPARAM wParam,
break;
case WM_DESTROY:
{
HFONT hFont = (HFONT)GetWindowLongPtr(hWnd, 0L);
HFONT hFont = (HFONT)GetWindowLongPtrW(hWnd, 0);
if (hFont) DeleteObject(hFont);
}
break;
@ -178,13 +178,13 @@ static LRESULT WINAPI WCUSER_FontPreviewProc(HWND hWnd, UINT msg, WPARAM wParam,
struct dialog_info* di;
HFONT hFont, hOldFont;
di = (struct dialog_info*)GetWindowLongPtr(GetParent(hWnd), DWLP_USER);
di = (struct dialog_info*)GetWindowLongPtrW(GetParent(hWnd), DWLP_USER);
BeginPaint(hWnd, &ps);
font_idx = SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_FONT, LB_GETCURSEL, 0L, 0L);
size_idx = SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_SIZE, LB_GETCURSEL, 0L, 0L);
font_idx = SendDlgItemMessageW(di->hDlg, IDC_FNT_LIST_FONT, LB_GETCURSEL, 0, 0);
size_idx = SendDlgItemMessageW(di->hDlg, IDC_FNT_LIST_SIZE, LB_GETCURSEL, 0, 0);
hFont = (HFONT)GetWindowLongPtr(hWnd, 0L);
hFont = (HFONT)GetWindowLongPtrW(hWnd, 0);
if (hFont)
{
WCHAR ascii[] = {'A','S','C','I','I',':',' ','a','b','c','X','Y','Z','\0'};
@ -192,21 +192,21 @@ static LRESULT WINAPI WCUSER_FontPreviewProc(HWND hWnd, UINT msg, WPARAM wParam,
int len;
hOldFont = SelectObject(ps.hdc, hFont);
SetBkColor(ps.hdc, WCUSER_ColorMap[GetWindowLong(GetDlgItem(di->hDlg, IDC_FNT_COLOR_BK), 0)]);
SetTextColor(ps.hdc, WCUSER_ColorMap[GetWindowLong(GetDlgItem(di->hDlg, IDC_FNT_COLOR_FG), 0)]);
len = LoadString(GetModuleHandle(NULL), IDS_FNT_PREVIEW,
buf, sizeof(buf) / sizeof(buf[0]));
SetBkColor(ps.hdc, WCUSER_ColorMap[GetWindowLongW(GetDlgItem(di->hDlg, IDC_FNT_COLOR_BK), 0)]);
SetTextColor(ps.hdc, WCUSER_ColorMap[GetWindowLongW(GetDlgItem(di->hDlg, IDC_FNT_COLOR_FG), 0)]);
len = LoadStringW(GetModuleHandleW(NULL), IDS_FNT_PREVIEW,
buf, sizeof(buf) / sizeof(buf[0]));
if (len)
TextOut(ps.hdc, 0, 0, buf, len);
TextOut(ps.hdc, 0, di->font[size_idx].height, ascii,
sizeof(ascii)/sizeof(ascii[0]) - 1);
TextOutW(ps.hdc, 0, 0, buf, len);
TextOutW(ps.hdc, 0, di->font[size_idx].height, ascii,
sizeof(ascii)/sizeof(ascii[0]) - 1);
SelectObject(ps.hdc, hOldFont);
}
EndPaint(hWnd, &ps);
}
break;
default:
return DefWindowProc(hWnd, msg, wParam, lParam);
return DefWindowProcW(hWnd, msg, wParam, lParam);
}
return 0L;
}
@ -240,7 +240,7 @@ static LRESULT WINAPI WCUSER_ColorPreviewProc(HWND hWnd, UINT msg, WPARAM wParam
hbr = CreateSolidBrush(WCUSER_ColorMap[i]);
FillRect(ps.hdc, &r, hbr);
DeleteObject(hbr);
if (GetWindowLong(hWnd, 0) == i)
if (GetWindowLongW(hWnd, 0) == i)
{
HPEN hOldPen;
int i = 2;
@ -275,13 +275,13 @@ static LRESULT WINAPI WCUSER_ColorPreviewProc(HWND hWnd, UINT msg, WPARAM wParam
step = client.right / 8;
i = (HIWORD(lParam) >= client.bottom / 2) ? 8 : 0;
i += LOWORD(lParam) / step;
SetWindowLong(hWnd, 0, i);
SetWindowLongW(hWnd, 0, i);
InvalidateRect(GetDlgItem(GetParent(hWnd), IDC_FNT_PREVIEW), NULL, FALSE);
InvalidateRect(hWnd, NULL, FALSE);
}
break;
default:
return DefWindowProc(hWnd, msg, wParam, lParam);
return DefWindowProcW(hWnd, msg, wParam, lParam);
}
return 0L;
}
@ -291,8 +291,8 @@ static LRESULT WINAPI WCUSER_ColorPreviewProc(HWND hWnd, UINT msg, WPARAM wParam
*
* enumerates all the font names with at least one valid font
*/
static int CALLBACK font_enum_size2(const LOGFONT* lf, const TEXTMETRIC* tm,
DWORD FontType, LPARAM lParam)
static int CALLBACK font_enum_size2(const LOGFONTW* lf, const TEXTMETRICW* tm,
DWORD FontType, LPARAM lParam)
{
struct dialog_info* di = (struct dialog_info*)lParam;
@ -305,8 +305,8 @@ static int CALLBACK font_enum_size2(const LOGFONT* lf, const TEXTMETRIC* tm,
return 1;
}
static int CALLBACK font_enum(const LOGFONT* lf, const TEXTMETRIC* tm,
DWORD FontType, LPARAM lParam)
static int CALLBACK font_enum(const LOGFONTW* lf, const TEXTMETRICW* tm,
DWORD FontType, LPARAM lParam)
{
struct dialog_info* di = (struct dialog_info*)lParam;
@ -316,15 +316,15 @@ static int CALLBACK font_enum(const LOGFONT* lf, const TEXTMETRIC* tm,
if (FontType & RASTER_FONTTYPE)
{
di->nFont = 0;
EnumFontFamilies(PRIVATE(di->data)->hMemDC, lf->lfFaceName, font_enum_size2, (LPARAM)di);
EnumFontFamiliesW(PRIVATE(di->data)->hMemDC, lf->lfFaceName, font_enum_size2, (LPARAM)di);
}
else
di->nFont = 1;
if (di->nFont)
{
SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_FONT, LB_ADDSTRING,
0, (LPARAM)lf->lfFaceName);
SendDlgItemMessageW(di->hDlg, IDC_FNT_LIST_FONT, LB_ADDSTRING,
0, (LPARAM)lf->lfFaceName);
}
}
@ -336,8 +336,8 @@ static int CALLBACK font_enum(const LOGFONT* lf, const TEXTMETRIC* tm,
*
*
*/
static int CALLBACK font_enum_size(const LOGFONT* lf, const TEXTMETRIC* tm,
DWORD FontType, LPARAM lParam)
static int CALLBACK font_enum_size(const LOGFONTW* lf, const TEXTMETRICW* tm,
DWORD FontType, LPARAM lParam)
{
struct dialog_info* di = (struct dialog_info*)lParam;
WCHAR buf[32];
@ -361,9 +361,9 @@ static int CALLBACK font_enum_size(const LOGFONT* lf, const TEXTMETRIC* tm,
}
di->font[i].height = sizes[i];
di->font[i].weight = 400;
lstrcpy(di->font[i].faceName, lf->lfFaceName);
wsprintf(buf, fmt, sizes[i]);
SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_SIZE, LB_INSERTSTRING, i, (LPARAM)buf);
lstrcpyW(di->font[i].faceName, lf->lfFaceName);
wsprintfW(buf, fmt, sizes[i]);
SendDlgItemMessageW(di->hDlg, IDC_FNT_LIST_SIZE, LB_INSERTSTRING, i, (LPARAM)buf);
}
/* don't need to enumerate other */
return 0;
@ -386,8 +386,8 @@ static int CALLBACK font_enum_size(const LOGFONT* lf, const TEXTMETRIC* tm,
tm->tmWeight < di->font[idx].weight)
{
/* here we need to add the new entry */
wsprintf(buf, fmt, tm->tmHeight);
SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_SIZE, LB_INSERTSTRING, idx, (LPARAM)buf);
wsprintfW(buf, fmt, tm->tmHeight);
SendDlgItemMessageW(di->hDlg, IDC_FNT_LIST_SIZE, LB_INSERTSTRING, idx, (LPARAM)buf);
/* now grow our arrays and insert the values at the same index than in the list box */
if (di->nFont)
@ -400,7 +400,7 @@ static int CALLBACK font_enum_size(const LOGFONT* lf, const TEXTMETRIC* tm,
di->font = HeapAlloc(GetProcessHeap(), 0, sizeof(*di->font));
di->font[idx].height = tm->tmHeight;
di->font[idx].weight = tm->tmWeight;
lstrcpy(di->font[idx].faceName, lf->lfFaceName);
lstrcpyW(di->font[idx].faceName, lf->lfFaceName);
di->nFont++;
}
}
@ -417,12 +417,12 @@ static BOOL select_font(struct dialog_info* di)
int font_idx, size_idx;
WCHAR buf[256];
WCHAR fmt[128];
LOGFONT lf;
LOGFONTW lf;
HFONT hFont, hOldFont;
struct config_data config;
font_idx = SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_FONT, LB_GETCURSEL, 0L, 0L);
size_idx = SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_SIZE, LB_GETCURSEL, 0L, 0L);
font_idx = SendDlgItemMessageW(di->hDlg, IDC_FNT_LIST_FONT, LB_GETCURSEL, 0, 0);
size_idx = SendDlgItemMessageW(di->hDlg, IDC_FNT_LIST_SIZE, LB_GETCURSEL, 0, 0);
if (font_idx < 0 || size_idx < 0 || size_idx >= di->nFont)
return FALSE;
@ -435,15 +435,15 @@ static BOOL select_font(struct dialog_info* di)
if (config.cell_height != di->font[size_idx].height)
WINE_TRACE("mismatched heights (%u<>%u)\n",
config.cell_height, di->font[size_idx].height);
hOldFont = (HFONT)SendDlgItemMessage(di->hDlg, IDC_FNT_PREVIEW, WM_GETFONT, 0L, 0L);
hOldFont = (HFONT)SendDlgItemMessageW(di->hDlg, IDC_FNT_PREVIEW, WM_GETFONT, 0, 0);
SendDlgItemMessage(di->hDlg, IDC_FNT_PREVIEW, WM_SETFONT, (WPARAM)hFont, TRUE);
SendDlgItemMessageW(di->hDlg, IDC_FNT_PREVIEW, WM_SETFONT, (WPARAM)hFont, TRUE);
if (hOldFont) DeleteObject(hOldFont);
LoadString(GetModuleHandle(NULL), IDS_FNT_DISPLAY, fmt, sizeof(fmt) / sizeof(WCHAR));
wsprintf(buf, fmt, config.cell_width, config.cell_height);
LoadStringW(GetModuleHandleW(NULL), IDS_FNT_DISPLAY, fmt, sizeof(fmt) / sizeof(fmt[0]));
wsprintfW(buf, fmt, config.cell_width, config.cell_height);
SendDlgItemMessage(di->hDlg, IDC_FNT_FONT_INFO, WM_SETTEXT, 0, (LPARAM)buf);
SendDlgItemMessageW(di->hDlg, IDC_FNT_FONT_INFO, WM_SETTEXT, 0, (LPARAM)buf);
return TRUE;
}
@ -458,16 +458,16 @@ static BOOL fill_list_size(struct dialog_info* di, BOOL doInit)
int idx;
WCHAR lfFaceName[LF_FACESIZE];
idx = SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_FONT, LB_GETCURSEL, 0L, 0L);
idx = SendDlgItemMessageW(di->hDlg, IDC_FNT_LIST_FONT, LB_GETCURSEL, 0, 0);
if (idx < 0) return FALSE;
SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_FONT, LB_GETTEXT, idx, (LPARAM)lfFaceName);
SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_SIZE, LB_RESETCONTENT, 0L, 0L);
SendDlgItemMessageW(di->hDlg, IDC_FNT_LIST_FONT, LB_GETTEXT, idx, (LPARAM)lfFaceName);
SendDlgItemMessageW(di->hDlg, IDC_FNT_LIST_SIZE, LB_RESETCONTENT, 0, 0);
HeapFree(GetProcessHeap(), 0, di->font);
di->nFont = 0;
di->font = NULL;
EnumFontFamilies(PRIVATE(di->data)->hMemDC, lfFaceName, font_enum_size, (LPARAM)di);
EnumFontFamiliesW(PRIVATE(di->data)->hMemDC, lfFaceName, font_enum_size, (LPARAM)di);
if (doInit)
{
@ -475,7 +475,7 @@ static BOOL fill_list_size(struct dialog_info* di, BOOL doInit)
for (idx = 0; idx < di->nFont; idx++)
{
if (!lstrcmp(di->font[idx].faceName, di->config.face_name) &&
if (!lstrcmpW(di->font[idx].faceName, di->config.face_name) &&
di->font[idx].height == di->config.cell_height &&
di->font[idx].weight == di->config.font_weight)
{
@ -487,7 +487,7 @@ static BOOL fill_list_size(struct dialog_info* di, BOOL doInit)
}
else
idx = 0;
SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_SIZE, LB_SETCURSEL, idx, 0L);
SendDlgItemMessageW(di->hDlg, IDC_FNT_LIST_SIZE, LB_SETCURSEL, idx, 0);
select_font(di);
return TRUE;
}
@ -499,11 +499,11 @@ static BOOL fill_list_size(struct dialog_info* di, BOOL doInit)
*/
static BOOL fill_list_font(struct dialog_info* di)
{
SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_FONT, LB_RESETCONTENT, 0L, 0L);
EnumFontFamilies(PRIVATE(di->data)->hMemDC, NULL, font_enum, (LPARAM)di);
if (SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_FONT, LB_SELECTSTRING,
(WPARAM)-1, (LPARAM)di->config.face_name) == LB_ERR)
SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_FONT, LB_SETCURSEL, 0L, 0L);
SendDlgItemMessageW(di->hDlg, IDC_FNT_LIST_FONT, LB_RESETCONTENT, 0, 0);
EnumFontFamiliesW(PRIVATE(di->data)->hMemDC, NULL, font_enum, (LPARAM)di);
if (SendDlgItemMessageW(di->hDlg, IDC_FNT_LIST_FONT, LB_SELECTSTRING,
-1, (LPARAM)di->config.face_name) == LB_ERR)
SendDlgItemMessageW(di->hDlg, IDC_FNT_LIST_FONT, LB_SETCURSEL, 0, 0);
fill_list_size(di, TRUE);
return TRUE;
}
@ -522,15 +522,15 @@ static INT_PTR WINAPI WCUSER_FontDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPA
case WM_INITDIALOG:
di = (struct dialog_info*)((PROPSHEETPAGEA*)lParam)->lParam;
di->hDlg = hDlg;
SetWindowLongPtr(hDlg, DWLP_USER, (DWORD_PTR)di);
SetWindowLongPtrW(hDlg, DWLP_USER, (DWORD_PTR)di);
/* remove dialog from this control, font will be reset when listboxes are filled */
SendDlgItemMessage(hDlg, IDC_FNT_PREVIEW, WM_SETFONT, 0L, 0L);
SendDlgItemMessageW(hDlg, IDC_FNT_PREVIEW, WM_SETFONT, 0, 0);
fill_list_font(di);
SetWindowLong(GetDlgItem(hDlg, IDC_FNT_COLOR_BK), 0, (di->config.def_attr >> 4) & 0x0F);
SetWindowLong(GetDlgItem(hDlg, IDC_FNT_COLOR_FG), 0, di->config.def_attr & 0x0F);
SetWindowLongW(GetDlgItem(hDlg, IDC_FNT_COLOR_BK), 0, (di->config.def_attr >> 4) & 0x0F);
SetWindowLongW(GetDlgItem(hDlg, IDC_FNT_COLOR_FG), 0, di->config.def_attr & 0x0F);
break;
case WM_COMMAND:
di = (struct dialog_info*)GetWindowLongPtr(hDlg, DWLP_USER);
di = (struct dialog_info*)GetWindowLongPtrW(hDlg, DWLP_USER);
switch (LOWORD(wParam))
{
case IDC_FNT_LIST_FONT:
@ -552,18 +552,18 @@ static INT_PTR WINAPI WCUSER_FontDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPA
NMHDR* nmhdr = (NMHDR*)lParam;
DWORD val;
di = (struct dialog_info*)GetWindowLongPtr(hDlg, DWLP_USER);
di = (struct dialog_info*)GetWindowLongPtrW(hDlg, DWLP_USER);
switch (nmhdr->code)
{
case PSN_SETACTIVE:
di->hDlg = hDlg;
break;
case PSN_APPLY:
val = SendDlgItemMessage(hDlg, IDC_FNT_LIST_SIZE, LB_GETCURSEL, 0L, 0L);
val = SendDlgItemMessageW(hDlg, IDC_FNT_LIST_SIZE, LB_GETCURSEL, 0, 0);
if (val < di->nFont)
{
LOGFONT lf;
LOGFONTW lf;
WCUSER_FillLogFont(&lf, di->font[val].faceName,
di->font[val].height, di->font[val].weight);
@ -571,11 +571,11 @@ static INT_PTR WINAPI WCUSER_FontDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPA
di->data->hWnd, &lf, NULL));
}
val = (GetWindowLong(GetDlgItem(hDlg, IDC_FNT_COLOR_BK), 0) << 4) |
GetWindowLong(GetDlgItem(hDlg, IDC_FNT_COLOR_FG), 0);
val = (GetWindowLongW(GetDlgItem(hDlg, IDC_FNT_COLOR_BK), 0) << 4) |
GetWindowLongW(GetDlgItem(hDlg, IDC_FNT_COLOR_FG), 0);
di->config.def_attr = val;
SetWindowLongPtr(hDlg, DWLP_MSGRESULT, PSNRET_NOERROR);
SetWindowLongPtrW(hDlg, DWLP_MSGRESULT, PSNRET_NOERROR);
return TRUE;
default:
return FALSE;
@ -604,34 +604,31 @@ static INT_PTR WINAPI WCUSER_ConfigDlgProc(HWND hDlg, UINT msg, WPARAM wParam, L
di = (struct dialog_info*)((PROPSHEETPAGEA*)lParam)->lParam;
di->hDlg = hDlg;
SetWindowLongPtr(hDlg, DWLP_USER, (DWORD_PTR)di);
SetWindowLongPtrW(hDlg, DWLP_USER, (DWORD_PTR)di);
SetDlgItemInt(hDlg, IDC_CNF_SB_WIDTH, di->config.sb_width, FALSE);
SetDlgItemInt(hDlg, IDC_CNF_SB_HEIGHT, di->config.sb_height, FALSE);
SetDlgItemInt(hDlg, IDC_CNF_WIN_WIDTH, di->config.win_width, FALSE);
SetDlgItemInt(hDlg, IDC_CNF_WIN_HEIGHT, di->config.win_height, FALSE);
SendMessage(GetDlgItem(hDlg,IDC_CNF_WIN_HEIGHT_UD), UDM_SETRANGE, 0, MAKELPARAM (nMaxUD, 0));
SendMessage(GetDlgItem(hDlg,IDC_CNF_WIN_WIDTH_UD), UDM_SETRANGE, 0, MAKELPARAM (nMaxUD, 0));
SendMessage(GetDlgItem(hDlg,IDC_CNF_SB_HEIGHT_UD), UDM_SETRANGE, 0, MAKELPARAM (nMaxUD, 0));
SendMessage(GetDlgItem(hDlg,IDC_CNF_SB_WIDTH_UD), UDM_SETRANGE, 0, MAKELPARAM (nMaxUD, 0));
SendMessageW(GetDlgItem(hDlg,IDC_CNF_WIN_HEIGHT_UD), UDM_SETRANGE, 0, MAKELPARAM(nMaxUD, 0));
SendMessageW(GetDlgItem(hDlg,IDC_CNF_WIN_WIDTH_UD), UDM_SETRANGE, 0, MAKELPARAM(nMaxUD, 0));
SendMessageW(GetDlgItem(hDlg,IDC_CNF_SB_HEIGHT_UD), UDM_SETRANGE, 0, MAKELPARAM(nMaxUD, 0));
SendMessageW(GetDlgItem(hDlg,IDC_CNF_SB_WIDTH_UD), UDM_SETRANGE, 0, MAKELPARAM(nMaxUD, 0));
SendDlgItemMessage(hDlg, IDC_CNF_CLOSE_EXIT, BM_SETCHECK,
(di->config.exit_on_die) ? BST_CHECKED : BST_UNCHECKED, 0L);
SendDlgItemMessageW(hDlg, IDC_CNF_CLOSE_EXIT, BM_SETCHECK,
(di->config.exit_on_die) ? BST_CHECKED : BST_UNCHECKED, 0);
{
static const WCHAR s1[] = {'W','i','n','3','2',0};
static const WCHAR s2[] = {'E','m','a','c','s',0};
SendDlgItemMessage(hDlg, IDC_CNF_EDITION_MODE, CB_ADDSTRING,
0, (LPARAM)s1);
SendDlgItemMessage(hDlg, IDC_CNF_EDITION_MODE, CB_ADDSTRING,
0, (LPARAM)s2);
SendDlgItemMessage(hDlg, IDC_CNF_EDITION_MODE, CB_SETCURSEL,
di->config.edition_mode, 0);
SendDlgItemMessageW(hDlg, IDC_CNF_EDITION_MODE, CB_ADDSTRING, 0, (LPARAM)s1);
SendDlgItemMessageW(hDlg, IDC_CNF_EDITION_MODE, CB_ADDSTRING, 0, (LPARAM)s2);
SendDlgItemMessageW(hDlg, IDC_CNF_EDITION_MODE, CB_SETCURSEL, di->config.edition_mode, 0);
}
break;
case WM_COMMAND:
di = (struct dialog_info*)GetWindowLongPtr(hDlg, DWLP_USER);
di = (struct dialog_info*)GetWindowLongPtrW(hDlg, DWLP_USER);
switch (LOWORD(wParam))
{
}
@ -642,7 +639,7 @@ static INT_PTR WINAPI WCUSER_ConfigDlgProc(HWND hDlg, UINT msg, WPARAM wParam, L
int win_w, win_h, sb_w, sb_h;
BOOL st1, st2;
di = (struct dialog_info*)GetWindowLongPtr(hDlg, DWLP_USER);
di = (struct dialog_info*)GetWindowLongPtrW(hDlg, DWLP_USER);
switch (nmhdr->code)
{
case PSN_SETACTIVE:
@ -653,14 +650,14 @@ static INT_PTR WINAPI WCUSER_ConfigDlgProc(HWND hDlg, UINT msg, WPARAM wParam, L
sb_h = GetDlgItemInt(hDlg, IDC_CNF_SB_HEIGHT, &st2, FALSE);
if (!st1 || ! st2)
{
SetWindowLongPtr(hDlg, DWLP_MSGRESULT, PSNRET_INVALID);
SetWindowLongPtrW(hDlg, DWLP_MSGRESULT, PSNRET_INVALID);
return TRUE;
}
win_w = GetDlgItemInt(hDlg, IDC_CNF_WIN_WIDTH, &st1, FALSE);
win_h = GetDlgItemInt(hDlg, IDC_CNF_WIN_HEIGHT, &st2, FALSE);
if (!st1 || !st2)
{
SetWindowLongPtr(hDlg, DWLP_MSGRESULT, PSNRET_INVALID);
SetWindowLongPtrW(hDlg, DWLP_MSGRESULT, PSNRET_INVALID);
return TRUE;
}
if (win_w > sb_w || win_h > sb_h)
@ -668,13 +665,13 @@ static INT_PTR WINAPI WCUSER_ConfigDlgProc(HWND hDlg, UINT msg, WPARAM wParam, L
WCHAR cap[256];
WCHAR txt[256];
LoadString(GetModuleHandle(NULL), IDS_DLG_TIT_ERROR,
cap, sizeof(cap) / sizeof(WCHAR));
LoadString(GetModuleHandle(NULL), IDS_DLG_ERR_SBWINSIZE,
txt, sizeof(txt) / sizeof(WCHAR));
MessageBox(hDlg, txt, cap, MB_OK);
SetWindowLongPtr(hDlg, DWLP_MSGRESULT, PSNRET_INVALID);
LoadStringW(GetModuleHandleW(NULL), IDS_DLG_TIT_ERROR,
cap, sizeof(cap) / sizeof(cap[0]));
LoadStringW(GetModuleHandleW(NULL), IDS_DLG_ERR_SBWINSIZE,
txt, sizeof(txt) / sizeof(cap[0]));
MessageBoxW(hDlg, txt, cap, MB_OK);
SetWindowLongPtrW(hDlg, DWLP_MSGRESULT, PSNRET_INVALID);
return TRUE;
}
di->config.win_width = win_w;
@ -683,9 +680,9 @@ static INT_PTR WINAPI WCUSER_ConfigDlgProc(HWND hDlg, UINT msg, WPARAM wParam, L
di->config.sb_height = sb_h;
di->config.exit_on_die = IsDlgButtonChecked(hDlg, IDC_CNF_CLOSE_EXIT) ? 1 : 0;
di->config.edition_mode = SendDlgItemMessage(hDlg, IDC_CNF_EDITION_MODE, CB_GETCURSEL,
0, 0);
SetWindowLongPtr(hDlg, DWLP_MSGRESULT, PSNRET_NOERROR);
di->config.edition_mode = SendDlgItemMessageW(hDlg, IDC_CNF_EDITION_MODE,
CB_GETCURSEL, 0, 0);
SetWindowLongPtrW(hDlg, DWLP_MSGRESULT, PSNRET_NOERROR);
return TRUE;
default:
return FALSE;
@ -709,7 +706,7 @@ static INT_PTR WINAPI WCUSER_SaveDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPA
switch (msg)
{
case WM_INITDIALOG:
SendDlgItemMessage(hDlg, IDC_SAV_SESSION, BM_SETCHECK, BST_CHECKED, 0);
SendDlgItemMessageW(hDlg, IDC_SAV_SESSION, BM_SETCHECK, BST_CHECKED, 0);
break;
case WM_COMMAND:
switch (LOWORD(wParam))
@ -736,11 +733,11 @@ static INT_PTR WINAPI WCUSER_SaveDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPA
*/
BOOL WCUSER_GetProperties(struct inner_data* data, BOOL current)
{
HPROPSHEETPAGE psPage[3];
PROPSHEETPAGE psp;
PROPSHEETHEADER psHead;
WCHAR buff[256];
WNDCLASS wndclass;
HPROPSHEETPAGE psPage[3];
PROPSHEETPAGEW psp;
PROPSHEETHEADERW psHead;
WCHAR buff[256];
WNDCLASSW wndclass;
static const WCHAR szFntPreview[] = {'W','i','n','e','C','o','n','F','o','n','t','P','r','e','v','i','e','w',0};
static const WCHAR szColorPreview[] = {'W','i','n','e','C','o','n','C','o','l','o','r','P','r','e','v','i','e','w',0};
struct dialog_info di;
@ -771,25 +768,25 @@ BOOL WCUSER_GetProperties(struct inner_data* data, BOOL current)
wndclass.lpfnWndProc = WCUSER_FontPreviewProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = sizeof (DWORD_PTR); /* for hFont */
wndclass.hInstance = GetModuleHandle(NULL);
wndclass.hInstance = GetModuleHandleW(NULL);
wndclass.hIcon = 0;
wndclass.hCursor = LoadCursor(0, IDC_ARROW);
wndclass.hCursor = LoadCursorW(0, (LPCWSTR)IDC_ARROW);
wndclass.hbrBackground = GetStockObject(BLACK_BRUSH);
wndclass.lpszMenuName = NULL;
wndclass.lpszClassName = szFntPreview;
RegisterClass(&wndclass);
RegisterClassW(&wndclass);
wndclass.style = 0;
wndclass.lpfnWndProc = WCUSER_ColorPreviewProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = sizeof(DWORD);
wndclass.hInstance = GetModuleHandle(NULL);
wndclass.hInstance = GetModuleHandleW(NULL);
wndclass.hIcon = 0;
wndclass.hCursor = LoadCursor(0, IDC_ARROW);
wndclass.hCursor = LoadCursorW(0, (LPCWSTR)IDC_ARROW);
wndclass.hbrBackground = GetStockObject(BLACK_BRUSH);
wndclass.lpszMenuName = NULL;
wndclass.lpszClassName = szColorPreview;
RegisterClass(&wndclass);
RegisterClassW(&wndclass);
memset(&psp, 0, sizeof(psp));
psp.dwSize = sizeof(psp);
@ -797,24 +794,24 @@ BOOL WCUSER_GetProperties(struct inner_data* data, BOOL current)
psp.hInstance = wndclass.hInstance;
psp.lParam = (LPARAM)&di;
psp.u.pszTemplate = MAKEINTRESOURCE(IDD_OPTION);
psp.u.pszTemplate = MAKEINTRESOURCEW(IDD_OPTION);
psp.pfnDlgProc = WCUSER_OptionDlgProc;
psPage[0] = CreatePropertySheetPage(&psp);
psPage[0] = CreatePropertySheetPageW(&psp);
psp.u.pszTemplate = MAKEINTRESOURCE(IDD_FONT);
psp.u.pszTemplate = MAKEINTRESOURCEW(IDD_FONT);
psp.pfnDlgProc = WCUSER_FontDlgProc;
psPage[1] = CreatePropertySheetPage(&psp);
psPage[1] = CreatePropertySheetPageW(&psp);
psp.u.pszTemplate = MAKEINTRESOURCE(IDD_CONFIG);
psp.u.pszTemplate = MAKEINTRESOURCEW(IDD_CONFIG);
psp.pfnDlgProc = WCUSER_ConfigDlgProc;
psPage[2] = CreatePropertySheetPage(&psp);
psPage[2] = CreatePropertySheetPageW(&psp);
memset(&psHead, 0, sizeof(psHead));
psHead.dwSize = sizeof(psHead);
if (!LoadString(GetModuleHandle(NULL),
(current) ? IDS_DLG_TIT_CURRENT : IDS_DLG_TIT_DEFAULT,
buff, sizeof(buff) / sizeof(buff[0])))
if (!LoadStringW(GetModuleHandleW(NULL),
(current) ? IDS_DLG_TIT_CURRENT : IDS_DLG_TIT_DEFAULT,
buff, sizeof(buff) / sizeof(buff[0])))
{
buff[0] = 'S';
buff[1] = 'e';
@ -832,7 +829,7 @@ BOOL WCUSER_GetProperties(struct inner_data* data, BOOL current)
WINECON_DumpConfig("init", refcfg);
PropertySheet(&psHead);
PropertySheetW(&psHead);
if (memcmp(refcfg, &di.config, sizeof(*refcfg)) == 0)
return TRUE;
@ -841,8 +838,8 @@ BOOL WCUSER_GetProperties(struct inner_data* data, BOOL current)
WINECON_DumpConfig("cur", &di.config);
if (refcfg == &data->curcfg)
{
switch (DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_SAVE_SETTINGS),
data->hWnd, WCUSER_SaveDlgProc))
switch (DialogBoxW(GetModuleHandleW(NULL), MAKEINTRESOURCEW(IDD_SAVE_SETTINGS),
data->hWnd, WCUSER_SaveDlgProc))
{
case IDC_SAV_SAVE: save = TRUE; modify_session = TRUE; break;
case IDC_SAV_SESSION: modify_session = TRUE; break;