r=mkaply, a=blizzard
Code from aaronr - return proper class for scrollbar
This commit is contained in:
mkaply%us.ibm.com 2001-08-09 03:34:12 +00:00
Родитель 3cfa4e71db
Коммит 5990cffe52
3 изменённых файлов: 16 добавлений и 3 удалений

Просмотреть файл

@ -326,7 +326,12 @@ PRBool nsScrollbar::OnScroll( ULONG msgid, MPARAM mp1, MPARAM mp2)
//-------------------------------------------------------------------------
PCSZ nsScrollbar::WindowClass()
{
return WC_SCROLLBAR;
/* Can't return (PSZ)WC_SCROLLBAR since we need to return a real string
* as some string manipulation might be done on the returned value.
* The return from WinQueryClassName for a WC_SCROLLBAR is "#8", so that is
* what we'll return. Value makes since since WC_SCROLLBAR is 0xFFFF0008.
*/
return WC_SCROLLBAR_STRING;
}

Просмотреть файл

@ -802,6 +802,7 @@ void nsWindow::RealDoCreate( HWND hwndP,
if( hwndP != HWND_DESKTOP)
{
// For pop-up menus, the parent is the desktop, but use the "parent" as owner
if( aInitData && aInitData->mWindowType == eWindowType_popup)
{
@ -812,9 +813,14 @@ void nsWindow::RealDoCreate( HWND hwndP,
hwndP = HWND_DESKTOP;
}
// For scrollbars, the parent is the owner, for notification purposes
else if( !hwndOwner && WindowClass() == WC_SCROLLBAR)
else if( !hwndOwner )
{
hwndOwner = hwndP;
BOOL bHwndIsScrollBar =
(!(strcmp( WindowClass(), WC_SCROLLBAR_STRING )));
if( bHwndIsScrollBar )
{
hwndOwner = hwndP;
}
}
}

Просмотреть файл

@ -40,6 +40,8 @@
#define VERIFY(exp) (exp)
#endif // !_DEBUG
#define WC_SCROLLBAR_STRING "#8" //string equivalent to WC_SCROLLBAR
#endif // NSDEFS_H