winecfg: Avoid Unicode macros.

This commit is contained in:
Alexandre Julliard 2012-01-20 12:42:33 +01:00
parent f2fe53d6ab
commit edf44bfb1e
13 changed files with 232 additions and 216 deletions

View file

@ -1,5 +1,6 @@
MODULE = winecfg.exe MODULE = winecfg.exe
APPMODE = -mwindows APPMODE = -mwindows
EXTRADEFS = -DWINE_NO_UNICODE_MACROS
IMPORTS = uuid comdlg32 comctl32 shell32 ole32 winmm shlwapi uxtheme user32 gdi32 advapi32 IMPORTS = uuid comdlg32 comctl32 shell32 ole32 winmm shlwapi uxtheme user32 gdi32 advapi32
C_SRCS = \ C_SRCS = \

View file

@ -87,10 +87,10 @@ AboutDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
org = get_reg_key(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows NT\\CurrentVersion", org = get_reg_key(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows NT\\CurrentVersion",
"RegisteredOrganization", ""); "RegisteredOrganization", "");
SetDlgItemText(hDlg, IDC_ABT_OWNER, owner); SetDlgItemTextA(hDlg, IDC_ABT_OWNER, owner);
SetDlgItemText(hDlg, IDC_ABT_ORG, org); SetDlgItemTextA(hDlg, IDC_ABT_ORG, org);
SendMessage(GetParent(hDlg), PSM_UNCHANGED, 0, 0); SendMessageW(GetParent(hDlg), PSM_UNCHANGED, 0, 0);
HeapFree(GetProcessHeap(), 0, owner); HeapFree(GetProcessHeap(), 0, owner);
HeapFree(GetProcessHeap(), 0, org); HeapFree(GetProcessHeap(), 0, org);
@ -111,11 +111,11 @@ AboutDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
hWnd = GetDlgItem(hDlg, IDC_ABT_TITLE_TEXT); hWnd = GetDlgItem(hDlg, IDC_ABT_TITLE_TEXT);
if(hWnd) if(hWnd)
{ {
titleFont = CreateFont( static const WCHAR tahomaW[] = {'T','a','h','o','m','a',0};
titleFont = CreateFontW(
-MulDiv(24, GetDeviceCaps(hDC, LOGPIXELSY), 72), -MulDiv(24, GetDeviceCaps(hDC, LOGPIXELSY), 72),
0, 0, 0, 0, FALSE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, FALSE, 0, 0, 0, 0, 0, 0, 0, tahomaW);
"Tahoma"); SendMessageW(hWnd, WM_SETFONT, (WPARAM)titleFont, TRUE);
SendMessage(hWnd, WM_SETFONT, (WPARAM)titleFont, TRUE);
SetWindowTextA(hWnd, PACKAGE_NAME); SetWindowTextA(hWnd, PACKAGE_NAME);
} }
SetDlgItemTextA(hDlg, IDC_ABT_PANEL_TEXT, PACKAGE_VERSION); SetDlgItemTextA(hDlg, IDC_ABT_PANEL_TEXT, PACKAGE_VERSION);
@ -147,7 +147,7 @@ AboutDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{ {
case EN_CHANGE: case EN_CHANGE:
/* enable apply button */ /* enable apply button */
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0); SendMessageW(GetParent(hDlg), PSM_CHANGED, 0, 0);
break; break;
} }
break; break;

View file

