shell32: Load shell folder column names as A/W strings depending on 9x/NT selector.
This commit is contained in:
parent
c51b248b48
commit
1b31b377b6
|
@ -548,8 +548,20 @@ HRESULT SHELL32_GetColumnDetails(const shvheader *data, int column, SHELLDETAILS
|
|||
{
|
||||
details->fmt = data[column].fmt;
|
||||
details->cxChar = data[column].cxChar;
|
||||
|
||||
if (SHELL_OsIsUnicode())
|
||||
{
|
||||
details->str.u.pOleStr = CoTaskMemAlloc(MAX_PATH * sizeof(WCHAR));
|
||||
if (!details->str.u.pOleStr) return E_OUTOFMEMORY;
|
||||
|
||||
details->str.uType = STRRET_WSTR;
|
||||
LoadStringW(shell32_hInstance, data[column].colnameid, details->str.u.pOleStr, MAX_PATH);
|
||||
}
|
||||
else
|
||||
{
|
||||
details->str.uType = STRRET_CSTR;
|
||||
LoadStringA (shell32_hInstance, data[column].colnameid, details->str.u.cStr, MAX_PATH);
|
||||
LoadStringA(shell32_hInstance, data[column].colnameid, details->str.u.cStr, MAX_PATH);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
|
|
@ -387,29 +387,32 @@ static BOOL ShellView_CreateList (IShellViewImpl * This)
|
|||
*
|
||||
* - adds all needed columns to the shellview
|
||||
*/
|
||||
static BOOL ShellView_InitList(IShellViewImpl * This)
|
||||
static void ShellView_InitList(IShellViewImpl *This)
|
||||
{
|
||||
LVCOLUMNW lvColumn;
|
||||
SHELLDETAILS sd;
|
||||
int i;
|
||||
WCHAR szTemp[50];
|
||||
WCHAR nameW[50];
|
||||
|
||||
TRACE("%p\n",This);
|
||||
TRACE("(%p)\n", This);
|
||||
|
||||
SendMessageW(This->hWndList, LVM_DELETEALLITEMS, 0, 0);
|
||||
|
||||
lvColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
|
||||
lvColumn.pszText = szTemp;
|
||||
lvColumn.pszText = nameW;
|
||||
|
||||
if (This->pSF2Parent)
|
||||
{
|
||||
for (i=0; 1; i++)
|
||||
HRESULT hr;
|
||||
INT i;
|
||||
|
||||
for (i = 0; 1; i++)
|
||||
{
|
||||
if (FAILED(IShellFolder2_GetDetailsOf(This->pSF2Parent, NULL, i, &sd)))
|
||||
break;
|
||||
hr = IShellFolder2_GetDetailsOf(This->pSF2Parent, NULL, i, &sd);
|
||||
if (FAILED(hr)) break;
|
||||
|
||||
lvColumn.fmt = sd.fmt;
|
||||
lvColumn.cx = sd.cxChar*8; /* chars->pixel */
|
||||
StrRetToStrNW( szTemp, 50, &sd.str, NULL);
|
||||
StrRetToStrNW(nameW, sizeof(nameW)/sizeof(WCHAR), &sd.str, NULL);
|
||||
SendMessageW(This->hWndList, LVM_INSERTCOLUMNW, i, (LPARAM) &lvColumn);
|
||||
}
|
||||
}
|
||||
|
@ -420,9 +423,8 @@ static BOOL ShellView_InitList(IShellViewImpl * This)
|
|||
|
||||
SendMessageW(This->hWndList, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)ShellSmallIconList);
|
||||
SendMessageW(This->hWndList, LVM_SETIMAGELIST, LVSIL_NORMAL, (LPARAM)ShellBigIconList);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**********************************************************
|
||||
* ShellView_CompareItems()
|
||||
*
|
||||
|
@ -688,11 +690,9 @@ static LRESULT ShellView_OnCreate(IShellViewImpl *This)
|
|||
|
||||
if (ShellView_CreateList(This))
|
||||
{
|
||||
if (ShellView_InitList(This))
|
||||
{
|
||||
ShellView_InitList(This);
|
||||
ShellView_FillList(This);
|
||||
}
|
||||
}
|
||||
|
||||
hr = IShellView2_QueryInterface(iface, &IID_IDropTarget, (LPVOID*)&pdt);
|
||||
if (hr == S_OK)
|
||||
|
|
|
@ -33,6 +33,11 @@
|
|||
|
||||
#include "wine/test.h"
|
||||
|
||||
static inline BOOL SHELL_OsIsUnicode(void)
|
||||
{
|
||||
return !(GetVersion() & 0x80000000);
|
||||
}
|
||||
|
||||
/* Tests for My Network Places */
|
||||
static void test_parse_for_entire_network(void)
|
||||
{
|
||||
|
@ -129,8 +134,8 @@ static void test_printers_folder(void)
|
|||
SHELLDETAILS details;
|
||||
SHCOLSTATEF state;
|
||||
LPITEMIDLIST pidl1, pidl2;
|
||||
INT i;
|
||||
HRESULT hr;
|
||||
INT i;
|
||||
|
||||
CoInitialize( NULL );
|
||||
|
||||
|
@ -166,6 +171,9 @@ if (0)
|
|||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
/* all columns are left-aligned */
|
||||
ok(details.fmt == LVCFMT_LEFT, "got 0x%x\n", details.fmt);
|
||||
/* can't be on w9x at this point, IShellFolder2 unsupported there,
|
||||
check present for running Wine with w9x setup */
|
||||
if (SHELL_OsIsUnicode()) SHFree(details.str.u.pOleStr);
|
||||
|
||||
hr = IShellFolder2_GetDefaultColumnState(folder, i, &state);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
|
@ -176,6 +184,10 @@ if (0)
|
|||
ok(state == (SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT), "got 0x%x\n", state);
|
||||
}
|
||||
|
||||
hr = IShellFolder2_GetDetailsOf(folder, NULL, 0, &details);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(details.str.uType == STRRET_WSTR, "got %d\n", details.str.uType);
|
||||
|
||||
/* default pidl */
|
||||
hr = IShellFolder2_QueryInterface(folder, &IID_IPersistFolder2, (void**)&pf);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
|
|
Loading…
Reference in New Issue