From 692496753982cb95b1695c1d8c1c19ad246c6cd7 Mon Sep 17 00:00:00 2001 From: Andreas Mohr Date: Wed, 26 Dec 2001 20:34:12 +0000 Subject: [PATCH] Fixed, added or implemented stubs: - DrawMenuBarTemp(): corrected parameter count. - CallCPLEntry16(): stub. - SetSysColorsTemp(): fully implemented (hopefully) this undocumented function. --- controls/menu.c | 10 ++++- dlls/shell32/control.c | 13 ++++++- dlls/shell32/shell32.spec | 2 +- dlls/user/user32.spec | 5 ++- windows/syscolor.c | 79 ++++++++++++++++++++++++++++++++++++--- 5 files changed, 98 insertions(+), 11 deletions(-) diff --git a/controls/menu.c b/controls/menu.c index 36ffec8db22..2a0d2114093 100644 --- a/controls/menu.c +++ b/controls/menu.c @@ -3978,10 +3978,16 @@ BOOL WINAPI DrawMenuBar( HWND hWnd ) /*********************************************************************** * DrawMenuBarTemp (USER32.@) + * + * UNDOCUMENTED !! + * + * called by W98SE desk.cpl Control Panel Applet + * + * Not 100% sure about the param names, but close. */ -DWORD WINAPI DrawMenuBarTemp(DWORD p1, DWORD p2) +DWORD WINAPI DrawMenuBarTemp(HWND someHWND, HDC someHDC, LPRECT someRECT, HMENU someHMENU, HFONT someFONT) { - FIXME("(%08lx %08lx): stub\n", p1, p2); + FIXME("(0x%08x, 0x%08x, %p, 0x%08x, 0x%08x): stub\n", someHWND, someHDC, someRECT, someHMENU, someFONT); return 0; } diff --git a/dlls/shell32/control.c b/dlls/shell32/control.c index df1a1139834..69b4bf08adb 100644 --- a/dlls/shell32/control.c +++ b/dlls/shell32/control.c @@ -377,10 +377,21 @@ HRESULT WINAPI Control_FillCache_RunDLL(HWND hWnd, HANDLE hModule, DWORD w, DWOR /************************************************************************* * RunDLL_CallEntry16 [SHELL32.122] - * the name is propably wrong + * the name is probably wrong */ HRESULT WINAPI RunDLL_CallEntry16(DWORD v, DWORD w, DWORD x, DWORD y, DWORD z) { FIXME("0x%04lx 0x%04lx 0x%04lx 0x%04lx 0x%04lx stub\n",v,w,x,y,z); return 0; } + +/* + * called by desk.cpl on "Advanced" with: + * hMod("DeskCp16.Dll"), pFunc("CplApplet"), 0, 1, 0xc, 0 + * + */ +DWORD WINAPI CallCPLEntry16(HMODULE hMod, FARPROC pFunc, DWORD dw3, DWORD dw4, DWORD dw5, DWORD dw6) +{ + FIXME("(%04x, %p, %08lx, %08lx, %08lx, %08lx): stub.\n", hMod, pFunc, dw3, dw4, dw5, dw6); + return 0x0deadbee; +} diff --git a/dlls/shell32/shell32.spec b/dlls/shell32/shell32.spec index 6e02cd7fb9d..736139bfcf5 100644 --- a/dlls/shell32/shell32.spec +++ b/dlls/shell32/shell32.spec @@ -171,7 +171,7 @@ debug_channels (exec pidl shell shlctrl) 163 stdcall StrToOleStr (wstr str) StrToOleStrAW 164 stdcall Win32DeleteFile(str) Win32DeleteFile 165 stdcall SHCreateDirectory(long long) SHCreateDirectory - 166 stub CallCPLEntry16 + 166 stdcall CallCPLEntry16(long long long long long long) CallCPLEntry16 167 stdcall SHAddFromPropSheetExtArray(long long long) SHAddFromPropSheetExtArray 168 stdcall SHCreatePropSheetExtArray(long str long) SHCreatePropSheetExtArray 169 stdcall SHDestroyPropSheetExtArray(long) SHDestroyPropSheetExtArray diff --git a/dlls/user/user32.spec b/dlls/user/user32.spec index 0ce8739e255..1aa19214dfc 100644 --- a/dlls/user/user32.spec +++ b/dlls/user/user32.spec @@ -520,7 +520,7 @@ debug_channels (accel caret class clipboard combo cursor dc dde ddeml dialog dri @ stdcall SetScrollRange(long long long long long) SetScrollRange @ stdcall SetShellWindow(long) SetShellWindow @ stdcall SetSysColors(long ptr ptr) SetSysColors -@ stdcall SetSysColorsTemp(long ptr ptr) SetSysColorsTemp +@ stdcall SetSysColorsTemp(ptr ptr long) SetSysColorsTemp @ stdcall SetSystemCursor(long long) SetSystemCursor @ stdcall SetSystemMenu(long long) SetSystemMenu @ stdcall SetSystemTimer(long long long ptr) SetSystemTimer @@ -650,13 +650,14 @@ debug_channels (accel caret class clipboard combo cursor dc dde ddeml dialog dri @ stdcall SetProcessDefaultLayout(long) SetProcessDefaultLayout @ stdcall RegisterDeviceNotificationA(long ptr long) RegisterDeviceNotificationA @ stub RegisterDeviceNotificationW +@ stub TrackMouseEvent @ stub UnregisterDeviceNotification # win98/win2k @ stdcall AllowSetForegroundWindow (long) AllowSetForegroundWindow @ stdcall AnimateWindow(long long long) AnimateWindow @ stdcall GetAncestor(long long) GetAncestor -@ stdcall DrawMenuBarTemp(long long) DrawMenuBarTemp +@ stdcall DrawMenuBarTemp(long long long long long) DrawMenuBarTemp @ stdcall EnumDisplaySettingsExA(str long ptr long) EnumDisplaySettingsExA @ stdcall EnumDisplaySettingsExW(wstr long ptr long) EnumDisplaySettingsExW @ stdcall GetClipboardSequenceNumber () GetClipboardSequenceNumber diff --git a/windows/syscolor.c b/windows/syscolor.c index 6f69389c5b8..d15cb0647e8 100644 --- a/windows/syscolor.c +++ b/windows/syscolor.c @@ -148,11 +148,11 @@ static void SYSCOLOR_SetColor( int index, COLORREF color ) if (SysColorPens[index]) { - SYSCOLOR_MakeObjectSystem(SysColorBrushes[index], FALSE); + SYSCOLOR_MakeObjectSystem(SysColorPens[index], FALSE); DeleteObject( SysColorPens[index] ); } SysColorPens[index] = CreatePen( PS_SOLID, 1, color ); - SYSCOLOR_MakeObjectSystem(SysColorBrushes[index], TRUE); + SYSCOLOR_MakeObjectSystem(SysColorPens[index], TRUE); } @@ -275,11 +275,80 @@ BOOL WINAPI SetSysColors( INT nChanges, const INT *lpSysColor, /************************************************************************* * SetSysColorsTemp (USER32.@) + * + * UNDOCUMENTED !! + * + * Called by W98SE desk.cpl Control Panel Applet: + * handle = SetSysColorsTemp(ptr, ptr, nCount); ("set" call) + * result = SetSysColorsTemp(NULL, NULL, handle); ("restore" call) + * + * pPens is an array of COLORREF values, which seems to be used + * to indicate the color values to create new pens with. + * + * pBrushes is an array of solid brush handles (returned by a previous + * CreateSolidBrush), which seems to contain the brush handles to set + * for the system colors. + * + * n seems to be used for + * a) indicating the number of entries to operate on (length of pPens, + * pBrushes) + * b) passing the handle that points to the previously used color settings. + * I couldn't figure out in hell what kind of handle this is on + * Windows. I just use a heap handle instead. Shouldn't matter anyway. + * + * RETURNS + * heap handle of our own copy of the current syscolors in case of + * "set" call, i.e. pPens, pBrushes != NULL. + * TRUE (unconditionally !) in case of "restore" call, + * i.e. pPens, pBrushes == NULL. + * FALSE in case of either pPens != NULL and pBrushes == NULL + * or pPens == NULL and pBrushes != NULL. + * + * I'm not sure whether this implementation is 100% correct. [AM] */ -BOOL WINAPI SetSysColorsTemp( int n, const int* p, const COLORREF* ptr) +DWORD WINAPI SetSysColorsTemp( const COLORREF *pPens, const HBRUSH *pBrushes, DWORD n) { - FIXME("(%d,%p,%p): stub!\n", n, p, ptr); - return 0; + int i; + + if (pPens && pBrushes) /* "set" call */ + { + /* allocate our structure to remember old colors */ + LPVOID pOldCol = HeapAlloc(GetProcessHeap(), 0, sizeof(DWORD)+n*sizeof(HPEN)+n*sizeof(HBRUSH)); + LPVOID p = pOldCol; + *(DWORD *)p = n; p += sizeof(DWORD); + memcpy(p, SysColorPens, n*sizeof(HPEN)); p += n*sizeof(HPEN); + memcpy(p, SysColorBrushes, n*sizeof(HBRUSH)); p += n*sizeof(HBRUSH); + + for (i=0; i < n; i++) + { + SysColorPens[i] = CreatePen( PS_SOLID, 1, pPens[i] ); + SysColorBrushes[i] = pBrushes[i]; + } + + return (DWORD)pOldCol; + } + if ((!pPens) && (!pBrushes)) /* "restore" call */ + { + LPVOID pOldCol = (LPVOID)n; + LPVOID p = pOldCol; + DWORD nCount = *(DWORD *)p; + p += sizeof(DWORD); + + for (i=0; i < nCount; i++) + { + DeleteObject(SysColorPens[i]); + SysColorPens[i] = *(HPEN *)p; p += sizeof(HPEN); + } + for (i=0; i < nCount; i++) + { + SysColorBrushes[i] = *(HBRUSH *)p; p += sizeof(HBRUSH); + } + /* get rid of storage structure */ + HeapFree(GetProcessHeap(), 0, pOldCol); + + return TRUE; + } + return FALSE; } /***********************************************************************