@ -136,7 +136,7 @@ static void update_comboboxes(HWND dialog)
if (current_app) /* no explicit setting */ if (current_app) /* no explicit setting */
{ {
WINE_TRACE("setting winver combobox to default\n"); WINE_TRACE("setting winver combobox to default\n");
SendDlgItemMessage (dialog, IDC_WINVER, CB_SETCURSEL, 0, 0); SendDlgItemMessageW(dialog, IDC_WINVER, CB_SETCURSEL, 0, 0);
return; return;
} }
if (ver != -1) winver = strdupA( win_versions[ver].szVersion ); if (ver != -1) winver = strdupA( win_versions[ver].szVersion );
@ -149,7 +149,7 @@ static void update_comboboxes(HWND dialog)
{ {
if (!strcasecmp (win_versions[i].szVersion, winver)) if (!strcasecmp (win_versions[i].szVersion, winver))
{ {
SendDlgItemMessage (dialog, IDC_WINVER, CB_SETCURSEL, SendDlgItemMessageW(dialog, IDC_WINVER, CB_SETCURSEL,
i + (current_app?1:0), 0); i + (current_app?1:0), 0);
WINE_TRACE("match with %s\n", win_versions[i].szVersion); WINE_TRACE("match with %s\n", win_versions[i].szVersion);
break; break;
@ -164,20 +164,20 @@ init_comboboxes (HWND dialog)
{ {
int i; int i;
SendDlgItemMessage(dialog, IDC_WINVER, CB_RESETCONTENT, 0, 0); SendDlgItemMessageW(dialog, IDC_WINVER, CB_RESETCONTENT, 0, 0);
/* add the default entries (automatic) which correspond to no setting */ /* add the default entries (automatic) which correspond to no setting */
if (current_app) if (current_app)
{ {
WCHAR str[256]; WCHAR str[256];
LoadStringW (GetModuleHandle (NULL), IDS_USE_GLOBAL_SETTINGS, str, LoadStringW (GetModuleHandleW(NULL), IDS_USE_GLOBAL_SETTINGS, str,
sizeof(str)/sizeof(str[0])); sizeof(str)/sizeof(str[0]));
SendDlgItemMessageW (dialog, IDC_WINVER, CB_ADDSTRING, 0, (LPARAM)str); SendDlgItemMessageW (dialog, IDC_WINVER, CB_ADDSTRING, 0, (LPARAM)str);
} }
for (i = 0; i < NB_VERSIONS; i++) for (i = 0; i < NB_VERSIONS; i++)
{ {
SendDlgItemMessage (dialog, IDC_WINVER, CB_ADDSTRING, SendDlgItemMessageA(dialog, IDC_WINVER, CB_ADDSTRING,
0, (LPARAM) win_versions[i].szDescription); 0, (LPARAM) win_versions[i].szDescription);
} }
} }
@ -190,16 +190,17 @@ static void add_listview_item(HWND listview, WCHAR *text, void *association)
item.pszText = text; item.pszText = text;
item.cchTextMax = lstrlenW(text); item.cchTextMax = lstrlenW(text);
item.lParam = (LPARAM) association; item.lParam = (LPARAM) association;
item.iItem = ListView_GetItemCount(listview); item.iItem = SendMessageW( listview, LVM_GETITEMCOUNT, 0, 0 );
item.iSubItem = 0; item.iSubItem = 0;
SendMessage(listview, LVM_INSERTITEMW, 0, (LPARAM) &item); SendMessageW(listview, LVM_INSERTITEMW, 0, (LPARAM) &item);
} }
/* Called when the application is initialized (cannot reinit!) */ /* Called when the application is initialized (cannot reinit!) */
static void init_appsheet(HWND dialog) static void init_appsheet(HWND dialog)
{ {
HWND listview; HWND listview;
LVITEMW item;
HKEY key; HKEY key;
int i; int i;
DWORD size; DWORD size;
@ -211,12 +212,12 @@ static void init_appsheet(HWND dialog)
/* we use the lparam field of the item so we can alter the presentation later and not change code /* we use the lparam field of the item so we can alter the presentation later and not change code
* for instance, to use the tile view or to display the EXEs embedded 'display name' */ * for instance, to use the tile view or to display the EXEs embedded 'display name' */
LoadStringW (GetModuleHandle (NULL), IDS_DEFAULT_SETTINGS, appname, LoadStringW (GetModuleHandleW(NULL), IDS_DEFAULT_SETTINGS, appname,
sizeof(appname)/sizeof(appname[0])); sizeof(appname)/sizeof(appname[0]));
add_listview_item(listview, appname, NULL); add_listview_item(listview, appname, NULL);
/* because this list is only populated once, it's safe to bypass the settings list here */ /* because this list is only populated once, it's safe to bypass the settings list here */
if (RegOpenKey(config_key, "AppDefaults", &key) == ERROR_SUCCESS) if (RegOpenKeyA(config_key, "AppDefaults", &key) == ERROR_SUCCESS)
{ {
i = 0; i = 0;
size = sizeof(appname)/sizeof(appname[0]); size = sizeof(appname)/sizeof(appname[0]);
@ -234,29 +235,24 @@ static void init_appsheet(HWND dialog)
init_comboboxes(dialog); init_comboboxes(dialog);
/* Select the default settings listview item */ /* Select the default settings listview item */
{ item.iItem = 0;
LVITEM item; item.iSubItem = 0;
item.mask = LVIF_STATE;
item.iItem = 0; item.state = LVIS_SELECTED | LVIS_FOCUSED;
item.iSubItem = 0; item.stateMask = LVIS_SELECTED | LVIS_FOCUSED;
item.mask = LVIF_STATE;
item.state = LVIS_SELECTED | LVIS_FOCUSED;
item.stateMask = LVIS_SELECTED | LVIS_FOCUSED;
SendMessage(listview, LVM_SETITEM, 0, (LPARAM) &item); SendMessageW(listview, LVM_SETITEMW, 0, (LPARAM) &item);
}
} }
/* there has to be an easier way than this */ /* there has to be an easier way than this */
static int get_listview_selection(HWND listview) static int get_listview_selection(HWND listview)
{ {
int count = ListView_GetItemCount(listview); int count = SendMessageW(listview, LVM_GETITEMCOUNT, 0, 0);
int i; int i;
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
{ {
if (ListView_GetItemState(listview, i, LVIS_SELECTED)) return i; if (SendMessageW( listview, LVM_GETITEMSTATE, i, LVIS_SELECTED )) return i;
} }
return -1; return -1;
@ -266,7 +262,7 @@ static int get_listview_selection(HWND listview)
/* called when the user selects a different application */ /* called when the user selects a different application */
static void on_selection_change(HWND dialog, HWND listview) static void on_selection_change(HWND dialog, HWND listview)
{ {
LVITEM item; LVITEMW item;
WCHAR* oldapp = current_app; WCHAR* oldapp = current_app;
WINE_TRACE("()\n"); WINE_TRACE("()\n");
@ -278,8 +274,8 @@ static void on_selection_change(HWND dialog, HWND listview)
WINE_TRACE("item.iItem=%d\n", item.iItem); WINE_TRACE("item.iItem=%d\n", item.iItem);
if (item.iItem == -1) return; if (item.iItem == -1) return;
SendMessage(listview, LVM_GETITEM, 0, (LPARAM) &item); SendMessageW(listview, LVM_GETITEMW, 0, (LPARAM) &item);
current_app = (WCHAR*) item.lParam; current_app = (WCHAR*) item.lParam;
@ -330,9 +326,9 @@ static void on_add_app_click(HWND dialog)
OFN_SHOWHELP | OFN_HIDEREADONLY | OFN_ENABLESIZING, OFN_SHOWHELP | OFN_HIDEREADONLY | OFN_ENABLESIZING,
0, 0, NULL, 0, NULL }; 0, 0, NULL, 0, NULL };
LoadStringW (GetModuleHandle (NULL), IDS_SELECT_EXECUTABLE, selectExecutableStr, LoadStringW (GetModuleHandleW(NULL), IDS_SELECT_EXECUTABLE, selectExecutableStr,
sizeof(selectExecutableStr)/sizeof(selectExecutableStr[0])); sizeof(selectExecutableStr)/sizeof(selectExecutableStr[0]));
LoadStringW (GetModuleHandle (NULL), IDS_EXECUTABLE_FILTER, programsFilter, LoadStringW (GetModuleHandleW(NULL), IDS_EXECUTABLE_FILTER, programsFilter,
sizeof(programsFilter)/sizeof(programsFilter[0])); sizeof(programsFilter)/sizeof(programsFilter[0]));
snprintfW( filter, MAX_PATH, filterW, programsFilter, 0, 0 ); snprintfW( filter, MAX_PATH, filterW, programsFilter, 0, 0 );
@ -348,19 +344,23 @@ static void on_add_app_click(HWND dialog)
if (GetOpenFileNameW (&ofn)) if (GetOpenFileNameW (&ofn))
{ {
HWND listview = GetDlgItem(dialog, IDC_APP_LISTVIEW); HWND listview = GetDlgItem(dialog, IDC_APP_LISTVIEW);
int count = ListView_GetItemCount(listview); int count = SendMessageW(listview, LVM_GETITEMCOUNT, 0, 0);
WCHAR* new_app; WCHAR* new_app;
LVITEMW item;
if (list_contains_file(listview, filetitle)) if (list_contains_file(listview, filetitle))
return; return;
new_app = strdupW(filetitle); new_app = strdupW(filetitle);
WINE_TRACE("adding %s\n", wine_dbgstr_w (new_app)); WINE_TRACE("adding %s\n", wine_dbgstr_w (new_app));
add_listview_item(listview, new_app, new_app); add_listview_item(listview, new_app, new_app);
ListView_SetItemState(listview, count, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED); item.mask = LVIF_STATE;
item.state = LVIS_SELECTED | LVIS_FOCUSED;
item.stateMask = LVIS_SELECTED | LVIS_FOCUSED;
SendMessageW(listview, LVM_SETITEMSTATE, count, (LPARAM)&item );
SetFocus(listview); SetFocus(listview);
} }
@ -384,19 +384,21 @@ static void on_remove_app_click(HWND dialog)
section[strlen(section)] = '\0'; /* remove last backslash */ section[strlen(section)] = '\0'; /* remove last backslash */
set_reg_key(config_key, section, NULL, NULL); /* delete the section */ set_reg_key(config_key, section, NULL, NULL); /* delete the section */
SendMessage(listview, LVM_GETITEMW, 0, (LPARAM) &item); SendMessageW(listview, LVM_GETITEMW, 0, (LPARAM) &item);
HeapFree (GetProcessHeap(), 0, (void*)item.lParam); HeapFree (GetProcessHeap(), 0, (void*)item.lParam);
SendMessage(listview, LVM_DELETEITEM, selection, 0); SendMessageW(listview, LVM_DELETEITEM, selection, 0);
ListView_SetItemState(listview, selection - 1, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED); item.mask = LVIF_STATE;
item.state = LVIS_SELECTED | LVIS_FOCUSED;
item.stateMask = LVIS_SELECTED | LVIS_FOCUSED;
SendMessageW(listview, LVM_SETITEMSTATE, -1, (LPARAM)&item);
SetFocus(listview); SetFocus(listview);
SendMessageW(GetParent(dialog), PSM_CHANGED, (WPARAM) dialog, 0);
SendMessage(GetParent(dialog), PSM_CHANGED, (WPARAM) dialog, 0);
} }
static void on_winver_change(HWND dialog) static void on_winver_change(HWND dialog)
{ {
int selection = SendDlgItemMessage(dialog, IDC_WINVER, CB_GETCURSEL, 0, 0); int selection = SendDlgItemMessageW(dialog, IDC_WINVER, CB_GETCURSEL, 0, 0);
if (current_app) if (current_app)
{ {
@ -475,7 +477,7 @@ static void on_winver_change(HWND dialog)
} }
/* enable the apply button */ /* enable the apply button */
SendMessage(GetParent(dialog), PSM_CHANGED, (WPARAM) dialog, 0); SendMessageW(GetParent(dialog), PSM_CHANGED, (WPARAM) dialog, 0);
} }
INT_PTR CALLBACK INT_PTR CALLBACK
@ -499,7 +501,7 @@ AppDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
break; break;
case PSN_APPLY: case PSN_APPLY:
apply(); apply();
SetWindowLongPtr(hDlg, DWLP_MSGRESULT, PSNRET_NOERROR); SetWindowLongPtrW(hDlg, DWLP_MSGRESULT, PSNRET_NOERROR);
break; break;
} }

View file

@ -188,11 +188,11 @@ static void initAudioDlg (HWND hDlg)
WINE_TRACE("\n"); WINE_TRACE("\n");
LoadStringW(GetModuleHandle(NULL), IDS_AUDIO_DRIVER, LoadStringW(GetModuleHandleW(NULL), IDS_AUDIO_DRIVER,
format_str, sizeof(format_str) / sizeof(*format_str)); format_str, sizeof(format_str) / sizeof(*format_str));
LoadStringW(GetModuleHandle(NULL), IDS_AUDIO_DRIVER_NONE, LoadStringW(GetModuleHandleW(NULL), IDS_AUDIO_DRIVER_NONE,
disabled_str, sizeof(disabled_str) / sizeof(*disabled_str)); disabled_str, sizeof(disabled_str) / sizeof(*disabled_str));
LoadStringW(GetModuleHandle(NULL), IDS_AUDIO_SYSDEFAULT, LoadStringW(GetModuleHandleW(NULL), IDS_AUDIO_SYSDEFAULT,
sysdefault_str, sizeof(sysdefault_str) / sizeof(*sysdefault_str)); sysdefault_str, sizeof(sysdefault_str) / sizeof(*sysdefault_str));
hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL,
@ -308,9 +308,9 @@ static void test_sound(void)
if(!PlaySoundW(MAKEINTRESOURCEW(IDW_TESTSOUND), NULL, SND_RESOURCE | SND_ASYNC)){ if(!PlaySoundW(MAKEINTRESOURCEW(IDW_TESTSOUND), NULL, SND_RESOURCE | SND_ASYNC)){
WCHAR error_str[256], title_str[256]; WCHAR error_str[256], title_str[256];
LoadStringW(GetModuleHandle(NULL), IDS_AUDIO_TEST_FAILED, LoadStringW(GetModuleHandleW(NULL), IDS_AUDIO_TEST_FAILED,
error_str, sizeof(error_str) / sizeof(*error_str)); error_str, sizeof(error_str) / sizeof(*error_str));
LoadStringW(GetModuleHandle(NULL), IDS_AUDIO_TEST_FAILED_TITLE, LoadStringW(GetModuleHandleW(NULL), IDS_AUDIO_TEST_FAILED_TITLE,
title_str, sizeof(title_str) / sizeof(*title_str)); title_str, sizeof(title_str) / sizeof(*title_str));
MessageBoxW(NULL, error_str, title_str, MB_OK | MB_ICONERROR); MessageBoxW(NULL, error_str, title_str, MB_OK | MB_ICONERROR);
@ -360,11 +360,11 @@ AudioDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_NOTIFY: case WM_NOTIFY:
switch(((LPNMHDR)lParam)->code) { switch(((LPNMHDR)lParam)->code) {
case PSN_KILLACTIVE: case PSN_KILLACTIVE:
SetWindowLongPtr(hDlg, DWLP_MSGRESULT, FALSE); SetWindowLongPtrW(hDlg, DWLP_MSGRESULT, FALSE);
break; break;
case PSN_APPLY: case PSN_APPLY:
apply(); apply();
SetWindowLongPtr(hDlg, DWLP_MSGRESULT, PSNRET_NOERROR); SetWindowLongPtrW(hDlg, DWLP_MSGRESULT, PSNRET_NOERROR);
break; break;
case PSN_SETACTIVE: case PSN_SETACTIVE:
break; break;

View file

@ -139,7 +139,7 @@ static DWORD get_drive_type( char letter )
sprintf(driveValue, "%c:", letter); sprintf(driveValue, "%c:", letter);
if (RegOpenKey(HKEY_LOCAL_MACHINE, "Software\\Wine\\Drives", &hKey) != ERROR_SUCCESS) if (RegOpenKeyA(HKEY_LOCAL_MACHINE, "Software\\Wine\\Drives", &hKey) != ERROR_SUCCESS)
WINE_TRACE(" Unable to open Software\\Wine\\Drives\n" ); WINE_TRACE(" Unable to open Software\\Wine\\Drives\n" );
else else
{ {
@ -149,10 +149,10 @@ static DWORD get_drive_type( char letter )
if (!RegQueryValueExA( hKey, driveValue, NULL, NULL, (LPBYTE)buffer, &size )) if (!RegQueryValueExA( hKey, driveValue, NULL, NULL, (LPBYTE)buffer, &size ))
{ {
WINE_TRACE("Got type '%s' for %s\n", buffer, driveValue ); WINE_TRACE("Got type '%s' for %s\n", buffer, driveValue );
if (!lstrcmpi( buffer, "hd" )) ret = DRIVE_FIXED; if (!lstrcmpiA( buffer, "hd" )) ret = DRIVE_FIXED;
else if (!lstrcmpi( buffer, "network" )) ret = DRIVE_REMOTE; else if (!lstrcmpiA( buffer, "network" )) ret = DRIVE_REMOTE;
else if (!lstrcmpi( buffer, "floppy" )) ret = DRIVE_REMOVABLE; else if (!lstrcmpiA( buffer, "floppy" )) ret = DRIVE_REMOVABLE;
else if (!lstrcmpi( buffer, "cdrom" )) ret = DRIVE_CDROM; else if (!lstrcmpiA( buffer, "cdrom" )) ret = DRIVE_CDROM;
} }
RegCloseKey(hKey); RegCloseKey(hKey);
} }
@ -181,15 +181,15 @@ static void set_drive_label( char letter, const WCHAR *label )
} }
/* set the drive serial number via a .windows-serial file */ /* set the drive serial number via a .windows-serial file */
static void set_drive_serial( char letter, DWORD serial ) static void set_drive_serial( WCHAR letter, DWORD serial )
{ {
char filename[] = "a:\\.windows-serial"; WCHAR filename[] = {'a',':','\\','.','w','i','n','d','o','w','s','-','s','e','r','i','a','l',0};
HANDLE hFile; HANDLE hFile;
filename[0] = letter; filename[0] = letter;
WINE_TRACE("Putting serial number of %08X into file '%s'\n", serial, filename); WINE_TRACE("Putting serial number of %08X into file %s\n", serial, wine_dbgstr_w(filename));
hFile = CreateFile(filename, GENERIC_WRITE, FILE_SHARE_READ, NULL, hFile = CreateFileW(filename, GENERIC_WRITE, FILE_SHARE_READ, NULL,
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile != INVALID_HANDLE_VALUE) if (hFile != INVALID_HANDLE_VALUE)
{ {
DWORD w; DWORD w;

View file

@ -178,7 +178,7 @@ static void report_error(int code)
len = snprintf(NULL, 0, s, strerror(errno)); len = snprintf(NULL, 0, s, strerror(errno));
buffer = HeapAlloc(GetProcessHeap(), 0, len + 1); buffer = HeapAlloc(GetProcessHeap(), 0, len + 1);
snprintf(buffer, len, s, strerror(errno)); snprintf(buffer, len, s, strerror(errno));
MessageBox(NULL, s, "", MB_OK | MB_ICONEXCLAMATION); MessageBoxA(NULL, s, "", MB_OK | MB_ICONEXCLAMATION);
HeapFree(GetProcessHeap(), 0, buffer); HeapFree(GetProcessHeap(), 0, buffer);
} }
else else
@ -188,12 +188,12 @@ static void report_error(int code)
break; break;
case NO_MORE_LETTERS: case NO_MORE_LETTERS:
if (gui_mode) MessageBox(NULL, "No more letters are available to auto-detect available drives with.", "", MB_OK | MB_ICONEXCLAMATION); if (gui_mode) MessageBoxA(NULL, "No more letters are available to auto-detect available drives with.", "", MB_OK | MB_ICONEXCLAMATION);
fprintf(stderr, "winecfg: no more available letters while scanning /etc/fstab\n"); fprintf(stderr, "winecfg: no more available letters while scanning /etc/fstab\n");
break; break;
case NO_ROOT: case NO_ROOT:
if (gui_mode) MessageBox(NULL, "Could not ensure that the root directory was mapped.\n\n" if (gui_mode) MessageBoxA(NULL, "Could not ensure that the root directory was mapped.\n\n"
"This can happen if you run out of drive letters. " "This can happen if you run out of drive letters. "
"It's important to have the root directory mapped, otherwise Wine" "It's important to have the root directory mapped, otherwise Wine"
"will not be able to always find the programs you want to run. " "will not be able to always find the programs you want to run. "
@ -204,13 +204,13 @@ static void report_error(int code)
case NO_DRIVE_C: case NO_DRIVE_C:
if (gui_mode) if (gui_mode)
MessageBox(NULL, "No virtual drive C mapped!\n", "", MB_OK | MB_ICONEXCLAMATION); MessageBoxA(NULL, "No virtual drive C mapped!\n", "", MB_OK | MB_ICONEXCLAMATION);
else else
fprintf(stderr, "winecfg: no drive_c directory\n"); fprintf(stderr, "winecfg: no drive_c directory\n");
break; break;
case NO_HOME: case NO_HOME:
if (gui_mode) if (gui_mode)
MessageBox(NULL, "Could not ensure that your home directory was mapped.\n\n" MessageBoxA(NULL, "Could not ensure that your home directory was mapped.\n\n"
"This can happen if you run out of drive letters. " "This can happen if you run out of drive letters. "
"Try unmapping a drive letter then try again.", "", "Try unmapping a drive letter then try again.", "",
MB_OK | MB_ICONEXCLAMATION); MB_OK | MB_ICONEXCLAMATION);
@ -292,7 +292,7 @@ static void ensure_drive_c_is_mapped(void)
if (stat(drive_c_dir, &buf) == 0) if (stat(drive_c_dir, &buf) == 0)
{ {
WCHAR label[64]; WCHAR label[64];
LoadStringW (GetModuleHandle (NULL), IDS_SYSTEM_DRIVE_LABEL, label, LoadStringW (GetModuleHandleW(NULL), IDS_SYSTEM_DRIVE_LABEL, label,
sizeof(label)/sizeof(label[0])); sizeof(label)/sizeof(label[0]));
add_drive('C', "../drive_c", NULL, label, 0, DRIVE_FIXED); add_drive('C', "../drive_c", NULL, label, 0, DRIVE_FIXED);
} }

View file

@ -65,21 +65,31 @@ static DWORD driveui_msgbox (HWND parent, UINT messageId, DWORD flags)
/* clears the item at index in the listview */ /* clears the item at index in the listview */
static void lv_clear_curr_select(HWND dialog, int index) static void lv_clear_curr_select(HWND dialog, int index)
{ {
ListView_SetItemState(GetDlgItem(dialog, IDC_LIST_DRIVES), index, 0, LVIS_SELECTED); LVITEMW item;
item.mask = LVIF_STATE;
item.state = 0;
item.stateMask = LVIS_SELECTED;
SendDlgItemMessageW( dialog, IDC_LIST_DRIVES, LVM_SETITEMSTATE, index, (LPARAM)&item );
} }
/* selects the item at index in the listview */ /* selects the item at index in the listview */
static void lv_set_curr_select(HWND dialog, int index) static void lv_set_curr_select(HWND dialog, int index)
{ {
LVITEMW item;
/* no more than one item can be selected in our listview */ /* no more than one item can be selected in our listview */
lv_clear_curr_select(dialog, -1); lv_clear_curr_select(dialog, -1);
ListView_SetItemState(GetDlgItem(dialog, IDC_LIST_DRIVES), index, LVIS_SELECTED, LVIS_SELECTED); item.mask = LVIF_STATE;
item.state = LVIS_SELECTED;
item.stateMask = LVIS_SELECTED;
SendDlgItemMessageW( dialog, IDC_LIST_DRIVES, LVM_SETITEMSTATE, index, (LPARAM)&item );
} }
/* returns the currently selected item in the listview */ /* returns the currently selected item in the listview */
static int lv_get_curr_select(HWND dialog) static int lv_get_curr_select(HWND dialog)
{ {
return SendDlgItemMessage(dialog, IDC_LIST_DRIVES, LVM_GETNEXTITEM, -1, LVNI_SELECTED); return SendDlgItemMessageW(dialog, IDC_LIST_DRIVES, LVM_GETNEXTITEM, -1, LVNI_SELECTED);
} }
/* sets the item in the listview at item->iIndex */ /* sets the item in the listview at item->iIndex */
@ -121,12 +131,12 @@ static void set_advanced(HWND dialog)
if (advanced) if (advanced)
{ {
state = SW_NORMAL; state = SW_NORMAL;
LoadStringW(GetModuleHandle(NULL), IDS_HIDE_ADVANCED, text, 256); LoadStringW(GetModuleHandleW(NULL), IDS_HIDE_ADVANCED, text, 256);
} }
else else
{ {
state = SW_HIDE; state = SW_HIDE;
LoadStringW(GetModuleHandle(NULL), IDS_SHOW_ADVANCED, text, 256); LoadStringW(GetModuleHandleW(NULL), IDS_SHOW_ADVANCED, text, 256);
} }
ShowWindow(GetDlgItem(dialog, IDC_EDIT_DEVICE), state); ShowWindow(GetDlgItem(dialog, IDC_EDIT_DEVICE), state);
@ -195,7 +205,7 @@ static int fill_drives_list(HWND dialog)
prevsel = lv_get_curr_select(dialog); prevsel = lv_get_curr_select(dialog);
/* Clear the listbox */ /* Clear the listbox */
SendDlgItemMessage(dialog, IDC_LIST_DRIVES, LVM_DELETEALLITEMS, 0, 0); SendDlgItemMessageW(dialog, IDC_LIST_DRIVES, LVM_DELETEALLITEMS, 0, 0);
for(i = 0; i < 26; i++) for(i = 0; i < 26; i++)
{ {
@ -252,7 +262,7 @@ static void on_options_click(HWND dialog)
else else
set_reg_key(config_key, "", "ShowDotFiles", "N"); set_reg_key(config_key, "", "ShowDotFiles", "N");
SendMessage(GetParent(dialog), PSM_CHANGED, 0, 0); SendMessageW(GetParent(dialog), PSM_CHANGED, 0, 0);
} }
static INT_PTR CALLBACK drivechoose_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) static INT_PTR CALLBACK drivechoose_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
@ -320,7 +330,7 @@ static void on_add_click(HWND dialog)
} }
ret = DialogBoxParam(0, MAKEINTRESOURCE(IDD_DRIVECHOOSE), dialog, drivechoose_dlgproc, new); ret = DialogBoxParamW(0, MAKEINTRESOURCEW(IDD_DRIVECHOOSE), dialog, drivechoose_dlgproc, new);
if( ret == -1) return; if( ret == -1) return;
new = ret; new = ret;
@ -330,7 +340,7 @@ static void on_add_click(HWND dialog)
if (new == 'C') if (new == 'C')
{ {
WCHAR label[64]; WCHAR label[64];
LoadStringW (GetModuleHandle (NULL), IDS_SYSTEM_DRIVE_LABEL, label, LoadStringW (GetModuleHandleW(NULL), IDS_SYSTEM_DRIVE_LABEL, label,
sizeof(label)/sizeof(label[0])); sizeof(label)/sizeof(label[0]));
add_drive(new, "../drive_c", NULL, label, 0, DRIVE_FIXED); add_drive(new, "../drive_c", NULL, label, 0, DRIVE_FIXED);
} }
@ -351,7 +361,7 @@ static void on_add_click(HWND dialog)
SetFocus(GetDlgItem(dialog, IDC_LIST_DRIVES)); SetFocus(GetDlgItem(dialog, IDC_LIST_DRIVES));
update_controls(dialog); update_controls(dialog);
SendMessage(GetParent(dialog), PSM_CHANGED, (WPARAM) dialog, 0); SendMessageW(GetParent(dialog), PSM_CHANGED, (WPARAM) dialog, 0);
} }
static void on_remove_click(HWND dialog) static void on_remove_click(HWND dialog)
@ -390,7 +400,7 @@ static void on_remove_click(HWND dialog)
SetFocus(GetDlgItem(dialog, IDC_LIST_DRIVES)); SetFocus(GetDlgItem(dialog, IDC_LIST_DRIVES));
update_controls(dialog); update_controls(dialog);
SendMessage(GetParent(dialog), PSM_CHANGED, (WPARAM) dialog, 0); SendMessageW(GetParent(dialog), PSM_CHANGED, (WPARAM) dialog, 0);
} }
static void update_controls(HWND dialog) static void update_controls(HWND dialog)
@ -429,12 +439,12 @@ static void update_controls(HWND dialog)
/* drive type */ /* drive type */
type = current_drive->type; type = current_drive->type;
SendDlgItemMessage(dialog, IDC_COMBO_TYPE, CB_RESETCONTENT, 0, 0); SendDlgItemMessageW(dialog, IDC_COMBO_TYPE, CB_RESETCONTENT, 0, 0);
for (i = 0; i < sizeof(type_pairs) / sizeof(struct drive_typemap); i++) for (i = 0; i < sizeof(type_pairs) / sizeof(struct drive_typemap); i++)
{ {
WCHAR driveDesc[64]; WCHAR driveDesc[64];
LoadStringW (GetModuleHandle (NULL), type_pairs[i].idDesc, driveDesc, LoadStringW (GetModuleHandleW(NULL), type_pairs[i].idDesc, driveDesc,
sizeof(driveDesc)/sizeof(driveDesc[0])); sizeof(driveDesc)/sizeof(driveDesc[0]));
SendDlgItemMessageW (dialog, IDC_COMBO_TYPE, CB_ADDSTRING, 0, (LPARAM)driveDesc); SendDlgItemMessageW (dialog, IDC_COMBO_TYPE, CB_ADDSTRING, 0, (LPARAM)driveDesc);
@ -445,7 +455,7 @@ static void update_controls(HWND dialog)
} }
if (selection == -1) selection = DRIVE_TYPE_DEFAULT; if (selection == -1) selection = DRIVE_TYPE_DEFAULT;
SendDlgItemMessage(dialog, IDC_COMBO_TYPE, CB_SETCURSEL, selection, 0); SendDlgItemMessageW(dialog, IDC_COMBO_TYPE, CB_SETCURSEL, selection, 0);
EnableWindow( GetDlgItem( dialog, IDC_BUTTON_REMOVE ), (current_drive->letter != 'C') ); EnableWindow( GetDlgItem( dialog, IDC_BUTTON_REMOVE ), (current_drive->letter != 'C') );
EnableWindow( GetDlgItem( dialog, IDC_EDIT_PATH ), (current_drive->letter != 'C') ); EnableWindow( GetDlgItem( dialog, IDC_EDIT_PATH ), (current_drive->letter != 'C') );
@ -489,7 +499,7 @@ static void on_edit_changed(HWND dialog, WORD id)
WINE_TRACE("set label to %s\n", wine_dbgstr_w(current_drive->label)); WINE_TRACE("set label to %s\n", wine_dbgstr_w(current_drive->label));
/* enable the apply button */ /* enable the apply button */
SendMessage(GetParent(dialog), PSM_CHANGED, (WPARAM) dialog, 0); SendMessageW(GetParent(dialog), PSM_CHANGED, (WPARAM) dialog, 0);
break; break;
} }
@ -522,7 +532,7 @@ static void on_edit_changed(HWND dialog, WORD id)
HeapFree(GetProcessHeap(), 0, wpath); HeapFree(GetProcessHeap(), 0, wpath);
/* enable the apply button */ /* enable the apply button */
SendMessage(GetParent(dialog), PSM_CHANGED, (WPARAM) dialog, 0); SendMessageW(GetParent(dialog), PSM_CHANGED, (WPARAM) dialog, 0);
break; break;
} }
@ -538,7 +548,7 @@ static void on_edit_changed(HWND dialog, WORD id)
WINE_TRACE("set serial to %08X\n", current_drive->serial); WINE_TRACE("set serial to %08X\n", current_drive->serial);
/* enable the apply button */ /* enable the apply button */
SendMessage(GetParent(dialog), PSM_CHANGED, (WPARAM) dialog, 0); SendMessageW(GetParent(dialog), PSM_CHANGED, (WPARAM) dialog, 0);
break; break;
} }
@ -571,9 +581,9 @@ BOOL browse_for_unix_folder(HWND dialog, WCHAR *pszPath)
IShellFolder *pDesktop; IShellFolder *pDesktop;
LPITEMIDLIST pidlUnixRoot, pidlSelectedPath; LPITEMIDLIST pidlUnixRoot, pidlSelectedPath;
HRESULT hr; HRESULT hr;
LoadStringW(GetModuleHandle(NULL), IDS_CHOOSE_PATH, pszChoosePath, FILENAME_MAX); LoadStringW(GetModuleHandleW(NULL), IDS_CHOOSE_PATH, pszChoosePath, FILENAME_MAX);
hr = SHGetDesktopFolder(&pDesktop); hr = SHGetDesktopFolder(&pDesktop);
if (FAILED(hr)) return FALSE; if (FAILED(hr)) return FALSE;
@ -623,7 +633,7 @@ static void init_listview_columns(HWND dialog)
GetClientRect(GetDlgItem(dialog, IDC_LIST_DRIVES), &viewRect); GetClientRect(GetDlgItem(dialog, IDC_LIST_DRIVES), &viewRect);
width = (viewRect.right - viewRect.left) / 6 - 5; width = (viewRect.right - viewRect.left) / 6 - 5;
LoadStringW (GetModuleHandle (NULL), IDS_COL_DRIVELETTER, column, LoadStringW (GetModuleHandleW(NULL), IDS_COL_DRIVELETTER, column,
sizeof(column)/sizeof(column[0])); sizeof(column)/sizeof(column[0]));
listColumn.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM; listColumn.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM;
listColumn.pszText = column; listColumn.pszText = column;
@ -632,7 +642,7 @@ static void init_listview_columns(HWND dialog)
SendDlgItemMessageW (dialog, IDC_LIST_DRIVES, LVM_INSERTCOLUMNW, 0, (LPARAM) &listColumn); SendDlgItemMessageW (dialog, IDC_LIST_DRIVES, LVM_INSERTCOLUMNW, 0, (LPARAM) &listColumn);
LoadStringW (GetModuleHandle (NULL), IDS_COL_DRIVEMAPPING, column, LoadStringW (GetModuleHandleW(NULL), IDS_COL_DRIVEMAPPING, column,
sizeof(column)/sizeof(column[0])); sizeof(column)/sizeof(column[0]));
listColumn.cx = viewRect.right - viewRect.left - width; listColumn.cx = viewRect.right - viewRect.left - width;
listColumn.pszText = column; listColumn.pszText = column;
@ -704,7 +714,7 @@ DriveDlgProc (HWND dialog, UINT msg, WPARAM wParam, LPARAM lParam)
break; break;
case CBN_SELCHANGE: case CBN_SELCHANGE:
SendMessage(GetParent(dialog), PSM_CHANGED, 0, 0); SendMessageW(GetParent(dialog), PSM_CHANGED, 0, 0);
break; break;
} }
@ -722,14 +732,14 @@ DriveDlgProc (HWND dialog, UINT msg, WPARAM wParam, LPARAM lParam)
case IDC_BUTTON_EDIT: case IDC_BUTTON_EDIT:
if (HIWORD(wParam) != BN_CLICKED) break; if (HIWORD(wParam) != BN_CLICKED) break;
item = SendMessage(GetDlgItem(dialog, IDC_LIST_DRIVES), LB_GETCURSEL, 0, 0); item = SendMessageW(GetDlgItem(dialog, IDC_LIST_DRIVES), LB_GETCURSEL, 0, 0);
SendMessage(GetDlgItem(dialog, IDC_LIST_DRIVES), LB_GETITEMDATA, item, 0); SendMessageW(GetDlgItem(dialog, IDC_LIST_DRIVES), LB_GETITEMDATA, item, 0);
break; break;
case IDC_BUTTON_AUTODETECT: case IDC_BUTTON_AUTODETECT:
autodetect_drives(); autodetect_drives();
fill_drives_list(dialog); fill_drives_list(dialog);
SendMessage(GetParent(dialog), PSM_CHANGED, 0, 0); SendMessageW(GetParent(dialog), PSM_CHANGED, 0, 0);
break; break;
case IDC_BUTTON_SHOW_HIDE_ADVANCED: case IDC_BUTTON_SHOW_HIDE_ADVANCED:
@ -752,7 +762,7 @@ DriveDlgProc (HWND dialog, UINT msg, WPARAM wParam, LPARAM lParam)
if (HIWORD(wParam) != CBN_SELCHANGE) break; if (HIWORD(wParam) != CBN_SELCHANGE) break;
selection = SendDlgItemMessage(dialog, IDC_COMBO_TYPE, CB_GETCURSEL, 0, 0); selection = SendDlgItemMessageW(dialog, IDC_COMBO_TYPE, CB_GETCURSEL, 0, 0);
if (selection >= 0 && if (selection >= 0 &&
(type_pairs[selection].sCode == DRIVE_CDROM || (type_pairs[selection].sCode == DRIVE_CDROM ||
@ -776,11 +786,11 @@ DriveDlgProc (HWND dialog, UINT msg, WPARAM wParam, LPARAM lParam)
{ {
case PSN_KILLACTIVE: case PSN_KILLACTIVE:
WINE_TRACE("PSN_KILLACTIVE\n"); WINE_TRACE("PSN_KILLACTIVE\n");
SetWindowLongPtr(dialog, DWLP_MSGRESULT, FALSE); SetWindowLongPtrW(dialog, DWLP_MSGRESULT, FALSE);
break; break;
case PSN_APPLY: case PSN_APPLY:
apply_drive_changes(); apply_drive_changes();
SetWindowLongPtr(dialog, DWLP_MSGRESULT, PSNRET_NOERROR); SetWindowLongPtrW(dialog, DWLP_MSGRESULT, PSNRET_NOERROR);
break; break;
case PSN_SETACTIVE: case PSN_SETACTIVE:
break; break;

View file

@ -97,6 +97,8 @@ struct dll
enum dllmode mode; enum dllmode mode;
}; };
static const WCHAR emptyW[1];
/* Convert a registry string to a dllmode */ /* Convert a registry string to a dllmode */
static enum dllmode string_to_mode(char *in) static enum dllmode string_to_mode(char *in)
{ {
@ -234,17 +236,16 @@ static void set_controls_from_selection(HWND dialog)
static void clear_settings(HWND dialog) static void clear_settings(HWND dialog)
{ {
int count = SendDlgItemMessage(dialog, IDC_DLLS_LIST, LB_GETCOUNT, 0, 0); int count = SendDlgItemMessageW(dialog, IDC_DLLS_LIST, LB_GETCOUNT, 0, 0);
int i; int i;
WINE_TRACE("count=%d\n", count); WINE_TRACE("count=%d\n", count);
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
{ {
struct dll *dll = (struct dll *) SendDlgItemMessage(dialog, IDC_DLLS_LIST, LB_GETITEMDATA, 0, 0); struct dll *dll = (struct dll *) SendDlgItemMessageW(dialog, IDC_DLLS_LIST, LB_GETITEMDATA, 0, 0);
SendDlgItemMessage(dialog, IDC_DLLS_LIST, LB_DELETESTRING, 0, 0); SendDlgItemMessageW(dialog, IDC_DLLS_LIST, LB_DELETESTRING, 0, 0);
HeapFree(GetProcessHeap(), 0, dll->name); HeapFree(GetProcessHeap(), 0, dll->name);
HeapFree(GetProcessHeap(), 0, dll); HeapFree(GetProcessHeap(), 0, dll);
} }
@ -303,7 +304,7 @@ static void load_library_list( HWND dialog )
unsigned int i = 0; unsigned int i = 0;
const char *path, *build_dir = wine_get_build_dir(); const char *path, *build_dir = wine_get_build_dir();
char item1[256], item2[256]; char item1[256], item2[256];
HCURSOR old_cursor = SetCursor( LoadCursor(0, IDC_WAIT) ); HCURSOR old_cursor = SetCursor( LoadCursorW(0, (LPWSTR)IDC_WAIT) );
if (build_dir) if (build_dir)
{ {
@ -342,7 +343,7 @@ static void load_library_settings(HWND dialog)
char **p; char **p;
int sel, count = 0; int sel, count = 0;
sel = SendDlgItemMessage(dialog, IDC_DLLS_LIST, LB_GETCURSEL, 0, 0); sel = SendDlgItemMessageW(dialog, IDC_DLLS_LIST, LB_GETCURSEL, 0, 0);
WINE_TRACE("sel=%d\n", sel); WINE_TRACE("sel=%d\n", sel);
@ -381,8 +382,8 @@ static void load_library_settings(HWND dialog)
dll->name = *p; dll->name = *p;
dll->mode = string_to_mode(value); dll->mode = string_to_mode(value);
index = SendDlgItemMessage(dialog, IDC_DLLS_LIST, LB_ADDSTRING, (WPARAM) -1, (LPARAM) str); index = SendDlgItemMessageA(dialog, IDC_DLLS_LIST, LB_ADDSTRING, (WPARAM) -1, (LPARAM) str);
SendDlgItemMessage(dialog, IDC_DLLS_LIST, LB_SETITEMDATA, index, (LPARAM) dll); SendDlgItemMessageW(dialog, IDC_DLLS_LIST, LB_SETITEMDATA, index, (LPARAM) dll);
HeapFree(GetProcessHeap(), 0, str); HeapFree(GetProcessHeap(), 0, str);
@ -394,8 +395,8 @@ static void load_library_settings(HWND dialog)
/* restore the previous selection, if possible */ /* restore the previous selection, if possible */
if (sel >= count - 1) sel = count - 1; if (sel >= count - 1) sel = count - 1;
else if (sel == -1) sel = 0; else if (sel == -1) sel = 0;
SendDlgItemMessage(dialog, IDC_DLLS_LIST, LB_SETCURSEL, sel, 0); SendDlgItemMessageW(dialog, IDC_DLLS_LIST, LB_SETCURSEL, sel, 0);
set_controls_from_selection(dialog); set_controls_from_selection(dialog);
} }
@ -404,22 +405,22 @@ static void load_library_settings(HWND dialog)
static void init_libsheet(HWND dialog) static void init_libsheet(HWND dialog)
{ {
/* clear the add dll controls */ /* clear the add dll controls */
SendDlgItemMessage(dialog, IDC_DLLCOMBO, WM_SETTEXT, 1, (LPARAM) ""); SendDlgItemMessageW(dialog, IDC_DLLCOMBO, WM_SETTEXT, 1, (LPARAM)emptyW);
load_library_list( dialog ); load_library_list( dialog );
disable(IDC_DLLS_ADDDLL); disable(IDC_DLLS_ADDDLL);
} }
static void on_add_combo_change(HWND dialog) static void on_add_combo_change(HWND dialog)
{ {
char buffer[1024]; WCHAR buffer[1024];
int sel, len; int sel, len;
SendDlgItemMessage(dialog, IDC_DLLCOMBO, WM_GETTEXT, sizeof(buffer), (LPARAM) buffer); SendDlgItemMessageW(dialog, IDC_DLLCOMBO, WM_GETTEXT, sizeof(buffer)/sizeof(WCHAR), (LPARAM) buffer);
/* if lib was chosen from combobox, we receive an empty buffer, check manually */ /* if lib was chosen from combobox, we receive an empty buffer, check manually */
sel=SendDlgItemMessage(dialog, IDC_DLLCOMBO, CB_GETCURSEL, 0, 0); sel=SendDlgItemMessageW(dialog, IDC_DLLCOMBO, CB_GETCURSEL, 0, 0);
len=SendDlgItemMessage(dialog, IDC_DLLCOMBO, CB_GETLBTEXTLEN, sel, 0); len=SendDlgItemMessageW(dialog, IDC_DLLCOMBO, CB_GETLBTEXTLEN, sel, 0);
if (strlen(buffer)>0 || len>0) if (buffer[0] || len>0)
enable(IDC_DLLS_ADDDLL) enable(IDC_DLLS_ADDDLL)
else else
disable(IDC_DLLS_ADDDLL); disable(IDC_DLLS_ADDDLL);
@ -434,15 +435,15 @@ static void set_dllmode(HWND dialog, DWORD id)
mode = id_to_mode(id); mode = id_to_mode(id);
sel = SendDlgItemMessage(dialog, IDC_DLLS_LIST, LB_GETCURSEL, 0, 0); sel = SendDlgItemMessageW(dialog, IDC_DLLS_LIST, LB_GETCURSEL, 0, 0);
if (sel == -1) return; if (sel == -1) return;
dll = (struct dll *) SendDlgItemMessage(dialog, IDC_DLLS_LIST, LB_GETITEMDATA, sel, 0); dll = (struct dll *) SendDlgItemMessageW(dialog, IDC_DLLS_LIST, LB_GETITEMDATA, sel, 0);
str = mode_to_string(mode); str = mode_to_string(mode);
WINE_TRACE("Setting %s to %s\n", dll->name, str); WINE_TRACE("Setting %s to %s\n", dll->name, str);
SendMessage(GetParent(dialog), PSM_CHANGED, 0, 0); SendMessageW(GetParent(dialog), PSM_CHANGED, 0, 0);
set_reg_key(config_key, keypath("DllOverrides"), dll->name, str); set_reg_key(config_key, keypath("DllOverrides"), dll->name, str);
load_library_settings(dialog); /* ... and refresh */ load_library_settings(dialog); /* ... and refresh */
@ -455,7 +456,7 @@ static void on_add_click(HWND dialog)
ZeroMemory(buffer, sizeof(buffer)); ZeroMemory(buffer, sizeof(buffer));
SendDlgItemMessage(dialog, IDC_DLLCOMBO, WM_GETTEXT, sizeof(buffer), (LPARAM) buffer); SendDlgItemMessageA(dialog, IDC_DLLCOMBO, WM_GETTEXT, sizeof(buffer), (LPARAM) buffer);
if (lstrlenA(buffer) >= sizeof(dotDll)) if (lstrlenA(buffer) >= sizeof(dotDll))
{ {
ptr = buffer + lstrlenA(buffer) - sizeof(dotDll) + 1; ptr = buffer + lstrlenA(buffer) - sizeof(dotDll) + 1;
@ -489,17 +490,17 @@ static void on_add_click(HWND dialog)
if (MessageBoxIndirectA( &params ) != IDYES) return; if (MessageBoxIndirectA( &params ) != IDYES) return;
} }
SendDlgItemMessage(dialog, IDC_DLLCOMBO, WM_SETTEXT, 0, (LPARAM) ""); SendDlgItemMessageW(dialog, IDC_DLLCOMBO, WM_SETTEXT, 0, (LPARAM)emptyW);
disable(IDC_DLLS_ADDDLL); disable(IDC_DLLS_ADDDLL);
WINE_TRACE("Adding %s as native, builtin\n", buffer); WINE_TRACE("Adding %s as native, builtin\n", buffer);
SendMessage(GetParent(dialog), PSM_CHANGED, 0, 0); SendMessageW(GetParent(dialog), PSM_CHANGED, 0, 0);
set_reg_key(config_key, keypath("DllOverrides"), buffer, "native,builtin"); set_reg_key(config_key, keypath("DllOverrides"), buffer, "native,builtin");
load_library_settings(dialog); load_library_settings(dialog);
SendDlgItemMessage(dialog, IDC_DLLS_LIST, LB_SELECTSTRING, 0, (LPARAM) buffer); SendDlgItemMessageA(dialog, IDC_DLLS_LIST, LB_SELECTSTRING, 0, (LPARAM) buffer);
set_controls_from_selection(dialog); set_controls_from_selection(dialog);
} }
@ -539,42 +540,42 @@ static INT_PTR CALLBACK loadorder_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam
static void on_edit_click(HWND hwnd) static void on_edit_click(HWND hwnd)
{ {
INT_PTR ret; INT_PTR ret;
int index = SendDlgItemMessage(hwnd, IDC_DLLS_LIST, LB_GETCURSEL, 0, 0); int index = SendDlgItemMessageW(hwnd, IDC_DLLS_LIST, LB_GETCURSEL, 0, 0);
struct dll *dll; struct dll *dll;
DWORD id; DWORD id;
/* if no override is selected the edit button should be disabled... */ /* if no override is selected the edit button should be disabled... */
assert(index != -1); assert(index != -1);
dll = (struct dll *) SendDlgItemMessage(hwnd, IDC_DLLS_LIST, LB_GETITEMDATA, index, 0); dll = (struct dll *) SendDlgItemMessageW(hwnd, IDC_DLLS_LIST, LB_GETITEMDATA, index, 0);
id = mode_to_id(dll->mode); id = mode_to_id(dll->mode);
ret = DialogBoxParam(0, MAKEINTRESOURCE(IDD_LOADORDER), hwnd, loadorder_dlgproc, id); ret = DialogBoxParamW(0, MAKEINTRESOURCEW(IDD_LOADORDER), hwnd, loadorder_dlgproc, id);
if(ret != IDCANCEL) if(ret != IDCANCEL)
set_dllmode(hwnd, ret); set_dllmode(hwnd, ret);
} }
static void on_remove_click(HWND dialog) static void on_remove_click(HWND dialog)
{ {
int sel = SendDlgItemMessage(dialog, IDC_DLLS_LIST, LB_GETCURSEL, 0, 0); int sel = SendDlgItemMessageW(dialog, IDC_DLLS_LIST, LB_GETCURSEL, 0, 0);
struct dll *dll; struct dll *dll;
if (sel == LB_ERR) return; if (sel == LB_ERR) return;
dll = (struct dll *) SendDlgItemMessage(dialog, IDC_DLLS_LIST, LB_GETITEMDATA, sel, 0);
SendDlgItemMessage(dialog, IDC_DLLS_LIST, LB_DELETESTRING, sel, 0);
SendMessage(GetParent(dialog), PSM_CHANGED, 0, 0); dll = (struct dll *) SendDlgItemMessageW(dialog, IDC_DLLS_LIST, LB_GETITEMDATA, sel, 0);
SendDlgItemMessageW(dialog, IDC_DLLS_LIST, LB_DELETESTRING, sel, 0);
SendMessageW(GetParent(dialog), PSM_CHANGED, 0, 0);
set_reg_key(config_key, keypath("DllOverrides"), dll->name, NULL); set_reg_key(config_key, keypath("DllOverrides"), dll->name, NULL);
HeapFree(GetProcessHeap(), 0, dll->name); HeapFree(GetProcessHeap(), 0, dll->name);
HeapFree(GetProcessHeap(), 0, dll); HeapFree(GetProcessHeap(), 0, dll);
if (SendDlgItemMessage(dialog, IDC_DLLS_LIST, LB_GETCOUNT, 0, 0) > 0) if (SendDlgItemMessageW(dialog, IDC_DLLS_LIST, LB_GETCOUNT, 0, 0) > 0)
SendDlgItemMessage(dialog, IDC_DLLS_LIST, LB_SETCURSEL, max(sel - 1, 0), 0); SendDlgItemMessageW(dialog, IDC_DLLS_LIST, LB_SETCURSEL, max(sel - 1, 0), 0);
else else
{ {
disable(IDC_DLLS_EDITDLL); disable(IDC_DLLS_EDITDLL);

View file

@ -294,7 +294,7 @@ static BOOL fill_theme_list (HWND comboTheme, HWND comboColor, HWND comboSize)
WCHAR currentSize[MAX_PATH]; WCHAR currentSize[MAX_PATH];
ThemeFile* theme = NULL; ThemeFile* theme = NULL;
LoadStringW (GetModuleHandle (NULL), IDS_NOTHEME, textNoTheme, LoadStringW (GetModuleHandleW(NULL), IDS_NOTHEME, textNoTheme,
sizeof(textNoTheme) / sizeof(WCHAR)); sizeof(textNoTheme) / sizeof(WCHAR));
SendMessageW (comboTheme, CB_RESETCONTENT, 0, 0); SendMessageW (comboTheme, CB_RESETCONTENT, 0, 0);
@ -620,11 +620,11 @@ static void on_theme_install(HWND dialog)
WCHAR filter[100]; WCHAR filter[100];
WCHAR title[100]; WCHAR title[100];
LoadStringW (GetModuleHandle (NULL), IDS_THEMEFILE, LoadStringW (GetModuleHandleW(NULL), IDS_THEMEFILE,
filter, sizeof (filter) / sizeof (filter[0]) - filterMaskLen); filter, sizeof (filter) / sizeof (filter[0]) - filterMaskLen);
memcpy (filter + lstrlenW (filter), filterMask, memcpy (filter + lstrlenW (filter), filterMask,
filterMaskLen * sizeof (WCHAR)); filterMaskLen * sizeof (WCHAR));
LoadStringW (GetModuleHandle (NULL), IDS_THEMEFILE_SELECT, LoadStringW (GetModuleHandleW(NULL), IDS_THEMEFILE_SELECT,
title, sizeof (title) / sizeof (title[0])); title, sizeof (title) / sizeof (title[0]));
ofn.lStructSize = sizeof(OPENFILENAMEW); ofn.lStructSize = sizeof(OPENFILENAMEW);
@ -663,7 +663,7 @@ static void on_theme_install(HWND dialog)
if (lstrcmpiW(PathFindExtensionW(filetitle), themeExt)==0) if (lstrcmpiW(PathFindExtensionW(filetitle), themeExt)==0)
{ {
do_parse_theme(file); do_parse_theme(file);
SendMessage(GetParent(dialog), PSM_CHANGED, 0, 0); SendMessageW(GetParent(dialog), PSM_CHANGED, 0, 0);
return; return;
} }
@ -733,30 +733,30 @@ static struct ShellFolderInfo *psfiSelected = NULL;
#define NUM_ELEMS(x) (sizeof(x)/sizeof(*(x))) #define NUM_ELEMS(x) (sizeof(x)/sizeof(*(x)))
static void init_shell_folder_listview_headers(HWND dialog) { static void init_shell_folder_listview_headers(HWND dialog) {
LVCOLUMN listColumn; LVCOLUMNW listColumn;
RECT viewRect; RECT viewRect;
char szShellFolder[64] = "Shell Folder"; WCHAR szShellFolder[64] = {'S','h','e','l','l',' ','F','o','l','d','e','r',0};
char szLinksTo[64] = "Links to"; WCHAR szLinksTo[64] = {'L','i','n','k','s',' ','t','o',0};
int width; int width;
LoadString(GetModuleHandle(NULL), IDS_SHELL_FOLDER, szShellFolder, sizeof(szShellFolder)); LoadStringW(GetModuleHandleW(NULL), IDS_SHELL_FOLDER, szShellFolder, sizeof(szShellFolder)/sizeof(WCHAR));
LoadString(GetModuleHandle(NULL), IDS_LINKS_TO, szLinksTo, sizeof(szLinksTo)); LoadStringW(GetModuleHandleW(NULL), IDS_LINKS_TO, szLinksTo, sizeof(szLinksTo)/sizeof(WCHAR));
GetClientRect(GetDlgItem(dialog, IDC_LIST_SFPATHS), &viewRect); GetClientRect(GetDlgItem(dialog, IDC_LIST_SFPATHS), &viewRect);
width = (viewRect.right - viewRect.left) / 4; width = (viewRect.right - viewRect.left) / 4;
listColumn.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM; listColumn.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM;
listColumn.pszText = szShellFolder; listColumn.pszText = szShellFolder;
listColumn.cchTextMax = lstrlen(listColumn.pszText); listColumn.cchTextMax = strlenW(listColumn.pszText);
listColumn.cx = width; listColumn.cx = width;
SendDlgItemMessage(dialog, IDC_LIST_SFPATHS, LVM_INSERTCOLUMN, 0, (LPARAM) &listColumn); SendDlgItemMessageW(dialog, IDC_LIST_SFPATHS, LVM_INSERTCOLUMNW, 0, (LPARAM) &listColumn);
listColumn.pszText = szLinksTo; listColumn.pszText = szLinksTo;
listColumn.cchTextMax = lstrlen(listColumn.pszText); listColumn.cchTextMax = strlenW(listColumn.pszText);
listColumn.cx = viewRect.right - viewRect.left - width - 1; listColumn.cx = viewRect.right - viewRect.left - width - 1;
SendDlgItemMessage(dialog, IDC_LIST_SFPATHS, LVM_INSERTCOLUMN, 1, (LPARAM) &listColumn); SendDlgItemMessageW(dialog, IDC_LIST_SFPATHS, LVM_INSERTCOLUMNW, 1, (LPARAM) &listColumn);
} }
/* Reads the currently set shell folder symbol link targets into asfiInfo. */ /* Reads the currently set shell folder symbol link targets into asfiInfo. */
@ -786,10 +786,10 @@ static void read_shell_folder_link_targets(void) {
static void update_shell_folder_listview(HWND dialog) { static void update_shell_folder_listview(HWND dialog) {
int i; int i;
LVITEMW item; LVITEMW item;
LONG lSelected = SendDlgItemMessage(dialog, IDC_LIST_SFPATHS, LVM_GETNEXTITEM, -1, LONG lSelected = SendDlgItemMessageW(dialog, IDC_LIST_SFPATHS, LVM_GETNEXTITEM, -1,
MAKELPARAM(LVNI_SELECTED,0)); MAKELPARAM(LVNI_SELECTED,0));
SendDlgItemMessage(dialog, IDC_LIST_SFPATHS, LVM_DELETEALLITEMS, 0, 0); SendDlgItemMessageW(dialog, IDC_LIST_SFPATHS, LVM_DELETEALLITEMS, 0, 0);
for (i=0; i<NUM_ELEMS(asfiInfo); i++) { for (i=0; i<NUM_ELEMS(asfiInfo); i++) {
WCHAR buffer[MAX_PATH]; WCHAR buffer[MAX_PATH];
@ -825,13 +825,13 @@ static void update_shell_folder_listview(HWND dialog) {
item.iSubItem = 0; item.iSubItem = 0;
item.pszText = buffer; item.pszText = buffer;
item.lParam = (LPARAM)&asfiInfo[i]; item.lParam = (LPARAM)&asfiInfo[i];
SendDlgItemMessage(dialog, IDC_LIST_SFPATHS, LVM_INSERTITEMW, 0, (LPARAM)&item); SendDlgItemMessageW(dialog, IDC_LIST_SFPATHS, LVM_INSERTITEMW, 0, (LPARAM)&item);
item.mask = LVIF_TEXT; item.mask = LVIF_TEXT;
item.iItem = i; item.iItem = i;
item.iSubItem = 1; item.iSubItem = 1;
item.pszText = strdupU2W(asfiInfo[i].szLinkTarget); item.pszText = strdupU2W(asfiInfo[i].szLinkTarget);
SendDlgItemMessage(dialog, IDC_LIST_SFPATHS, LVM_SETITEMW, 0, (LPARAM)&item); SendDlgItemMessageW(dialog, IDC_LIST_SFPATHS, LVM_SETITEMW, 0, (LPARAM)&item);
HeapFree(GetProcessHeap(), 0, item.pszText); HeapFree(GetProcessHeap(), 0, item.pszText);
} }
@ -840,8 +840,7 @@ static void update_shell_folder_listview(HWND dialog) {
item.mask = LVIF_STATE; item.mask = LVIF_STATE;
item.state = LVIS_SELECTED; item.state = LVIS_SELECTED;
item.stateMask = LVIS_SELECTED; item.stateMask = LVIS_SELECTED;
SendDlgItemMessage(dialog, IDC_LIST_SFPATHS, LVM_SETITEMSTATE, lSelected, SendDlgItemMessageW(dialog, IDC_LIST_SFPATHS, LVM_SETITEMSTATE, lSelected, (LPARAM)&item);
(LPARAM)&item);
} }
} }
@ -878,9 +877,9 @@ static void on_shell_folder_selection_changed(HWND hDlg, LPNMLISTVIEW lpnm) {
static void on_shell_folder_edit_changed(HWND hDlg) { static void on_shell_folder_edit_changed(HWND hDlg) {
LVITEMW item; LVITEMW item;
WCHAR *text = get_textW(hDlg, IDC_EDIT_SFPATH); WCHAR *text = get_textW(hDlg, IDC_EDIT_SFPATH);
LONG iSel = SendDlgItemMessage(hDlg, IDC_LIST_SFPATHS, LVM_GETNEXTITEM, -1, LONG iSel = SendDlgItemMessageW(hDlg, IDC_LIST_SFPATHS, LVM_GETNEXTITEM, -1,
MAKELPARAM(LVNI_SELECTED,0)); MAKELPARAM(LVNI_SELECTED,0));
if (!text || !psfiSelected || iSel < 0) { if (!text || !psfiSelected || iSel < 0) {
HeapFree(GetProcessHeap(), 0, text); HeapFree(GetProcessHeap(), 0, text);
return; return;
@ -893,11 +892,11 @@ static void on_shell_folder_edit_changed(HWND hDlg) {
item.iItem = iSel; item.iItem = iSel;
item.iSubItem = 1; item.iSubItem = 1;
item.pszText = text; item.pszText = text;
SendDlgItemMessage(hDlg, IDC_LIST_SFPATHS, LVM_SETITEMW, 0, (LPARAM)&item); SendDlgItemMessageW(hDlg, IDC_LIST_SFPATHS, LVM_SETITEMW, 0, (LPARAM)&item);
HeapFree(GetProcessHeap(), 0, text); HeapFree(GetProcessHeap(), 0, text);
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0); SendMessageW(GetParent(hDlg), PSM_CHANGED, 0, 0);
} }
static void apply_shell_folder_changes(void) { static void apply_shell_folder_changes(void) {
@ -964,7 +963,7 @@ static void read_sysparams(HWND hDlg)
for (i = 0; i < sizeof(metrics) / sizeof(metrics[0]); i++) for (i = 0; i < sizeof(metrics) / sizeof(metrics[0]); i++)
{ {
LoadStringW(GetModuleHandle(NULL), i + IDC_SYSPARAMS_BUTTON, buffer, LoadStringW(GetModuleHandleW(NULL), i + IDC_SYSPARAMS_BUTTON, buffer,
sizeof(buffer) / sizeof(buffer[0])); sizeof(buffer) / sizeof(buffer[0]));
idx = SendMessageW(list, CB_ADDSTRING, 0, (LPARAM)buffer); idx = SendMessageW(list, CB_ADDSTRING, 0, (LPARAM)buffer);
if (idx != CB_ERR) SendMessageW(list, CB_SETITEMDATA, idx, i); if (idx != CB_ERR) SendMessageW(list, CB_SETITEMDATA, idx, i);
@ -1140,7 +1139,7 @@ ThemeDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
case IDC_THEME_SIZECOMBO: theme_dirty = TRUE; break; case IDC_THEME_SIZECOMBO: theme_dirty = TRUE; break;
case IDC_SYSPARAM_COMBO: on_sysparam_change(hDlg); return FALSE; case IDC_SYSPARAM_COMBO: on_sysparam_change(hDlg); return FALSE;
} }
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0); SendMessageW(GetParent(hDlg), PSM_CHANGED, 0, 0);
break; break;
} }
case EN_CHANGE: { case EN_CHANGE: {
@ -1157,7 +1156,7 @@ ThemeDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
metrics[index].size = atoi(text); metrics[index].size = atoi(text);
HeapFree(GetProcessHeap(), 0, text); HeapFree(GetProcessHeap(), 0, text);
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0); SendMessageW(GetParent(hDlg), PSM_CHANGED, 0, 0);
break; break;
} }
} }
@ -1182,7 +1181,7 @@ ThemeDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
psfiSelected->szLinkTarget, FILENAME_MAX, psfiSelected->szLinkTarget, FILENAME_MAX,
NULL, NULL); NULL, NULL);
update_shell_folder_listview(hDlg); update_shell_folder_listview(hDlg);
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0); SendMessageW(GetParent(hDlg), PSM_CHANGED, 0, 0);
} }
break; break;
} }
@ -1195,14 +1194,14 @@ ThemeDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
psfiSelected->szLinkTarget, FILENAME_MAX, psfiSelected->szLinkTarget, FILENAME_MAX,
NULL, NULL); NULL, NULL);
update_shell_folder_listview(hDlg); update_shell_folder_listview(hDlg);
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0); SendMessageW(GetParent(hDlg), PSM_CHANGED, 0, 0);
} else { } else {
CheckDlgButton(hDlg, IDC_LINK_SFPATH, BST_UNCHECKED); CheckDlgButton(hDlg, IDC_LINK_SFPATH, BST_UNCHECKED);
} }
} else { } else {
psfiSelected->szLinkTarget[0] = '\0'; psfiSelected->szLinkTarget[0] = '\0';
update_shell_folder_listview(hDlg); update_shell_folder_listview(hDlg);
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0); SendMessageW(GetParent(hDlg), PSM_CHANGED, 0, 0);
} }
break; break;
@ -1225,7 +1224,7 @@ ThemeDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
metrics[index].color = c_color.rgbResult; metrics[index].color = c_color.rgbResult;
save_sys_color(index, metrics[index].color); save_sys_color(index, metrics[index].color);
InvalidateRect(GetDlgItem(hDlg, IDC_SYSPARAM_COLOR), NULL, TRUE); InvalidateRect(GetDlgItem(hDlg, IDC_SYSPARAM_COLOR), NULL, TRUE);
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0); SendMessageW(GetParent(hDlg), PSM_CHANGED, 0, 0);
} }
break; break;
} }
@ -1237,7 +1236,7 @@ ThemeDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_NOTIFY: case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) { switch (((LPNMHDR)lParam)->code) {
case PSN_KILLACTIVE: { case PSN_KILLACTIVE: {
SetWindowLongPtr(hDlg, DWLP_MSGRESULT, FALSE); SetWindowLongPtrW(hDlg, DWLP_MSGRESULT, FALSE);
break; break;
} }
case PSN_APPLY: { case PSN_APPLY: {
@ -1247,7 +1246,7 @@ ThemeDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
apply_sysparams(); apply_sysparams();
read_shell_folder_link_targets(); read_shell_folder_link_targets();
update_shell_folder_listview(hDlg); update_shell_folder_listview(hDlg);
SetWindowLongPtr(hDlg, DWLP_MSGRESULT, PSNRET_NOERROR); SetWindowLongPtrW(hDlg, DWLP_MSGRESULT, PSNRET_NOERROR);
break; break;
} }
case LVN_ITEMCHANGED: { case LVN_ITEMCHANGED: {

View file

@ -62,13 +62,13 @@ void set_window_title(HWND dialog)
if (current_app) if (current_app)
{ {
WCHAR apptitle[256]; WCHAR apptitle[256];
LoadStringW (GetModuleHandle(NULL), IDS_WINECFG_TITLE_APP, apptitle, LoadStringW (GetModuleHandleW(NULL), IDS_WINECFG_TITLE_APP, apptitle,
sizeof(apptitle)/sizeof(apptitle[0])); sizeof(apptitle)/sizeof(apptitle[0]));
wsprintfW (newtitle, apptitle, current_app); wsprintfW (newtitle, apptitle, current_app);
} }
else else
{ {
LoadStringW (GetModuleHandle(NULL), IDS_WINECFG_TITLE, newtitle, LoadStringW (GetModuleHandleW(NULL), IDS_WINECFG_TITLE, newtitle,
sizeof(newtitle)/sizeof(newtitle[0])); sizeof(newtitle)/sizeof(newtitle[0]));
} }
@ -83,7 +83,7 @@ WCHAR* load_string (UINT id)
int len; int len;
WCHAR* newStr; WCHAR* newStr;
LoadStringW (GetModuleHandle (NULL), id, buf, sizeof(buf)/sizeof(buf[0])); LoadStringW (GetModuleHandleW(NULL), id, buf, sizeof(buf)/sizeof(buf[0]));
len = lstrlenW (buf); len = lstrlenW (buf);
newStr = HeapAlloc (GetProcessHeap(), 0, (len + 1) * sizeof (WCHAR)); newStr = HeapAlloc (GetProcessHeap(), 0, (len + 1) * sizeof (WCHAR));
@ -697,7 +697,7 @@ char *keypath(const char *section)
if (current_app) if (current_app)
{ {
result = HeapAlloc(GetProcessHeap(), 0, strlen("AppDefaults\\") + lstrlenW(current_app)*2 + 2 /* \\ */ + strlen(section) + 1 /* terminator */); result = HeapAlloc(GetProcessHeap(), 0, strlen("AppDefaults\\") + lstrlenW(current_app)*2 + 2 /* \\ */ + strlen(section) + 1 /* terminator */);
wsprintf(result, "AppDefaults\\%ls", current_app); wsprintfA(result, "AppDefaults\\%ls", current_app);
if (section[0]) sprintf( result + strlen(result), "\\%s", section ); if (section[0]) sprintf( result + strlen(result), "\\%s", section );
} }
else else
@ -752,7 +752,7 @@ void PRINTERROR(void)
int initialize(HINSTANCE hInstance) int initialize(HINSTANCE hInstance)
{ {
DWORD res = RegCreateKey(HKEY_CURRENT_USER, WINE_KEY_ROOT, &config_key); DWORD res = RegCreateKeyA(HKEY_CURRENT_USER, WINE_KEY_ROOT, &config_key);
if (res != ERROR_SUCCESS) { if (res != ERROR_SUCCESS) {
WINE_ERR("RegOpenKey failed on wine config key (%d)\n", res); WINE_ERR("RegOpenKey failed on wine config key (%d)\n", res);

View file

@ -152,9 +152,9 @@ static inline WCHAR *strdupU2W(const char *unix_str)
static inline char *get_text(HWND dialog, WORD id) static inline char *get_text(HWND dialog, WORD id)
{ {
HWND item = GetDlgItem(dialog, id); HWND item = GetDlgItem(dialog, id);
int len = GetWindowTextLength(item) + 1; int len = GetWindowTextLengthA(item) + 1;
char *result = len ? HeapAlloc(GetProcessHeap(), 0, len) : NULL; char *result = len ? HeapAlloc(GetProcessHeap(), 0, len) : NULL;
if (!result || GetWindowText(item, result, len) == 0) return NULL; if (!result || GetWindowTextA(item, result, len) == 0) return NULL;
return result; return result;
} }
@ -169,7 +169,7 @@ static inline WCHAR *get_textW(HWND dialog, WORD id)
static inline void set_text(HWND dialog, WORD id, const char *text) static inline void set_text(HWND dialog, WORD id, const char *text)
{ {
SetWindowText(GetDlgItem(dialog, id), text); SetWindowTextA(GetDlgItem(dialog, id), text);
} }
static inline void set_textW(HWND dialog, WORD id, const WCHAR *text) static inline void set_textW(HWND dialog, WORD id, const WCHAR *text)

View file

@ -168,11 +168,11 @@ BEGIN
EDITTEXT IDC_DESKTOP_WIDTH,84,68,40,12,ES_AUTOHSCROLL | ES_NUMBER | WS_DISABLED EDITTEXT IDC_DESKTOP_WIDTH,84,68,40,12,ES_AUTOHSCROLL | ES_NUMBER | WS_DISABLED
EDITTEXT IDC_DESKTOP_HEIGHT,137,68,40,12,ES_AUTOHSCROLL | ES_NUMBER | WS_DISABLED EDITTEXT IDC_DESKTOP_HEIGHT,137,68,40,12,ES_AUTOHSCROLL | ES_NUMBER | WS_DISABLED
GROUPBOX "Screen resolution",IDC_STATIC,8,95,244,63 GROUPBOX "Screen resolution",IDC_STATIC,8,95,244,84
CONTROL "", IDC_RES_TRACKBAR, "msctls_trackbar32",WS_TABSTOP,12,105,171,15 CONTROL "", IDC_RES_TRACKBAR, "msctls_trackbar32",WS_TABSTOP,12,105,171,15
EDITTEXT IDC_RES_DPIEDIT,188,105,23,13,ES_NUMBER|WS_TABSTOP EDITTEXT IDC_RES_DPIEDIT,188,105,23,13,ES_NUMBER|WS_TABSTOP
LTEXT "#msgctxt#unit: dots/inch#dpi",IDC_STATIC,215,107,30,8 LTEXT "#msgctxt#unit: dots/inch#dpi",IDC_STATIC,215,107,30,8
LTEXT "This is a sample text using 10 point Tahoma",IDC_RES_FONT_PREVIEW,15,124,230,28 LTEXT "This is a sample text using 10 point Tahoma",IDC_RES_FONT_PREVIEW,15,124,230,49
END END
IDD_DLLCFG DIALOG 0, 0, 260, 220 IDD_DLLCFG DIALOG 0, 0, 260, 220
@ -285,7 +285,7 @@ BEGIN
PUSHBUTTON "",IDC_SYSPARAM_COLOR,133,90,25,13,WS_DISABLED | BS_OWNERDRAW PUSHBUTTON "",IDC_SYSPARAM_COLOR,133,90,25,13,WS_DISABLED | BS_OWNERDRAW
LTEXT "Si&ze:",IDC_SYSPARAM_SIZE_TEXT,164,80,30,8,WS_DISABLED LTEXT "Si&ze:",IDC_SYSPARAM_SIZE_TEXT,164,80,30,8,WS_DISABLED
EDITTEXT IDC_SYSPARAM_SIZE,164,90,23,13,ES_AUTOHSCROLL | WS_TABSTOP | WS_DISABLED EDITTEXT IDC_SYSPARAM_SIZE,164,90,23,13,ES_AUTOHSCROLL | WS_TABSTOP | WS_DISABLED
CONTROL "",IDC_SYSPARAM_SIZE_UD,UPDOWN_CLASS,UDS_SETBUDDYINT | WS_DISABLED,185,90,15,13 CONTROL "",IDC_SYSPARAM_SIZE_UD,UPDOWN_CLASSA,UDS_SETBUDDYINT | WS_DISABLED,185,90,15,13
PUSHBUTTON "&Font...",IDC_SYSPARAM_FONT,200,90,45,13,WS_DISABLED PUSHBUTTON "&Font...",IDC_SYSPARAM_FONT,200,90,45,13,WS_DISABLED
GROUPBOX "Folders",IDC_STATIC,8,114,244,100 GROUPBOX "Folders",IDC_STATIC,8,114,244,100
CONTROL "",IDC_LIST_SFPATHS,"SysListView32",LVS_REPORT | LVS_AUTOARRANGE | LVS_ALIGNLEFT | CONTROL "",IDC_LIST_SFPATHS,"SysListView32",LVS_REPORT | LVS_AUTOARRANGE | LVS_ALIGNLEFT |

View file

@ -85,8 +85,8 @@ static void update_gui_for_desktop_mode(HWND dialog)
SetWindowTextW(GetDlgItem(dialog, IDC_DESKTOP_WIDTH), buf); SetWindowTextW(GetDlgItem(dialog, IDC_DESKTOP_WIDTH), buf);
SetWindowTextW(GetDlgItem(dialog, IDC_DESKTOP_HEIGHT), bufindex); SetWindowTextW(GetDlgItem(dialog, IDC_DESKTOP_HEIGHT), bufindex);
} else { } else {
SetWindowText(GetDlgItem(dialog, IDC_DESKTOP_WIDTH), "800"); SetWindowTextA(GetDlgItem(dialog, IDC_DESKTOP_WIDTH), "800");
SetWindowText(GetDlgItem(dialog, IDC_DESKTOP_HEIGHT), "600"); SetWindowTextA(GetDlgItem(dialog, IDC_DESKTOP_HEIGHT), "600");
} }
HeapFree(GetProcessHeap(), 0, buf); HeapFree(GetProcessHeap(), 0, buf);
@ -119,9 +119,9 @@ static void init_dialog(HWND dialog)
update_gui_for_desktop_mode(dialog); update_gui_for_desktop_mode(dialog);
updating_ui = TRUE; updating_ui = TRUE;
SendDlgItemMessage(dialog, IDC_DESKTOP_WIDTH, EM_LIMITTEXT, RES_MAXLEN, 0); SendDlgItemMessageW(dialog, IDC_DESKTOP_WIDTH, EM_LIMITTEXT, RES_MAXLEN, 0);
SendDlgItemMessage(dialog, IDC_DESKTOP_HEIGHT, EM_LIMITTEXT, RES_MAXLEN, 0); SendDlgItemMessageW(dialog, IDC_DESKTOP_HEIGHT, EM_LIMITTEXT, RES_MAXLEN, 0);
buf = get_reg_key(config_key, keypath("X11 Driver"), "GrabFullscreen", "N"); buf = get_reg_key(config_key, keypath("X11 Driver"), "GrabFullscreen", "N");
if (IS_OPTION_TRUE(*buf)) if (IS_OPTION_TRUE(*buf))
@ -246,16 +246,17 @@ static INT read_logpixels_reg(void)
static void init_dpi_editbox(HWND hDlg) static void init_dpi_editbox(HWND hDlg)
{ {
static const WCHAR fmtW[] = {'%','u',0};
DWORD dwLogpixels; DWORD dwLogpixels;
char szLogpixels[MAXBUFLEN]; WCHAR szLogpixels[MAXBUFLEN];
updating_ui = TRUE; updating_ui = TRUE;
dwLogpixels = read_logpixels_reg(); dwLogpixels = read_logpixels_reg();
WINE_TRACE("%u\n", dwLogpixels); WINE_TRACE("%u\n", dwLogpixels);
sprintf(szLogpixels, "%u", dwLogpixels); sprintfW(szLogpixels, fmtW, dwLogpixels);
SetDlgItemText(hDlg, IDC_RES_DPIEDIT, szLogpixels); SetDlgItemTextW(hDlg, IDC_RES_DPIEDIT, szLogpixels);
updating_ui = FALSE; updating_ui = FALSE;
} }
@ -277,6 +278,7 @@ static void init_trackbar(HWND hDlg)
static void update_dpi_trackbar_from_edit(HWND hDlg, BOOL fix) static void update_dpi_trackbar_from_edit(HWND hDlg, BOOL fix)
{ {
static const WCHAR fmtW[] = {'%','u',0};
DWORD dpi; DWORD dpi;
updating_ui = TRUE; updating_ui = TRUE;
@ -292,17 +294,17 @@ static void update_dpi_trackbar_from_edit(HWND hDlg, BOOL fix)
if (fixed_dpi != dpi) if (fixed_dpi != dpi)
{ {
char buf[16]; WCHAR buf[16];
dpi = fixed_dpi; dpi = fixed_dpi;
sprintf(buf, "%u", dpi); sprintfW(buf, fmtW, dpi);
SetDlgItemText(hDlg, IDC_RES_DPIEDIT, buf); SetDlgItemTextW(hDlg, IDC_RES_DPIEDIT, buf);
} }
} }
if (dpi >= MINDPI && dpi <= MAXDPI) if (dpi >= MINDPI && dpi <= MAXDPI)
{ {
SendDlgItemMessage(hDlg, IDC_RES_TRACKBAR, TBM_SETPOS, TRUE, dpi); SendDlgItemMessageW(hDlg, IDC_RES_TRACKBAR, TBM_SETPOS, TRUE, dpi);
set_reg_key_dwordW(HKEY_LOCAL_MACHINE, logpixels_reg, logpixels, dpi); set_reg_key_dwordW(HKEY_LOCAL_MACHINE, logpixels_reg, logpixels, dpi);
} }
@ -319,21 +321,21 @@ static void update_font_preview(HWND hDlg)
if (dpi >= MINDPI && dpi <= MAXDPI) if (dpi >= MINDPI && dpi <= MAXDPI)
{ {
LOGFONT lf; static const WCHAR tahomaW[] = {'T','a','h','o','m','a',0};
LOGFONTW lf;
HFONT hfont; HFONT hfont;
hfont = (HFONT)SendDlgItemMessage(hDlg, IDC_RES_FONT_PREVIEW, WM_GETFONT, 0, 0); hfont = (HFONT)SendDlgItemMessageW(hDlg, IDC_RES_FONT_PREVIEW, WM_GETFONT, 0, 0);
GetObject(hfont, sizeof(lf), &lf); GetObjectW(hfont, sizeof(lf), &lf);
if (lstrcmp(lf.lfFaceName, "Tahoma") != 0) if (strcmpW(lf.lfFaceName, tahomaW) != 0)
lstrcpy(lf.lfFaceName, "Tahoma"); strcpyW(lf.lfFaceName, tahomaW);
else else
DeleteObject(hfont); DeleteObject(hfont);
lf.lfHeight = MulDiv(-10, dpi, 72); lf.lfHeight = MulDiv(-10, dpi, 72);
hfont = CreateFontIndirect(&lf); hfont = CreateFontIndirectW(&lf);
SendDlgItemMessage(hDlg, IDC_RES_FONT_PREVIEW, WM_SETFONT, (WPARAM)hfont, 1); SendDlgItemMessageW(hDlg, IDC_RES_FONT_PREVIEW, WM_SETFONT, (WPARAM)hfont, 1);
} }
updating_ui = FALSE; updating_ui = FALSE;
@ -366,7 +368,7 @@ GraphDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
switch(HIWORD(wParam)) { switch(HIWORD(wParam)) {
case EN_CHANGE: { case EN_CHANGE: {
if (updating_ui) break; if (updating_ui) break;
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0); SendMessageW(GetParent(hDlg), PSM_CHANGED, 0, 0);
if ( ((LOWORD(wParam) == IDC_DESKTOP_WIDTH) || (LOWORD(wParam) == IDC_DESKTOP_HEIGHT)) && !updating_ui ) if ( ((LOWORD(wParam) == IDC_DESKTOP_WIDTH) || (LOWORD(wParam) == IDC_DESKTOP_HEIGHT)) && !updating_ui )
set_from_desktop_edits(hDlg); set_from_desktop_edits(hDlg);
else if (LOWORD(wParam) == IDC_RES_DPIEDIT) else if (LOWORD(wParam) == IDC_RES_DPIEDIT)
@ -379,7 +381,7 @@ GraphDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
} }
case BN_CLICKED: { case BN_CLICKED: {
if (updating_ui) break; if (updating_ui) break;
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0); SendMessageW(GetParent(hDlg), PSM_CHANGED, 0, 0);
switch(LOWORD(wParam)) { switch(LOWORD(wParam)) {
case IDC_ENABLE_DESKTOP: on_enable_desktop_clicked(hDlg); break; case IDC_ENABLE_DESKTOP: on_enable_desktop_clicked(hDlg); break;
case IDC_ENABLE_MANAGED: on_enable_managed_clicked(hDlg); break; case IDC_ENABLE_MANAGED: on_enable_managed_clicked(hDlg); break;
@ -389,7 +391,7 @@ GraphDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
break; break;
} }
case CBN_SELCHANGE: { case CBN_SELCHANGE: {
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0); SendMessageW(GetParent(hDlg), PSM_CHANGED, 0, 0);
break; break;
} }
@ -402,12 +404,12 @@ GraphDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_NOTIFY: case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) { switch (((LPNMHDR)lParam)->code) {
case PSN_KILLACTIVE: { case PSN_KILLACTIVE: {
SetWindowLongPtr(hDlg, DWLP_MSGRESULT, FALSE); SetWindowLongPtrW(hDlg, DWLP_MSGRESULT, FALSE);
break; break;
} }
case PSN_APPLY: { case PSN_APPLY: {
apply(); apply();
SetWindowLongPtr(hDlg, DWLP_MSGRESULT, PSNRET_NOERROR); SetWindowLongPtrW(hDlg, DWLP_MSGRESULT, PSNRET_NOERROR);
break; break;
} }
case PSN_SETACTIVE: { case PSN_SETACTIVE: {
@ -420,11 +422,12 @@ GraphDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_HSCROLL: case WM_HSCROLL:
switch (wParam) { switch (wParam) {
default: { default: {
char buf[MAXBUFLEN]; static const WCHAR fmtW[] = {'%','d',0};
WCHAR buf[MAXBUFLEN];
int i = SendMessageW(GetDlgItem(hDlg, IDC_RES_TRACKBAR), TBM_GETPOS, 0, 0); int i = SendMessageW(GetDlgItem(hDlg, IDC_RES_TRACKBAR), TBM_GETPOS, 0, 0);
buf[0] = 0; buf[0] = 0;
sprintf(buf, "%d", i); sprintfW(buf, fmtW, i);
SendMessage(GetDlgItem(hDlg, IDC_RES_DPIEDIT), WM_SETTEXT, 0, (LPARAM) buf); SendMessageW(GetDlgItem(hDlg, IDC_RES_DPIEDIT), WM_SETTEXT, 0, (LPARAM) buf);
update_font_preview(hDlg); update_font_preview(hDlg);
set_reg_key_dwordW(HKEY_LOCAL_MACHINE, logpixels_reg, logpixels, i); set_reg_key_dwordW(HKEY_LOCAL_MACHINE, logpixels_reg, logpixels, i);
break; break;