winefile: Change the settings functions to use the W registry functions.
This commit is contained in:
parent
f987ca01d0
commit
837bd5356d
|
@ -1593,25 +1593,25 @@ static windowOptions load_registry_settings(void)
|
||||||
HKEY hKey;
|
HKEY hKey;
|
||||||
windowOptions opts;
|
windowOptions opts;
|
||||||
|
|
||||||
RegOpenKeyEx( HKEY_CURRENT_USER, registry_key,
|
RegOpenKeyExW( HKEY_CURRENT_USER, registry_key,
|
||||||
0, KEY_QUERY_VALUE, &hKey );
|
0, KEY_QUERY_VALUE, &hKey );
|
||||||
|
|
||||||
size = sizeof(DWORD);
|
size = sizeof(DWORD);
|
||||||
|
|
||||||
if( RegQueryValueEx( hKey, reg_start_x, NULL, &type,
|
if( RegQueryValueExW( hKey, reg_start_x, NULL, &type,
|
||||||
(LPBYTE) &opts.start_x, &size ) != ERROR_SUCCESS )
|
(LPBYTE) &opts.start_x, &size ) != ERROR_SUCCESS )
|
||||||
opts.start_x = CW_USEDEFAULT;
|
opts.start_x = CW_USEDEFAULT;
|
||||||
|
|
||||||
if( RegQueryValueEx( hKey, reg_start_y, NULL, &type,
|
if( RegQueryValueExW( hKey, reg_start_y, NULL, &type,
|
||||||
(LPBYTE) &opts.start_y, &size ) != ERROR_SUCCESS )
|
(LPBYTE) &opts.start_y, &size ) != ERROR_SUCCESS )
|
||||||
opts.start_y = CW_USEDEFAULT;
|
opts.start_y = CW_USEDEFAULT;
|
||||||
|
|
||||||
if( RegQueryValueEx( hKey, reg_width, NULL, &type,
|
if( RegQueryValueExW( hKey, reg_width, NULL, &type,
|
||||||
(LPBYTE) &opts.width, &size ) != ERROR_SUCCESS )
|
(LPBYTE) &opts.width, &size ) != ERROR_SUCCESS )
|
||||||
opts.width = CW_USEDEFAULT;
|
opts.width = CW_USEDEFAULT;
|
||||||
|
|
||||||
if( RegQueryValueEx( hKey, reg_height, NULL, &type,
|
if( RegQueryValueExW( hKey, reg_height, NULL, &type,
|
||||||
(LPBYTE) &opts.height, &size ) != ERROR_SUCCESS )
|
(LPBYTE) &opts.height, &size ) != ERROR_SUCCESS )
|
||||||
opts.height = CW_USEDEFAULT;
|
opts.height = CW_USEDEFAULT;
|
||||||
|
|
||||||
RegCloseKey( hKey );
|
RegCloseKey( hKey );
|
||||||
|
@ -1630,27 +1630,27 @@ static void save_registry_settings(void)
|
||||||
width = wi.rcWindow.right - wi.rcWindow.left;
|
width = wi.rcWindow.right - wi.rcWindow.left;
|
||||||
height = wi.rcWindow.bottom - wi.rcWindow.top;
|
height = wi.rcWindow.bottom - wi.rcWindow.top;
|
||||||
|
|
||||||
if ( RegOpenKeyEx( HKEY_CURRENT_USER, registry_key,
|
if ( RegOpenKeyExW( HKEY_CURRENT_USER, registry_key,
|
||||||
0, KEY_SET_VALUE, &hKey ) != ERROR_SUCCESS )
|
0, KEY_SET_VALUE, &hKey ) != ERROR_SUCCESS )
|
||||||
{
|
{
|
||||||
/* Unable to save registry settings - try to create key */
|
/* Unable to save registry settings - try to create key */
|
||||||
if ( RegCreateKeyEx( HKEY_CURRENT_USER, registry_key,
|
if ( RegCreateKeyExW( HKEY_CURRENT_USER, registry_key,
|
||||||
0, NULL, REG_OPTION_NON_VOLATILE,
|
0, NULL, REG_OPTION_NON_VOLATILE,
|
||||||
KEY_SET_VALUE, NULL, &hKey, NULL ) != ERROR_SUCCESS )
|
KEY_SET_VALUE, NULL, &hKey, NULL ) != ERROR_SUCCESS )
|
||||||
{
|
{
|
||||||
/* FIXME: Cannot create key */
|
/* FIXME: Cannot create key */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Save all of the settings */
|
/* Save all of the settings */
|
||||||
RegSetValueEx( hKey, reg_start_x, 0, REG_DWORD,
|
RegSetValueExW( hKey, reg_start_x, 0, REG_DWORD,
|
||||||
(LPBYTE) &wi.rcWindow.left, sizeof(DWORD) );
|
(LPBYTE) &wi.rcWindow.left, sizeof(DWORD) );
|
||||||
RegSetValueEx( hKey, reg_start_y, 0, REG_DWORD,
|
RegSetValueExW( hKey, reg_start_y, 0, REG_DWORD,
|
||||||
(LPBYTE) &wi.rcWindow.top, sizeof(DWORD) );
|
(LPBYTE) &wi.rcWindow.top, sizeof(DWORD) );
|
||||||
RegSetValueEx( hKey, reg_width, 0, REG_DWORD,
|
RegSetValueExW( hKey, reg_width, 0, REG_DWORD,
|
||||||
(LPBYTE) &width, sizeof(DWORD) );
|
(LPBYTE) &width, sizeof(DWORD) );
|
||||||
RegSetValueEx( hKey, reg_height, 0, REG_DWORD,
|
RegSetValueExW( hKey, reg_height, 0, REG_DWORD,
|
||||||
(LPBYTE) &height, sizeof(DWORD) );
|
(LPBYTE) &height, sizeof(DWORD) );
|
||||||
|
|
||||||
/* TODO: Save more settings here (List vs. Detailed View, etc.) */
|
/* TODO: Save more settings here (List vs. Detailed View, etc.) */
|
||||||
RegCloseKey( hKey );
|
RegCloseKey( hKey );
|
||||||
|
|
Loading…
Reference in New Issue