{ WM_CREATE, sent },
{ WM_SHOWWINDOW, sent|wparam, 1 },
{ WM_WINDOWPOSCHANGING, sent|wparam, 0 },
+ { WM_QUERYNEWPALETTE, sent|optional },
{ WM_WINDOWPOSCHANGING, sent|wparam, 0 },
{ WM_ACTIVATEAPP, sent|wparam, 1 },
{ WM_NCACTIVATE, sent|wparam, 1 },
static const struct message parent_create_trackbar_wnd_seq[] = {
{ WM_NOTIFYFORMAT, sent},
- { 0x0129, sent}, /* should be WM_QUERYUISTATE instead of 0x0129 */
+ { WM_QUERYUISTATE, sent|optional},
{ WM_WINDOWPOSCHANGING, sent},
{ WM_NCACTIVATE, sent},
{ PBT_APMRESUMECRITICAL, sent},
};
static const struct message parent_new_window_test_seq[] = {
+ { WM_QUERYNEWPALETTE, sent|optional },
{ WM_WINDOWPOSCHANGING, sent},
{ WM_NCACTIVATE, sent},
{ PBT_APMRESUMECRITICAL, sent},
{ WM_IME_NOTIFY, sent|defwinproc|optional},
{ WM_SETFOCUS, sent|defwinproc},
{ WM_NOTIFYFORMAT, sent},
- { 0x0129, sent}, /* should be WM_QUERYUISTATE instead of 0x0129*/
+ { WM_QUERYUISTATE, sent|optional},
{0}
};
{ TBM_SETPOS, sent|wparam|lparam, TRUE, 5},
{ WM_PAINT, sent|defwinproc},
{ TBM_GETPOS, sent},
+ { TBM_SETPOS, sent|wparam|lparam, TRUE, 5},
{ TBM_SETPOS, sent|wparam|lparam, TRUE, 1000},
{ WM_PAINT, sent|defwinproc},
{ TBM_GETPOS, sent},
{ TBM_SETPOS, sent|wparam|lparam, FALSE, 20},
{ TBM_GETPOS, sent},
+ { TBM_SETPOS, sent|wparam|lparam, TRUE, 20},
{ TBM_GETPOS, sent},
{0}
};
static const struct message tic_placement_test_seq[] = {
{ TBM_GETPTICS, sent},
{ TBM_GETTIC, sent|wparam, 0},
+ { TBM_GETTIC, sent|wparam, 2},
{ TBM_GETTIC, sent|wparam, 4},
- { TBM_GETTIC, sent|wparam, 11},
{ TBM_GETTICPOS, sent|wparam, 0},
- { TBM_GETTICPOS, sent|wparam, 4},
+ { TBM_GETTICPOS, sent|wparam, 2},
{0}
};
};
static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){
- static long defwndproc_counter = 0;
+ static LONG defwndproc_counter = 0;
LRESULT ret;
struct message msg;
- /* do not log painting messages */
- if (message != WM_PAINT &&
+ /* log system messages, except for painting */
+ if (message < WM_USER &&
+ message != WM_PAINT &&
message != WM_ERASEBKGND &&
message != WM_NCPAINT &&
message != WM_NCHITTEST &&
message != WM_GETICON &&
message != WM_DEVICECHANGE)
{
+ trace("parent: %p, %04x, %08lx, %08lx\n", hwnd, message, wParam, lParam);
+
msg.message = message;
msg.flags = sent|wparam|lparam;
if (defwndproc_counter) msg.flags |= defwinproc;
cls.cbWndExtra = 0;
cls.hInstance = GetModuleHandleA(NULL);
cls.hIcon = 0;
- cls.hCursor = LoadCursorA(0, (LPSTR)IDC_ARROW);
+ cls.hCursor = LoadCursorA(0, IDC_ARROW);
cls.hbrBackground = GetStockObject(WHITE_BRUSH);
cls.lpszMenuName = NULL;
cls.lpszClassName = "Trackbar test parent class";
static LRESULT WINAPI trackbar_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){
struct subclass_info *info = (struct subclass_info *) GetWindowLongPtrA(hwnd, GWLP_USERDATA);
- static long defwndproc_counter = 0;
+ static LONG defwndproc_counter = 0;
LRESULT ret;
struct message msg;
+ trace("trackbar: %p, %04x, %08lx, %08lx\n", hwnd, message, wParam, lParam);
+
msg.message = message;
msg.flags = sent|wparam|lparam;
if (defwndproc_counter) msg.flags |= defwinproc;
flush_sequences(sequences, NUM_MSG_SEQUENCE);
- hWndLeftBuddy = (HWND) CreateWindowEx(0, STATUSCLASSNAME, NULL, 0,
+ hWndLeftBuddy = CreateWindowEx(0, STATUSCLASSNAME, NULL, 0,
0,0,300,20, NULL, NULL, NULL, NULL);
ok(hWndLeftBuddy != NULL, "Expected non NULL value\n");
} else
skip ("left buddy control not present?\n");
- hWndRightBuddy = (HWND) CreateWindowEx(0, STATUSCLASSNAME, NULL, 0,
+ hWndRightBuddy = CreateWindowEx(0, STATUSCLASSNAME, NULL, 0,
0,0,300,20,NULL,NULL, NULL, NULL);
ok(hWndRightBuddy != NULL, "expected non NULL value\n");
/* test TBM_GETPAGESIZE */
r = SendMessage(hWndTrackbar, TBM_GETPAGESIZE, 0,0);
- todo_wine{
expect(20, r);
- }
ok_sequence(sequences, TRACKBAR_SEQ_INDEX, page_size_test_seq, "page size test sequence", FALSE);
ok_sequence(sequences, PARENT_SEQ_INDEX, parent_empty_test_seq, "parent page size test sequence", FALSE);
+
+ /* check for zero page size */
+ r = SendMessage(hWndTrackbar, TBM_SETPAGESIZE, 0, 0);
+ expect(20, r);
+ r = SendMessage(hWndTrackbar, TBM_GETPAGESIZE, 0, 0);
+ expect(0, r);
+ /* revert to default */
+ r = SendMessage(hWndTrackbar, TBM_SETPAGESIZE, 0, -1);
+ expect(0, r);
+ r = SendMessage(hWndTrackbar, TBM_GETPAGESIZE, 0, 0);
+ expect(20, r);
+ /* < -1 */
+ r = SendMessage(hWndTrackbar, TBM_SETPAGESIZE, 0, -2);
+ expect(20, r);
+ r = SendMessage(hWndTrackbar, TBM_GETPAGESIZE, 0, 0);
+ expect(-2, r);
}
static void test_position(HWND hWndTrackbar){
SendMessage(hWndTrackbar, TBM_SETPOS, TRUE, 5);
r = SendMessage(hWndTrackbar, TBM_GETPOS, 0,0);
expect(5, r);
+ SendMessage(hWndTrackbar, TBM_SETPOS, TRUE, 5);
SendMessage(hWndTrackbar, TBM_SETPOS, TRUE, 1000);
r = SendMessage(hWndTrackbar, TBM_GETPOS, 0,0);
expect(100, r);
SendMessage(hWndTrackbar, TBM_SETPOS, FALSE, 20);
r = SendMessage(hWndTrackbar, TBM_GETPOS, 0,0);
expect(20, r);
+ SendMessage(hWndTrackbar, TBM_SETPOS, TRUE, 20);
/* test TBM_GETPOS */
r = SendMessage(hWndTrackbar, TBM_GETPOS, 0,0);
static void test_tic_placement(HWND hWndTrackbar){
int r;
DWORD *rPTics;
+ DWORD numtics;
+
+ SendMessage(hWndTrackbar, TBM_SETRANGE, TRUE, MAKELONG(1, 6));
+ SendMessage(hWndTrackbar, TBM_SETTICFREQ, 1, 0);
+
+ numtics = SendMessage(hWndTrackbar, TBM_GETNUMTICS, 0, 0);
+ ok(numtics == 6, "Expected 6, got %d\n", numtics);
flush_sequences(sequences, NUM_MSG_SEQUENCE);
/* test TBM_GETPTICS */
rPTics = (DWORD *) SendMessage(hWndTrackbar, TBM_GETPTICS, 0,0);
- todo_wine{
- expect(1, rPTics[0]);
- expect(2, rPTics[1]);
- expect(3, rPTics[2]);
- expect(4, rPTics[3]);
- }
+ expect(2, rPTics[0]);
+ expect(3, rPTics[1]);
+ expect(4, rPTics[2]);
+ expect(5, rPTics[3]);
/* test TBM_GETTIC */
r = SendMessage(hWndTrackbar, TBM_GETTIC, 0,0);
+ expect(2, r);
+ r = SendMessage(hWndTrackbar, TBM_GETTIC, 2,0);
+ expect(4, r);
+ r = SendMessage(hWndTrackbar, TBM_GETTIC, 4,0);
todo_wine{
- expect(1, r);
- r = SendMessage(hWndTrackbar, TBM_GETTIC, 4,0);
- expect(5, r);
+ expect(-1, r);
}
- r = SendMessage(hWndTrackbar, TBM_GETTIC, 11,0);
- expect(-1, r);
/* test TBM_GETTICPIC */
r = SendMessage(hWndTrackbar, TBM_GETTICPOS, 0, 0);
- todo_wine{
ok(r > 0, "Expected r > 0, got %d\n", r);
- r = SendMessage(hWndTrackbar, TBM_GETTICPOS, 4, 0);
+ r = SendMessage(hWndTrackbar, TBM_GETTICPOS, 2, 0);
ok(r > 0, "Expected r > 0, got %d\n", r);
- }
ok_sequence(sequences, TRACKBAR_SEQ_INDEX, tic_placement_test_seq, "get tic placement test sequence", FALSE);
ok_sequence(sequences, PARENT_SEQ_INDEX, parent_empty_test_seq, "parent get tic placement test sequence", FALSE);
SendMessage(hWndTrackbar, TBM_SETTOOLTIPS, (LPARAM) hWndTooltip, 0);
rTest = (HWND) SendMessage(hWndTrackbar, TBM_GETTOOLTIPS, 0,0);
ok(rTest == hWndTooltip, "Expected hWndToolTip, got\n");
- SendMessage(hWndTrackbar, TBM_SETTOOLTIPS, (LPARAM) NULL, 0);
+ SendMessage(hWndTrackbar, TBM_SETTOOLTIPS, 0, 0);
rTest = (HWND) SendMessage(hWndTrackbar, TBM_GETTOOLTIPS, 0,0);
ok(rTest == NULL, "Expected NULL\n");
SendMessage(hWndTrackbar, TBM_SETTOOLTIPS, (LPARAM) hWndTooltip, 5);