r=mkaply, a=blizzard
Code from aaronr - return proper class for scrollbar


git-svn-id: svn://10.0.0.236/trunk@100637 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mkaply%us.ibm.com 2001-08-09 03:34:12 +00:00
parent 9fc8f51934
commit ba5dc4d92b
3 changed files with 16 additions and 3 deletions

View File

@ -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;
}

View File

@ -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;
}
}
}

View File

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