mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 20:25:39 +00:00
[SNDVOL32] Fix parsing dialog icons
This commit is contained in:
parent
0eaeb9de4c
commit
8467d6edd1
1 changed files with 22 additions and 16 deletions
|
@ -77,7 +77,8 @@ AddDialogControl(
|
||||||
{
|
{
|
||||||
RECT rect;
|
RECT rect;
|
||||||
LPWORD Offset;
|
LPWORD Offset;
|
||||||
LPWSTR ClassName, WindowName = NULL;
|
LPWSTR ClassName, WindowName;
|
||||||
|
WCHAR WindowIdBuf[sizeof("#65535")];
|
||||||
HWND hwnd;
|
HWND hwnd;
|
||||||
DWORD wID;
|
DWORD wID;
|
||||||
INT nSteps, i;
|
INT nSteps, i;
|
||||||
|
@ -109,32 +110,42 @@ AddDialogControl(
|
||||||
{
|
{
|
||||||
case 0x80:
|
case 0x80:
|
||||||
ClassName = L"button";
|
ClassName = L"button";
|
||||||
WindowName = (LPWSTR)(Offset + 1);
|
|
||||||
break ;
|
break ;
|
||||||
case 0x82:
|
case 0x82:
|
||||||
ClassName = L"static";
|
ClassName = L"static";
|
||||||
WindowName = (LPWSTR)(Offset + 1);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* FIXME */
|
/* FIXME */
|
||||||
assert(0);
|
assert(0);
|
||||||
ClassName = NULL;
|
ClassName = NULL;
|
||||||
}
|
}
|
||||||
|
Offset++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* class name is encoded as string */
|
/* class name is encoded as string */
|
||||||
ClassName = (LPWSTR)Offset;
|
ClassName = (LPWSTR)(Offset);
|
||||||
|
|
||||||
/* move offset to the end of class string */
|
/* move offset to the end of class string */
|
||||||
Offset += wcslen(ClassName);
|
Offset += wcslen(ClassName) + 1;
|
||||||
|
|
||||||
/* get window name */
|
|
||||||
WindowName = (LPWSTR)(Offset + 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* move offset past class type/string */
|
if (*Offset == 0xFFFF)
|
||||||
|
{
|
||||||
|
/* Window name is encoded as ordinal */
|
||||||
Offset++;
|
Offset++;
|
||||||
|
wsprintf(WindowIdBuf, L"#%u", (DWORD)*Offset);
|
||||||
|
WindowName = WindowIdBuf;
|
||||||
|
Offset++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* window name is encoded as string */
|
||||||
|
WindowName = (LPWSTR)(Offset);
|
||||||
|
|
||||||
|
/* move offset to the end of class string */
|
||||||
|
Offset += wcslen(WindowName) + 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (DialogItem->id == MAXWORD)
|
if (DialogItem->id == MAXWORD)
|
||||||
{
|
{
|
||||||
|
@ -242,11 +253,6 @@ AddDialogControl(
|
||||||
SendMessageW(hwnd, WM_SETFONT, (WPARAM)hFont, TRUE);
|
SendMessageW(hwnd, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WindowName != NULL)
|
|
||||||
{
|
|
||||||
/* move offset past window name */
|
|
||||||
Offset += wcslen(WindowName) + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* check if there is additional data */
|
/* check if there is additional data */
|
||||||
if (*Offset == 0)
|
if (*Offset == 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue