From d9ed57ac99e2c4973cfdbc14e69d1bf5dd4d3c20 Mon Sep 17 00:00:00 2001 From: Joshua Thielen Date: Fri, 16 Nov 2001 18:11:43 +0000 Subject: [PATCH] Local classes registered with USER instance handle now are now found in CLASS_FindClassByAtom. --- windows/class.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/windows/class.c b/windows/class.c index 80c03dbf023..2be09d9dc68 100644 --- a/windows/class.c +++ b/windows/class.c @@ -279,10 +279,14 @@ void CLASS_FreeModuleClasses( HMODULE16 hModule ) * NOTES * 980805 a local class will be found now if registred with hInst=0 * and looed up with a hInst!=0. msmoney does it (jsch) + * + * Local class registered with a USER instance handle are found as if + * they were global classes. */ static CLASS *CLASS_FindClassByAtom( ATOM atom, HINSTANCE hinstance ) { - CLASS * class, *tclass=0; + CLASS * class, *tclass = 0, *user_class = 0; + HINSTANCE16 hUser = GetModuleHandle16("USER"); TRACE("0x%08x 0x%08x\n", atom, hinstance); @@ -293,16 +297,20 @@ static CLASS *CLASS_FindClassByAtom( ATOM atom, HINSTANCE hinstance ) if (class->style & CS_GLOBALCLASS) continue; if (class->atomName == atom) { - if (hinstance==class->hInstance || hinstance==0xffff ) + if (hinstance==class->hInstance || hinstance==0xffff) { TRACE("-- found local %p\n", class); return class; } - if (class->hInstance==0) tclass = class; + if (class->hInstance == 0) tclass = class; + else if(class->hInstance == hUser) + { + user_class = class; + } } } - /* Then search global classes */ + /* Then search global classes */ for (class = firstClass; (class); class = class->next) { @@ -314,6 +322,13 @@ static CLASS *CLASS_FindClassByAtom( ATOM atom, HINSTANCE hinstance ) } } + /* Check if there was a local class registered with USER */ + if( user_class ) + { + TRACE("--found local USER class %p\n", user_class); + return user_class; + } + /* Then check if there was a local class with hInst=0*/ if ( tclass ) {