Commit 5b11157e authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

explorer: Use wide string literals.

parent 43fd81b3
...@@ -288,14 +288,13 @@ static LRESULT CALLBACK appbar_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARA ...@@ -288,14 +288,13 @@ static LRESULT CALLBACK appbar_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARA
void initialize_appbar(void) void initialize_appbar(void)
{ {
WNDCLASSEXW class; WNDCLASSEXW class;
static const WCHAR classname[] = {'W','i','n','e','A','p','p','B','a','r',0};
/* register the appbar window class */ /* register the appbar window class */
ZeroMemory(&class, sizeof(class)); ZeroMemory(&class, sizeof(class));
class.cbSize = sizeof(class); class.cbSize = sizeof(class);
class.lpfnWndProc = appbar_wndproc; class.lpfnWndProc = appbar_wndproc;
class.hInstance = NULL; class.hInstance = NULL;
class.lpszClassName = classname; class.lpszClassName = L"WineAppBar";
if (!RegisterClassExW(&class)) if (!RegisterClassExW(&class))
{ {
...@@ -303,7 +302,7 @@ void initialize_appbar(void) ...@@ -303,7 +302,7 @@ void initialize_appbar(void)
return; return;
} }
appbarmsg_window = CreateWindowW(classname, classname, 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, NULL); appbarmsg_window = CreateWindowW(class.lpszClassName, class.lpszClassName, 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, NULL);
if (!appbarmsg_window) if (!appbarmsg_window)
{ {
ERR( "Could not create appbar message window\n" ); ERR( "Could not create appbar message window\n" );
......
...@@ -276,12 +276,6 @@ static void draw_launchers( HDC hdc, RECT update_rect ) ...@@ -276,12 +276,6 @@ static void draw_launchers( HDC hdc, RECT update_rect )
SetBkMode( hdc, mode ); SetBkMode( hdc, mode );
} }
static void do_launch( const struct launcher *launcher )
{
static const WCHAR openW[] = {'o','p','e','n',0};
ShellExecuteW( NULL, openW, launcher->path, NULL, NULL, 0 );
}
static WCHAR *append_path( const WCHAR *path, const WCHAR *filename, int len_filename ) static WCHAR *append_path( const WCHAR *path, const WCHAR *filename, int len_filename )
{ {
int len_path = lstrlenW( path ); int len_path = lstrlenW( path );
...@@ -547,7 +541,7 @@ error: ...@@ -547,7 +541,7 @@ error:
static void add_folder( const WCHAR *folder ) static void add_folder( const WCHAR *folder )
{ {
static const WCHAR lnkW[] = {'\\','*','.','l','n','k',0}; static const WCHAR lnkW[] = L"\\*.lnk";
int len = lstrlenW( folder ) + lstrlenW( lnkW ); int len = lstrlenW( folder ) + lstrlenW( lnkW );
WIN32_FIND_DATAW data; WIN32_FIND_DATAW data;
HANDLE handle; HANDLE handle;
...@@ -747,7 +741,7 @@ static LRESULT WINAPI desktop_wnd_proc( HWND hwnd, UINT message, WPARAM wp, LPAR ...@@ -747,7 +741,7 @@ static LRESULT WINAPI desktop_wnd_proc( HWND hwnd, UINT message, WPARAM wp, LPAR
if (!using_root) if (!using_root)
{ {
const struct launcher *launcher = launcher_from_point( (short)LOWORD(lp), (short)HIWORD(lp) ); const struct launcher *launcher = launcher_from_point( (short)LOWORD(lp), (short)HIWORD(lp) );
if (launcher) do_launch( launcher ); if (launcher) ShellExecuteW( NULL, L"open", launcher->path, NULL, NULL, 0 );
} }
return 0; return 0;
...@@ -784,10 +778,6 @@ static BOOL parse_size( const WCHAR *size, unsigned int *width, unsigned int *he ...@@ -784,10 +778,6 @@ static BOOL parse_size( const WCHAR *size, unsigned int *width, unsigned int *he
/* retrieve the desktop name to use if not specified on the command line */ /* retrieve the desktop name to use if not specified on the command line */
static const WCHAR *get_default_desktop_name(void) static const WCHAR *get_default_desktop_name(void)
{ {
static const WCHAR desktopW[] = {'D','e','s','k','t','o','p',0};
static const WCHAR defaultW[] = {'D','e','f','a','u','l','t',0};
static const WCHAR explorer_keyW[] = {'S','o','f','t','w','a','r','e','\\','W','i','n','e','\\',
'E','x','p','l','o','r','e','r',0};
static WCHAR buffer[MAX_PATH]; static WCHAR buffer[MAX_PATH];
DWORD size = sizeof(buffer); DWORD size = sizeof(buffer);
HDESK desk = GetThreadDesktop( GetCurrentThreadId() ); HDESK desk = GetThreadDesktop( GetCurrentThreadId() );
...@@ -796,13 +786,13 @@ static const WCHAR *get_default_desktop_name(void) ...@@ -796,13 +786,13 @@ static const WCHAR *get_default_desktop_name(void)
if (desk && GetUserObjectInformationW( desk, UOI_NAME, buffer, ARRAY_SIZE( buffer ), NULL )) if (desk && GetUserObjectInformationW( desk, UOI_NAME, buffer, ARRAY_SIZE( buffer ), NULL ))
{ {
if (wcsicmp( buffer, defaultW )) return buffer; if (wcsicmp( buffer, L"Default" )) return buffer;
} }
/* @@ Wine registry key: HKCU\Software\Wine\Explorer */ /* @@ Wine registry key: HKCU\Software\Wine\Explorer */
if (!RegOpenKeyW( HKEY_CURRENT_USER, explorer_keyW, &hkey )) if (!RegOpenKeyW( HKEY_CURRENT_USER, L"Software\\Wine\\Explorer", &hkey ))
{ {
if (!RegQueryValueExW( hkey, desktopW, 0, NULL, (LPBYTE)buffer, &size ) && *buffer) ret = buffer; if (!RegQueryValueExW( hkey, L"Desktop", 0, NULL, (LPBYTE)buffer, &size ) && *buffer) ret = buffer;
RegCloseKey( hkey ); RegCloseKey( hkey );
} }
return ret; return ret;
...@@ -811,9 +801,6 @@ static const WCHAR *get_default_desktop_name(void) ...@@ -811,9 +801,6 @@ static const WCHAR *get_default_desktop_name(void)
/* retrieve the default desktop size from the registry */ /* retrieve the default desktop size from the registry */
static BOOL get_default_desktop_size( const WCHAR *name, unsigned int *width, unsigned int *height ) static BOOL get_default_desktop_size( const WCHAR *name, unsigned int *width, unsigned int *height )
{ {
static const WCHAR desktop_keyW[] = {'S','o','f','t','w','a','r','e','\\','W','i','n','e','\\',
'E','x','p','l','o','r','e','r','\\',
'D','e','s','k','t','o','p','s',0};
HKEY hkey; HKEY hkey;
WCHAR buffer[64]; WCHAR buffer[64];
DWORD size = sizeof(buffer); DWORD size = sizeof(buffer);
...@@ -823,7 +810,7 @@ static BOOL get_default_desktop_size( const WCHAR *name, unsigned int *width, un ...@@ -823,7 +810,7 @@ static BOOL get_default_desktop_size( const WCHAR *name, unsigned int *width, un
*height = 600; *height = 600;
/* @@ Wine registry key: HKCU\Software\Wine\Explorer\Desktops */ /* @@ Wine registry key: HKCU\Software\Wine\Explorer\Desktops */
if (!RegOpenKeyW( HKEY_CURRENT_USER, desktop_keyW, &hkey )) if (!RegOpenKeyW( HKEY_CURRENT_USER, L"Software\\Wine\\Explorer\\Desktops", &hkey ))
{ {
if (!RegQueryValueExW( hkey, name, 0, NULL, (LPBYTE)buffer, &size )) if (!RegQueryValueExW( hkey, name, 0, NULL, (LPBYTE)buffer, &size ))
{ {
...@@ -837,44 +824,26 @@ static BOOL get_default_desktop_size( const WCHAR *name, unsigned int *width, un ...@@ -837,44 +824,26 @@ static BOOL get_default_desktop_size( const WCHAR *name, unsigned int *width, un
static BOOL get_default_enable_shell( const WCHAR *name ) static BOOL get_default_enable_shell( const WCHAR *name )
{ {
static const WCHAR desktop_keyW[] = {'S','o','f','t','w','a','r','e','\\','W','i','n','e','\\',
'E','x','p','l','o','r','e','r','\\',
'D','e','s','k','t','o','p','s',0};
static const WCHAR enable_shellW[] = {'E','n','a','b','l','e','S','h','e','l','l',0};
static const WCHAR shellW[] = {'s','h','e','l','l',0};
HKEY hkey; HKEY hkey;
BOOL found = FALSE; BOOL found = FALSE;
BOOL result; BOOL result;
DWORD size = sizeof(result); DWORD size = sizeof(result);
/* @@ Wine registry key: HKCU\Software\Wine\Explorer\Desktops */ /* @@ Wine registry key: HKCU\Software\Wine\Explorer\Desktops */
if (!RegOpenKeyW( HKEY_CURRENT_USER, desktop_keyW, &hkey )) if (!RegOpenKeyW( HKEY_CURRENT_USER, L"Software\\Wine\\Explorer\\Desktops", &hkey ))
{ {
if (!RegGetValueW( hkey, name, enable_shellW, RRF_RT_REG_DWORD, NULL, &result, &size )) if (!RegGetValueW( hkey, name, L"EnableShell", RRF_RT_REG_DWORD, NULL, &result, &size ))
found = TRUE; found = TRUE;
RegCloseKey( hkey ); RegCloseKey( hkey );
} }
/* Default off, except for the magic desktop name "shell" */ /* Default off, except for the magic desktop name "shell" */
if (!found) if (!found) result = (lstrcmpiW( name, L"shell" ) == 0);
result = (lstrcmpiW( name, shellW ) == 0);
return result; return result;
} }
static HMODULE load_graphics_driver( const WCHAR *driver, GUID *guid ) static HMODULE load_graphics_driver( const WCHAR *driver, GUID *guid )
{ {
static const WCHAR device_keyW[] = { static const WCHAR device_keyW[] = L"System\\CurrentControlSet\\Control\\Video\\{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\\0000";
'S','y','s','t','e','m','\\',
'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\',
'C','o','n','t','r','o','l','\\',
'V','i','d','e','o','\\',
'{','%','0','8','x','-','%','0','4','x','-','%','0','4','x','-',
'%','0','2','x','%','0','2','x','-','%','0','2','x','%','0','2','x','%','0','2','x',
'%','0','2','x','%','0','2','x','%','0','2','x','}','\\','0','0','0','0',0};
static const WCHAR graphics_driverW[] = {'G','r','a','p','h','i','c','s','D','r','i','v','e','r',0};
static const WCHAR driversW[] = {'S','o','f','t','w','a','r','e','\\',
'W','i','n','e','\\','D','r','i','v','e','r','s',0};
static const WCHAR graphicsW[] = {'G','r','a','p','h','i','c','s',0};
static const WCHAR drv_formatW[] = {'w','i','n','e','%','s','.','d','r','v',0};
WCHAR buffer[MAX_PATH], libname[32], *name, *next; WCHAR buffer[MAX_PATH], libname[32], *name, *next;
WCHAR key[ARRAY_SIZE( device_keyW ) + 39]; WCHAR key[ARRAY_SIZE( device_keyW ) + 39];
...@@ -888,10 +857,10 @@ static HMODULE load_graphics_driver( const WCHAR *driver, GUID *guid ) ...@@ -888,10 +857,10 @@ static HMODULE load_graphics_driver( const WCHAR *driver, GUID *guid )
lstrcpyW( buffer, default_driver ); lstrcpyW( buffer, default_driver );
/* @@ Wine registry key: HKCU\Software\Wine\Drivers */ /* @@ Wine registry key: HKCU\Software\Wine\Drivers */
if (!RegOpenKeyW( HKEY_CURRENT_USER, driversW, &hkey )) if (!RegOpenKeyW( HKEY_CURRENT_USER, L"Software\\Wine\\Drivers", &hkey ))
{ {
DWORD count = sizeof(buffer); DWORD count = sizeof(buffer);
RegQueryValueExW( hkey, graphicsW, 0, NULL, (LPBYTE)buffer, &count ); RegQueryValueExW( hkey, L"Graphics", 0, NULL, (LPBYTE)buffer, &count );
RegCloseKey( hkey ); RegCloseKey( hkey );
} }
} }
...@@ -912,7 +881,7 @@ static HMODULE load_graphics_driver( const WCHAR *driver, GUID *guid ) ...@@ -912,7 +881,7 @@ static HMODULE load_graphics_driver( const WCHAR *driver, GUID *guid )
break; break;
} }
swprintf( libname, ARRAY_SIZE( libname ), drv_formatW, name ); swprintf( libname, ARRAY_SIZE( libname ), L"wine%s.drv", name );
if ((module = LoadLibraryW( libname )) != 0) break; if ((module = LoadLibraryW( libname )) != 0) break;
switch (GetLastError()) switch (GetLastError())
{ {
...@@ -939,7 +908,7 @@ static HMODULE load_graphics_driver( const WCHAR *driver, GUID *guid ) ...@@ -939,7 +908,7 @@ static HMODULE load_graphics_driver( const WCHAR *driver, GUID *guid )
REG_OPTION_VOLATILE, KEY_SET_VALUE, NULL, &hkey, NULL )) REG_OPTION_VOLATILE, KEY_SET_VALUE, NULL, &hkey, NULL ))
{ {
if (module || null_driver) if (module || null_driver)
RegSetValueExW( hkey, graphics_driverW, 0, REG_SZ, RegSetValueExW( hkey, L"GraphicsDriver", 0, REG_SZ,
(BYTE *)libname, (lstrlenW(libname) + 1) * sizeof(WCHAR) ); (BYTE *)libname, (lstrlenW(libname) + 1) * sizeof(WCHAR) );
else else
RegSetValueExA( hkey, "DriverError", 0, REG_SZ, (BYTE *)error, strlen(error) + 1 ); RegSetValueExA( hkey, "DriverError", 0, REG_SZ, (BYTE *)error, strlen(error) + 1 );
...@@ -979,8 +948,8 @@ static void initialize_display_settings(void) ...@@ -979,8 +948,8 @@ static void initialize_display_settings(void)
static void set_desktop_window_title( HWND hwnd, const WCHAR *name ) static void set_desktop_window_title( HWND hwnd, const WCHAR *name )
{ {
static const WCHAR desktop_nameW[] = {'W','i','n','e',' ','d','e','s','k','t','o','p',0}; static const WCHAR desktop_nameW[] = L"Wine desktop";
static const WCHAR desktop_name_separatorW[] = {' ', '-', ' ', 0}; static const WCHAR desktop_name_separatorW[] = L" - ";
WCHAR *window_titleW = NULL; WCHAR *window_titleW = NULL;
int window_title_len; int window_title_len;
...@@ -1016,7 +985,6 @@ static inline BOOL is_whitespace(WCHAR c) ...@@ -1016,7 +985,6 @@ static inline BOOL is_whitespace(WCHAR c)
/* main desktop management function */ /* main desktop management function */
void manage_desktop( WCHAR *arg ) void manage_desktop( WCHAR *arg )
{ {
static const WCHAR messageW[] = {'M','e','s','s','a','g','e',0};
HDESK desktop = 0; HDESK desktop = 0;
GUID guid; GUID guid;
MSG msg; MSG msg;
...@@ -1088,7 +1056,7 @@ void manage_desktop( WCHAR *arg ) ...@@ -1088,7 +1056,7 @@ void manage_desktop( WCHAR *arg )
if (hwnd) if (hwnd)
{ {
/* create the HWND_MESSAGE parent */ /* create the HWND_MESSAGE parent */
CreateWindowExW( 0, messageW, NULL, WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, CreateWindowExW( 0, L"Message", NULL, WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
0, 0, 100, 100, 0, 0, 0, NULL ); 0, 0, 100, 100, 0, 0, 0, NULL );
desktop_orig_wndproc = (WNDPROC)SetWindowLongPtrW( hwnd, GWLP_WNDPROC, desktop_orig_wndproc = (WNDPROC)SetWindowLongPtrW( hwnd, GWLP_WNDPROC,
......
...@@ -50,9 +50,6 @@ static int default_width; ...@@ -50,9 +50,6 @@ static int default_width;
static int default_height; static int default_height;
static const WCHAR EXPLORER_CLASS[] = {'E','x','p','l','o','r','e','r','W','C','l','a','s','s',0};
static const WCHAR PATH_BOX_NAME[] = {'\0'};
HINSTANCE explorer_hInstance; HINSTANCE explorer_hInstance;
typedef struct parametersTAG { typedef struct parametersTAG {
...@@ -462,7 +459,7 @@ static void make_explorer_window(parameters_struct *params) ...@@ -462,7 +459,7 @@ static void make_explorer_window(parameters_struct *params)
} }
info->rebar_height=0; info->rebar_height=0;
info->main_window info->main_window
= CreateWindowW(EXPLORER_CLASS,explorer_title,WS_OVERLAPPEDWINDOW, = CreateWindowW(L"ExplorerWClass",explorer_title,WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,CW_USEDEFAULT,default_width, CW_USEDEFAULT,CW_USEDEFAULT,default_width,
default_height,NULL,NULL,explorer_hInstance,NULL); default_height,NULL,NULL,explorer_hInstance,NULL);
...@@ -519,7 +516,7 @@ static void make_explorer_window(parameters_struct *params) ...@@ -519,7 +516,7 @@ static void make_explorer_window(parameters_struct *params)
band_info.cyMinChild=nav_toolbar_height; band_info.cyMinChild=nav_toolbar_height;
band_info.cxMinChild=0; band_info.cxMinChild=0;
SendMessageW(rebar,RB_INSERTBANDW,-1,(LPARAM)&band_info); SendMessageW(rebar,RB_INSERTBANDW,-1,(LPARAM)&band_info);
info->path_box = CreateWindowW(WC_COMBOBOXEXW,PATH_BOX_NAME, info->path_box = CreateWindowW(WC_COMBOBOXEXW,L"",
WS_CHILD | WS_VISIBLE | CBS_DROPDOWN, WS_CHILD | WS_VISIBLE | CBS_DROPDOWN,
0,0,default_width,pathbox_height,rebar,NULL, 0,0,default_width,pathbox_height,rebar,NULL,
explorer_hInstance,NULL); explorer_hInstance,NULL);
...@@ -771,7 +768,7 @@ static void register_explorer_window_class(void) ...@@ -771,7 +768,7 @@ static void register_explorer_window_class(void)
window_class.hCursor = NULL; window_class.hCursor = NULL;
window_class.hbrBackground = (HBRUSH)COLOR_BACKGROUND; window_class.hbrBackground = (HBRUSH)COLOR_BACKGROUND;
window_class.lpszMenuName = NULL; window_class.lpszMenuName = NULL;
window_class.lpszClassName = EXPLORER_CLASS; window_class.lpszClassName = L"ExplorerWClass";
window_class.hIconSm = NULL; window_class.hIconSm = NULL;
RegisterClassExW(&window_class); RegisterClassExW(&window_class);
} }
...@@ -834,13 +831,13 @@ static void copy_path_root(LPWSTR root, LPWSTR path) ...@@ -834,13 +831,13 @@ static void copy_path_root(LPWSTR root, LPWSTR path)
*/ */
static void parse_command_line(LPWSTR commandline,parameters_struct *parameters) static void parse_command_line(LPWSTR commandline,parameters_struct *parameters)
{ {
static const WCHAR arg_n[] = {'/','n'}; static const WCHAR arg_n[] = L"/n";
static const WCHAR arg_e[] = {'/','e',','}; static const WCHAR arg_e[] = L"/e,";
static const WCHAR arg_cd[] = {'/','c','d',','}; static const WCHAR arg_cd[] = L"/cd,";
static const WCHAR arg_root[] = {'/','r','o','o','t',','}; static const WCHAR arg_root[] = L"/root,";
static const WCHAR arg_select[] = {'/','s','e','l','e','c','t',','}; static const WCHAR arg_select[] = L"/select,";
static const WCHAR arg_desktop[] = {'/','d','e','s','k','t','o','p'}; static const WCHAR arg_desktop[] = L"/desktop";
static const WCHAR arg_desktop_quotes[] = {'"','/','d','e','s','k','t','o','p'}; static const WCHAR arg_desktop_quotes[] = L"\"/desktop";
LPWSTR p = commandline; LPWSTR p = commandline;
......
...@@ -892,7 +892,6 @@ void handle_parent_notify( HWND hwnd, WPARAM wp ) ...@@ -892,7 +892,6 @@ void handle_parent_notify( HWND hwnd, WPARAM wp )
void initialize_systray( HMODULE graphics_driver, BOOL using_root, BOOL arg_enable_shell ) void initialize_systray( HMODULE graphics_driver, BOOL using_root, BOOL arg_enable_shell )
{ {
WNDCLASSEXW class; WNDCLASSEXW class;
static const WCHAR classname[] = {'S','h','e','l','l','_','T','r','a','y','W','n','d',0};
RECT work_rect, primary_rect, taskbar_rect; RECT work_rect, primary_rect, taskbar_rect;
if (using_root && graphics_driver) wine_notify_icon = (void *)GetProcAddress( graphics_driver, "wine_notify_icon" ); if (using_root && graphics_driver) wine_notify_icon = (void *)GetProcAddress( graphics_driver, "wine_notify_icon" );
...@@ -911,7 +910,7 @@ void initialize_systray( HMODULE graphics_driver, BOOL using_root, BOOL arg_enab ...@@ -911,7 +910,7 @@ void initialize_systray( HMODULE graphics_driver, BOOL using_root, BOOL arg_enab
class.hIcon = LoadIconW(0, (LPCWSTR)IDI_WINLOGO); class.hIcon = LoadIconW(0, (LPCWSTR)IDI_WINLOGO);
class.hCursor = LoadCursorW(0, (LPCWSTR)IDC_ARROW); class.hCursor = LoadCursorW(0, (LPCWSTR)IDC_ARROW);
class.hbrBackground = (HBRUSH) COLOR_WINDOW; class.hbrBackground = (HBRUSH) COLOR_WINDOW;
class.lpszClassName = classname; class.lpszClassName = L"Shell_TrayWnd";
if (!RegisterClassExW(&class)) if (!RegisterClassExW(&class))
{ {
...@@ -923,7 +922,7 @@ void initialize_systray( HMODULE graphics_driver, BOOL using_root, BOOL arg_enab ...@@ -923,7 +922,7 @@ void initialize_systray( HMODULE graphics_driver, BOOL using_root, BOOL arg_enab
SetRect( &primary_rect, 0, 0, GetSystemMetrics( SM_CXSCREEN ), GetSystemMetrics( SM_CYSCREEN ) ); SetRect( &primary_rect, 0, 0, GetSystemMetrics( SM_CXSCREEN ), GetSystemMetrics( SM_CYSCREEN ) );
SubtractRect( &taskbar_rect, &primary_rect, &work_rect ); SubtractRect( &taskbar_rect, &primary_rect, &work_rect );
tray_window = CreateWindowExW( WS_EX_NOACTIVATE, classname, NULL, WS_POPUP, taskbar_rect.left, tray_window = CreateWindowExW( WS_EX_NOACTIVATE, class.lpszClassName, NULL, WS_POPUP, taskbar_rect.left,
taskbar_rect.top, taskbar_rect.right - taskbar_rect.left, taskbar_rect.top, taskbar_rect.right - taskbar_rect.left,
taskbar_rect.bottom - taskbar_rect.top, 0, 0, 0, 0 ); taskbar_rect.bottom - taskbar_rect.top, 0, 0, 0, 0 );
if (!tray_window) if (!tray_window)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment