explorerframe: Use wide-char string literals.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2020-10-03 20:28:11 +02:00 committed by Alexandre Julliard
parent 32e07a3809
commit 1d17d8d471
2 changed files with 9 additions and 20 deletions

View File

@ -75,8 +75,6 @@ static const DWORD unsupported_styles2 =
NSTCS2_INTERRUPTNOTIFICATIONS | NSTCS2_SHOWNULLSPACEMENU | NSTCS2_DISPLAYPADDING |
NSTCS2_DISPLAYPINNEDONLY | NTSCS2_NOSINGLETONAUTOEXPAND | NTSCS2_NEVERINSERTNONENUMERATED;
static const WCHAR thispropW[] = {'P','R','O','P','_','T','H','I','S',0};
static inline NSTC2Impl *impl_from_INameSpaceTreeControl2(INameSpaceTreeControl2 *iface)
{
return CONTAINING_RECORD(iface, NSTC2Impl, INameSpaceTreeControl2_iface);
@ -510,7 +508,7 @@ static LRESULT create_namespacetree(HWND hWnd, CREATESTRUCTW *crs)
This->tv_oldwndproc = (WNDPROC)SetWindowLongPtrW(This->hwnd_tv, GWLP_WNDPROC,
(ULONG_PTR)tv_wndproc);
if(This->tv_oldwndproc)
SetPropW(This->hwnd_tv, thispropW, This);
SetPropW(This->hwnd_tv, L"PROP_THIS", This);
return TRUE;
}
@ -534,7 +532,7 @@ static LRESULT destroy_namespacetree(NSTC2Impl *This)
if(This->tv_oldwndproc)
{
SetWindowLongPtrW(This->hwnd_tv, GWLP_WNDPROC, (ULONG_PTR)This->tv_oldwndproc);
RemovePropW(This->hwnd_tv, thispropW);
RemovePropW(This->hwnd_tv, L"PROP_THIS");
}
INameSpaceTreeControl2_RemoveAllRoots(&This->INameSpaceTreeControl2_iface);
@ -762,7 +760,7 @@ static LRESULT on_kbd_event(NSTC2Impl *This, UINT uMsg, WPARAM wParam, LPARAM lP
static LRESULT CALLBACK tv_wndproc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam)
{
NSTC2Impl *This = (NSTC2Impl*)GetPropW(hWnd, thispropW);
NSTC2Impl *This = (NSTC2Impl*)GetPropW(hWnd, L"PROP_THIS");
switch(uMessage) {
case WM_KEYDOWN:
@ -879,9 +877,7 @@ static HRESULT WINAPI NSTC2_fnInitialize(INameSpaceTreeControl2* iface,
DWORD window_style, window_ex_style;
INITCOMMONCONTROLSEX icex;
RECT rc;
static const WCHAR NSTC2_CLASS_NAME[] =
{'N','a','m','e','s','p','a','c','e','T','r','e','e',
'C','o','n','t','r','o','l',0};
static const WCHAR NSTC2_CLASS_NAME[] = L"NamespaceTreeControl";
TRACE("%p (%p, %p, %x)\n", This, hwndParent, prc, nstcsFlags);

View File

@ -781,13 +781,6 @@ static void test_basics(void)
int cbstate;
WCHAR curdirW[MAX_PATH];
WCHAR buf[MAX_PATH];
static const WCHAR testdirW[] = {'t','e','s','t','d','i','r',0};
static const WCHAR testdir2W[] =
{'t','e','s','t','d','i','r','\\','t','e','s','t','d','i','r','2',0};
static const WCHAR test1W[] =
{'t','e','s','t','d','i','r','\\','t','e','s','t','1','.','t','x','t',0};
static const WCHAR explorerW[] = {'E','x','p','l','o','r','e','r',0};
static const WCHAR randomW[] = {'_','_','h','e','l','l','o',0};
/* These should exist on platforms supporting the NSTC */
ok(pSHCreateShellItem != NULL, "No SHCreateShellItem.\n");
@ -827,19 +820,19 @@ static void test_basics(void)
lstrcpyW(buf, curdirW);
myPathAddBackslashW(buf);
lstrcatW(buf, testdirW);
lstrcatW(buf, L"testdir");
hr = pSHCreateItemFromParsingName(buf, NULL, &IID_IShellItem, (void**)&psitestdir);
ok(hr == S_OK, "Got 0x%08x\n", hr);
if(FAILED(hr)) goto cleanup;
lstrcpyW(buf, curdirW);
myPathAddBackslashW(buf);
lstrcatW(buf, testdir2W);
lstrcatW(buf, L"testdir\\testdir2");
hr = pSHCreateItemFromParsingName(buf, NULL, &IID_IShellItem, (void**)&psitestdir2);
ok(hr == S_OK, "Got 0x%08x\n", hr);
if(FAILED(hr)) goto cleanup;
lstrcpyW(buf, curdirW);
myPathAddBackslashW(buf);
lstrcatW(buf, test1W);
lstrcatW(buf, L"testdir\\test1.txt");
hr = pSHCreateItemFromParsingName(buf, NULL, &IID_IShellItem, (void**)&psitest1);
ok(hr == S_OK, "Got 0x%08x\n", hr);
if(FAILED(hr)) goto cleanup;
@ -1725,9 +1718,9 @@ static void test_basics(void)
{
hr = INameSpaceTreeControl_SetTheme(pnstc, NULL);
ok(hr == S_OK, "Got 0x%08x\n", hr);
hr = INameSpaceTreeControl_SetTheme(pnstc, explorerW);
hr = INameSpaceTreeControl_SetTheme(pnstc, L"Explorer");
ok(hr == S_OK, "Got 0x%08x\n", hr);
hr = INameSpaceTreeControl_SetTheme(pnstc, randomW);
hr = INameSpaceTreeControl_SetTheme(pnstc, L"__hello");
ok(hr == S_OK, "Got 0x%08x\n", hr);
}