-- v2: comctl32: Implement OBJID_QUERYCLASSNAMEIDX for progress bars. comctl32: Implement OBJID_QUERYCLASSNAMEIDX for toolbars. comctl32: Implement OBJID_QUERYCLASSNAMEIDX for status controls.
From: Esme Povirk esme@codeweavers.com
--- dlls/comctl32/status.c | 5 +++++ dlls/comctl32/tests/status.c | 3 +++ 2 files changed, 8 insertions(+)
diff --git a/dlls/comctl32/status.c b/dlls/comctl32/status.c index 3e1bc4902ff..3473cf8f05a 100644 --- a/dlls/comctl32/status.c +++ b/dlls/comctl32/status.c @@ -1211,6 +1211,11 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_GETFONT: return (LRESULT)(infoPtr->hFont? infoPtr->hFont : infoPtr->hDefaultFont);
+ case WM_GETOBJECT: + if ((LONG)lParam == OBJID_QUERYCLASSNAMEIDX) + return 0x1000b; + return DefWindowProcW (hwnd, msg, wParam, lParam); + case WM_GETTEXT: return STATUSBAR_WMGetText (infoPtr, (INT)wParam, (LPWSTR)lParam);
diff --git a/dlls/comctl32/tests/status.c b/dlls/comctl32/tests/status.c index ac24f91cbb8..272145d5772 100644 --- a/dlls/comctl32/tests/status.c +++ b/dlls/comctl32/tests/status.c @@ -270,6 +270,9 @@ static void test_status_control(void)
hWndStatus = create_status_control(WS_VISIBLE | SBT_TOOLTIPS, 0);
+ r = SendMessageA(hWndStatus, WM_GETOBJECT, 0, OBJID_QUERYCLASSNAMEIDX); + expect(0x1000b, r); + /* Divide into parts and set text */ r = SendMessageA(hWndStatus, SB_SETPARTS, 3, (LPARAM)nParts); expect(TRUE,r);
From: Esme Povirk esme@codeweavers.com
--- dlls/comctl32/tests/toolbar.c | 4 ++++ dlls/comctl32/toolbar.c | 5 +++++ 2 files changed, 9 insertions(+)
diff --git a/dlls/comctl32/tests/toolbar.c b/dlls/comctl32/tests/toolbar.c index ba2720ac0b4..1b95fdfe853 100644 --- a/dlls/comctl32/tests/toolbar.c +++ b/dlls/comctl32/tests/toolbar.c @@ -513,6 +513,7 @@ static void basic_test(void) TBBUTTON buttons[9]; HWND hToolbar; int i; + DWORD idx;
for (i=0; i<9; i++) MakeButton(buttons+i, 1000+i, TBSTYLE_CHECKGROUP, 0); @@ -529,6 +530,9 @@ static void basic_test(void) ok(hToolbar != NULL, "Toolbar creation\n"); SendMessageA(hToolbar, TB_ADDSTRINGA, 0, (LPARAM)"test\000");
+ idx = SendMessageA(hToolbar, WM_GETOBJECT, 0, OBJID_QUERYCLASSNAMEIDX); + ok(idx == 0x1000c, "Got index 0x%08lx\n", idx); + /* test for exclusion working inside a separator-separated :-) group */ SendMessageA(hToolbar, TB_CHECKBUTTON, 1000, 1); /* press A1 */ ok(SendMessageA(hToolbar, TB_ISBUTTONCHECKED, 1000, 0), "A1 pressed\n"); diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index 0b3730f4cba..da66d3972c3 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -6866,6 +6866,11 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_GETFONT: return TOOLBAR_GetFont (infoPtr);
+ case WM_GETOBJECT: + if ((LONG)lParam == OBJID_QUERYCLASSNAMEIDX) + return 0x1000c; + return DefWindowProcW (hwnd, uMsg, wParam, lParam); + case WM_KEYDOWN: return TOOLBAR_KeyDown (infoPtr, wParam, lParam);
From: Esme Povirk esme@codeweavers.com
--- dlls/comctl32/progress.c | 5 +++++ dlls/comctl32/tests/progress.c | 4 ++++ 2 files changed, 9 insertions(+)
diff --git a/dlls/comctl32/progress.c b/dlls/comctl32/progress.c index aae2d8f8660..9c4a0c3e3a0 100644 --- a/dlls/comctl32/progress.c +++ b/dlls/comctl32/progress.c @@ -614,6 +614,11 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message, case WM_SETFONT: return (LRESULT)PROGRESS_SetFont(infoPtr, (HFONT)wParam, (BOOL)lParam);
+ case WM_GETOBJECT: + if ((LONG)lParam == OBJID_QUERYCLASSNAMEIDX) + return 0x1000d; + return DefWindowProcW( hwnd, message, wParam, lParam ); + case WM_PRINTCLIENT: case WM_PAINT: return PROGRESS_Paint (infoPtr, (HDC)wParam); diff --git a/dlls/comctl32/tests/progress.c b/dlls/comctl32/tests/progress.c index f228ac84d2e..77517a194b3 100644 --- a/dlls/comctl32/tests/progress.c +++ b/dlls/comctl32/tests/progress.c @@ -269,9 +269,13 @@ static void test_setcolors(void) { HWND progress; COLORREF clr; + DWORD idx;
progress = create_progress(PBS_SMOOTH);
+ idx = SendMessageA(progress, WM_GETOBJECT, 0, OBJID_QUERYCLASSNAMEIDX); + ok(idx == 0x1000d, "Got index 0x%08lx\n", idx); + clr = SendMessageA(progress, PBM_SETBARCOLOR, 0, 0); ok(clr == CLR_DEFAULT, "got %lx\n", clr);