GetClassInfo should return global classes even if the hInstance
parameter is different from the one passed to the RegisterClass function.
This commit is contained in:
parent
dcb9733580
commit
1040eaf747
|
@ -1159,10 +1159,11 @@ BOOL WINAPI GetClassInfoA( HINSTANCE hInstance, LPCSTR name,
|
|||
if (!(atom=GlobalFindAtomA(name)) || !(classPtr=CLASS_FindClassByAtom(atom,hInstance)))
|
||||
return FALSE;
|
||||
|
||||
if (classPtr->hInstance && (hInstance != classPtr->hInstance))
|
||||
if (!(classPtr->style & CS_GLOBALCLASS) &&
|
||||
classPtr->hInstance &&
|
||||
(hInstance != classPtr->hInstance))
|
||||
{
|
||||
if (hInstance) return FALSE;
|
||||
else
|
||||
WARN("systemclass %s (hInst=0) demanded but only class with hInst!=0 found\n",name);
|
||||
}
|
||||
|
||||
|
@ -1171,7 +1172,7 @@ BOOL WINAPI GetClassInfoA( HINSTANCE hInstance, LPCSTR name,
|
|||
WIN_PROC_32A );
|
||||
wc->cbClsExtra = classPtr->cbClsExtra;
|
||||
wc->cbWndExtra = classPtr->cbWndExtra;
|
||||
wc->hInstance = classPtr->hInstance;
|
||||
wc->hInstance = hInstance;
|
||||
wc->hIcon = (HICON)classPtr->hIcon;
|
||||
wc->hCursor = (HCURSOR)classPtr->hCursor;
|
||||
wc->hbrBackground = (HBRUSH)classPtr->hbrBackground;
|
||||
|
@ -1197,10 +1198,11 @@ BOOL WINAPI GetClassInfoW( HINSTANCE hInstance, LPCWSTR name,
|
|||
)
|
||||
return FALSE;
|
||||
|
||||
if (classPtr->hInstance && (hInstance != classPtr->hInstance)) {
|
||||
if (hInstance)
|
||||
return FALSE;
|
||||
else
|
||||
if (!(classPtr->style & CS_GLOBALCLASS) &&
|
||||
classPtr->hInstance &&
|
||||
(hInstance != classPtr->hInstance))
|
||||
{
|
||||
if (hInstance) return FALSE;
|
||||
WARN("systemclass %s (hInst=0) demanded but only class with hInst!=0 found\n",debugstr_w(name));
|
||||
}
|
||||
wc->style = classPtr->style;
|
||||
|
@ -1208,7 +1210,7 @@ BOOL WINAPI GetClassInfoW( HINSTANCE hInstance, LPCWSTR name,
|
|||
WIN_PROC_32W );
|
||||
wc->cbClsExtra = classPtr->cbClsExtra;
|
||||
wc->cbWndExtra = classPtr->cbWndExtra;
|
||||
wc->hInstance = classPtr->hInstance;
|
||||
wc->hInstance = hInstance;
|
||||
wc->hIcon = (HICON)classPtr->hIcon;
|
||||
wc->hCursor = (HCURSOR)classPtr->hCursor;
|
||||
wc->hbrBackground = (HBRUSH)classPtr->hbrBackground;
|
||||
|
|
Loading…
Reference in New Issue