mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 22:02:14 +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;
|
||||
LPWORD Offset;
|
||||
LPWSTR ClassName, WindowName = NULL;
|
||||
LPWSTR ClassName, WindowName;
|
||||
WCHAR WindowIdBuf[sizeof("#65535")];
|
||||
HWND hwnd;
|
||||
DWORD wID;
|
||||
INT nSteps, i;
|
||||
|
@ -109,32 +110,42 @@ AddDialogControl(
|
|||
{
|
||||
case 0x80:
|
||||
ClassName = L"button";
|
||||
WindowName = (LPWSTR)(Offset + 1);
|
||||
break ;
|
||||
case 0x82:
|
||||
ClassName = L"static";
|
||||
WindowName = (LPWSTR)(Offset + 1);
|
||||
break;
|
||||
default:
|
||||
/* FIXME */
|
||||
assert(0);
|
||||
ClassName = NULL;
|
||||
}
|
||||
Offset++;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* class name is encoded as string */
|
||||
ClassName = (LPWSTR)Offset;
|
||||
ClassName = (LPWSTR)(Offset);
|
||||
|
||||
/* move offset to the end of class string */
|
||||
Offset += wcslen(ClassName);
|
||||
|
||||
/* get window name */
|
||||
WindowName = (LPWSTR)(Offset + 1);
|
||||
Offset += wcslen(ClassName) + 1;
|
||||
}
|
||||
|
||||
if (*Offset == 0xFFFF)
|
||||
{
|
||||
/* Window name is encoded as ordinal */
|
||||
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;
|
||||
}
|
||||
|
||||
/* move offset past class type/string */
|
||||
Offset++;
|
||||
|
||||
if (DialogItem->id == MAXWORD)
|
||||
{
|
||||
|
@ -242,11 +253,6 @@ AddDialogControl(
|
|||
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 */
|
||||
if (*Offset == 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue