comctl32/tests: Preparation for switching __WINESRC__ on.

This commit is contained in:
Nikolay Sivov 2013-10-22 19:12:18 +04:00 committed by Alexandre Julliard
parent 947cce79d6
commit 44ebba9d5e
7 changed files with 894 additions and 897 deletions

View File

@ -49,37 +49,37 @@ static HWND createComboEx(DWORD style) {
hComboExParentWnd, NULL, hMainHinst, NULL);
}
static LONG addItem(HWND cbex, int idx, LPTSTR text) {
COMBOBOXEXITEM cbexItem;
static LONG addItem(HWND cbex, int idx, const char *text) {
COMBOBOXEXITEMA cbexItem;
memset(&cbexItem, 0x00, sizeof(cbexItem));
cbexItem.mask = CBEIF_TEXT;
cbexItem.iItem = idx;
cbexItem.pszText = text;
cbexItem.pszText = (char*)text;
cbexItem.cchTextMax = 0;
return SendMessage(cbex, CBEM_INSERTITEM, 0, (LPARAM)&cbexItem);
return SendMessageA(cbex, CBEM_INSERTITEMA, 0, (LPARAM)&cbexItem);
}
static LONG setItem(HWND cbex, int idx, LPTSTR text) {
COMBOBOXEXITEM cbexItem;
static LONG setItem(HWND cbex, int idx, const char *text) {
COMBOBOXEXITEMA cbexItem;
memset(&cbexItem, 0x00, sizeof(cbexItem));
cbexItem.mask = CBEIF_TEXT;
cbexItem.iItem = idx;
cbexItem.pszText = text;
cbexItem.pszText = (char*)text;
cbexItem.cchTextMax = 0;
return SendMessage(cbex, CBEM_SETITEM, 0, (LPARAM)&cbexItem);
return SendMessageA(cbex, CBEM_SETITEMA, 0, (LPARAM)&cbexItem);
}
static LONG delItem(HWND cbex, int idx) {
return SendMessage(cbex, CBEM_DELETEITEM, idx, 0);
return SendMessageA(cbex, CBEM_DELETEITEM, idx, 0);
}
static LONG getItem(HWND cbex, int idx, COMBOBOXEXITEM *cbItem) {
memset(cbItem, 0x00, sizeof(COMBOBOXEXITEM));
static LONG getItem(HWND cbex, int idx, COMBOBOXEXITEMA *cbItem) {
memset(cbItem, 0x00, sizeof(COMBOBOXEXITEMA));
cbItem->mask = CBEIF_TEXT;
cbItem->pszText = textBuffer;
cbItem->iItem = idx;
cbItem->cchTextMax = 100;
return SendMessage(cbex, CBEM_GETITEM, 0, (LPARAM)cbItem);
return SendMessageA(cbex, CBEM_GETITEMA, 0, (LPARAM)cbItem);
}
static LRESULT WINAPI editbox_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
@ -118,7 +118,7 @@ static HWND subclass_editbox(HWND hwndComboEx)
WNDPROC oldproc;
HWND hwnd;
hwnd = (HWND)SendMessage(hwndComboEx, CBEM_GETEDITCONTROL, 0, 0);
hwnd = (HWND)SendMessageA(hwndComboEx, CBEM_GETEDITCONTROL, 0, 0);
oldproc = (WNDPROC)SetWindowLongPtrA(hwnd, GWLP_WNDPROC,
(LONG_PTR)editbox_subclass_proc);
SetWindowLongPtrA(hwnd, GWLP_USERDATA, (LONG_PTR)oldproc);
@ -129,15 +129,13 @@ static HWND subclass_editbox(HWND hwndComboEx)
static void test_comboboxex(void) {
HWND myHwnd = 0;
LONG res = -1;
COMBOBOXEXITEM cbexItem;
static TCHAR first_item[] = {'F','i','r','s','t',' ','I','t','e','m',0},
second_item[] = {'S','e','c','o','n','d',' ','I','t','e','m',0},
third_item[] = {'T','h','i','r','d',' ','I','t','e','m',0},
middle_item[] = {'B','e','t','w','e','e','n',' ','F','i','r','s','t',' ','a','n','d',' ',
'S','e','c','o','n','d',' ','I','t','e','m','s',0},
replacement_item[] = {'B','e','t','w','e','e','n',' ','F','i','r','s','t',' ','a','n','d',' ',
'S','e','c','o','n','d',' ','I','t','e','m','s',0},
out_of_range_item[] = {'O','u','t',' ','o','f',' ','R','a','n','g','e',' ','I','t','e','m',0};
COMBOBOXEXITEMA cbexItem;
static const char *first_item = "First Item",
*second_item = "Second Item",
*third_item = "Third Item",
*middle_item = "Between First and Second Items",
*replacement_item = "Between First and Second Items",
*out_of_range_item = "Out of Range Item";
/* Allocate space for result */
textBuffer = HeapAlloc(GetProcessHeap(), 0, MAX_CHARS);
@ -267,8 +265,8 @@ static void test_WM_LBUTTONDOWN(void)
"Failed to add item %d\n", i);
}
hCombo = (HWND)SendMessage(hComboEx, CBEM_GETCOMBOCONTROL, 0, 0);
hEdit = (HWND)SendMessage(hComboEx, CBEM_GETEDITCONTROL, 0, 0);
hCombo = (HWND)SendMessageA(hComboEx, CBEM_GETCOMBOCONTROL, 0, 0);
hEdit = (HWND)SendMessageA(hComboEx, CBEM_GETEDITCONTROL, 0, 0);
cbInfo.cbSize = sizeof(COMBOBOXINFO);
result = pGetComboBoxInfo(hCombo, &cbInfo);
@ -282,19 +280,19 @@ static void test_WM_LBUTTONDOWN(void)
/* Click on the button to drop down the list */
x = cbInfo.rcButton.left + (cbInfo.rcButton.right-cbInfo.rcButton.left)/2;
y = cbInfo.rcButton.top + (cbInfo.rcButton.bottom-cbInfo.rcButton.top)/2;
result = SendMessage(hCombo, WM_LBUTTONDOWN, 0, MAKELPARAM(x, y));
result = SendMessageA(hCombo, WM_LBUTTONDOWN, 0, MAKELPARAM(x, y));
ok(result, "WM_LBUTTONDOWN was not processed. LastError=%d\n",
GetLastError());
ok(GetFocus() == hCombo ||
broken(GetFocus() != hCombo), /* win98 */
"Focus not on ComboBoxEx's ComboBox Control, instead on %p\n",
GetFocus());
ok(SendMessage(hComboEx, CB_GETDROPPEDSTATE, 0, 0),
ok(SendMessageA(hComboEx, CB_GETDROPPEDSTATE, 0, 0),
"The dropdown list should have appeared after clicking the button.\n");
idx = SendMessage(hCombo, CB_GETTOPINDEX, 0, 0);
idx = SendMessageA(hCombo, CB_GETTOPINDEX, 0, 0);
ok(idx == 0, "For TopIndex expected %d, got %d\n", 0, idx);
result = SendMessage(hCombo, WM_LBUTTONUP, 0, MAKELPARAM(x, y));
result = SendMessageA(hCombo, WM_LBUTTONUP, 0, MAKELPARAM(x, y));
ok(result, "WM_LBUTTONUP was not processed. LastError=%d\n",
GetLastError());
ok(GetFocus() == hCombo ||
@ -303,11 +301,11 @@ static void test_WM_LBUTTONDOWN(void)
GetFocus());
/* Click on the 5th item in the list */
item_height = SendMessage(hCombo, CB_GETITEMHEIGHT, 0, 0);
item_height = SendMessageA(hCombo, CB_GETITEMHEIGHT, 0, 0);
ok(GetClientRect(hList, &rect), "Failed to get list's client rect.\n");
x = rect.left + (rect.right-rect.left)/2;
y = item_height/2 + item_height*4;
result = SendMessage(hList, WM_MOUSEMOVE, 0, MAKELPARAM(x, y));
result = SendMessageA(hList, WM_MOUSEMOVE, 0, MAKELPARAM(x, y));
ok(!result, "WM_MOUSEMOVE was not processed. LastError=%d\n",
GetLastError());
ok(GetFocus() == hCombo ||
@ -315,17 +313,17 @@ static void test_WM_LBUTTONDOWN(void)
"Focus not on ComboBoxEx's ComboBox Control, instead on %p\n",
GetFocus());
result = SendMessage(hList, WM_LBUTTONDOWN, 0, MAKELPARAM(x, y));
result = SendMessageA(hList, WM_LBUTTONDOWN, 0, MAKELPARAM(x, y));
ok(!result, "WM_LBUTTONDOWN was not processed. LastError=%d\n",
GetLastError());
ok(GetFocus() == hCombo ||
broken(GetFocus() != hCombo), /* win98 */
"Focus not on ComboBoxEx's ComboBox Control, instead on %p\n",
GetFocus());
ok(SendMessage(hComboEx, CB_GETDROPPEDSTATE, 0, 0),
ok(SendMessageA(hComboEx, CB_GETDROPPEDSTATE, 0, 0),
"The dropdown list should still be visible.\n");
result = SendMessage(hList, WM_LBUTTONUP, 0, MAKELPARAM(x, y));
result = SendMessageA(hList, WM_LBUTTONUP, 0, MAKELPARAM(x, y));
ok(!result, "WM_LBUTTONUP was not processed. LastError=%d\n",
GetLastError());
todo_wine ok(GetFocus() == hEdit ||
@ -333,11 +331,11 @@ static void test_WM_LBUTTONDOWN(void)
"Focus not on ComboBoxEx's Edit Control, instead on %p\n",
GetFocus());
result = SendMessage(hCombo, CB_GETDROPPEDSTATE, 0, 0);
result = SendMessageA(hCombo, CB_GETDROPPEDSTATE, 0, 0);
ok(!result ||
broken(result != 0), /* win98 */
"The dropdown list should have been rolled up.\n");
idx = SendMessage(hComboEx, CB_GETCURSEL, 0, 0);
idx = SendMessageA(hComboEx, CB_GETCURSEL, 0, 0);
ok(idx == 4 ||
broken(idx == -1), /* win98 */
"Current Selection: expected %d, got %d\n", 4, idx);
@ -368,18 +366,18 @@ static void test_CB_GETLBTEXT(void)
item.iItem = 0;
item.pszText = buff;
item.cchTextMax = 1;
ret = SendMessage(hCombo, CBEM_GETITEMA, 0, (LPARAM)&item);
ret = SendMessageA(hCombo, CBEM_GETITEMA, 0, (LPARAM)&item);
ok(ret != 0, "CBEM_GETITEM failed\n");
ok(buff[0] == 0, "\n");
ret = SendMessage(hCombo, CB_GETLBTEXTLEN, 0, 0);
ret = SendMessageA(hCombo, CB_GETLBTEXTLEN, 0, 0);
ok(ret == 0, "Expected zero length\n");
ret = SendMessage(hCombo, CB_GETLBTEXTLEN, 0, 0);
ret = SendMessageA(hCombo, CB_GETLBTEXTLEN, 0, 0);
ok(ret == 0, "Expected zero length\n");
buff[0] = 'a';
ret = SendMessage(hCombo, CB_GETLBTEXT, 0, (LPARAM)buff);
ret = SendMessageA(hCombo, CB_GETLBTEXT, 0, (LPARAM)buff);
ok(ret == 0, "Expected zero length\n");
ok(buff[0] == 0, "Expected null terminator as a string, got %s\n", buff);
@ -533,9 +531,9 @@ static void test_comboboxex_subclass(void)
hComboEx = createComboEx(WS_BORDER | WS_VISIBLE | WS_CHILD | CBS_DROPDOWN);
hCombo = (HWND)SendMessage(hComboEx, CBEM_GETCOMBOCONTROL, 0, 0);
hCombo = (HWND)SendMessageA(hComboEx, CBEM_GETCOMBOCONTROL, 0, 0);
ok(hCombo != NULL, "Failed to get internal combo\n");
hEdit = (HWND)SendMessage(hComboEx, CBEM_GETEDITCONTROL, 0, 0);
hEdit = (HWND)SendMessageA(hComboEx, CBEM_GETEDITCONTROL, 0, 0);
ok(hEdit != NULL, "Failed to get internal edit\n");
if (pSetWindowSubclass)
@ -571,7 +569,7 @@ static void test_get_set_item(void)
item.mask = CBEIF_TEXT;
item.pszText = textA;
item.iItem = -1;
ret = SendMessage(hComboEx, CBEM_SETITEMA, 0, (LPARAM)&item);
ret = SendMessageA(hComboEx, CBEM_SETITEMA, 0, (LPARAM)&item);
expect(TRUE, ret);
ok_sequence(sequences, EDITBOX_SEQ_INDEX, test_setitem_edit_seq, "set item data for edit", FALSE);
@ -580,16 +578,16 @@ static void test_get_set_item(void)
item.mask = CBEIF_LPARAM;
item.iItem = -1;
item.lParam = 0xdeadbeef;
ret = SendMessage(hComboEx, CBEM_GETITEMA, 0, (LPARAM)&item);
ret = SendMessageA(hComboEx, CBEM_GETITEMA, 0, (LPARAM)&item);
expect(TRUE, ret);
ok(item.lParam == 0, "Expected zero, got %lx\n", item.lParam);
item.lParam = 0x1abe11ed;
ret = SendMessage(hComboEx, CBEM_SETITEMA, 0, (LPARAM)&item);
ret = SendMessageA(hComboEx, CBEM_SETITEMA, 0, (LPARAM)&item);
expect(TRUE, ret);
item.lParam = 0;
ret = SendMessage(hComboEx, CBEM_GETITEMA, 0, (LPARAM)&item);
ret = SendMessageA(hComboEx, CBEM_GETITEMA, 0, (LPARAM)&item);
expect(TRUE, ret);
ok(item.lParam == 0x1abe11ed, "Expected 0x1abe11ed, got %lx\n", item.lParam);

View File

@ -160,8 +160,8 @@ static HWND create_datetime_control(DWORD style)
WNDPROC oldproc;
HWND hWndDateTime = NULL;
hWndDateTime = CreateWindowEx(0,
DATETIMEPICK_CLASS,
hWndDateTime = CreateWindowExA(0,
DATETIMEPICK_CLASSA,
NULL,
style,
0,50,300,120,
@ -190,24 +190,23 @@ static void test_dtm_set_format(void)
flush_sequences(sequences, NUM_MSG_SEQUENCES);
r = SendMessage(hWnd, DTM_SETFORMAT, 0, 0);
r = SendMessageA(hWnd, DTM_SETFORMATA, 0, 0);
expect(1, r);
r = SendMessage(hWnd, DTM_SETFORMAT, 0,
r = SendMessageA(hWnd, DTM_SETFORMATA, 0,
(LPARAM)"'Today is: 'hh':'m':'s dddd MMM dd', 'yyyy");
expect(1, r);
ok_sequence(sequences, DATETIME_SEQ_INDEX, test_dtm_set_format_seq, "test_dtm_set_format", FALSE);
r = SendMessage(hWnd, DTM_SETFORMAT, 0,
(LPARAM)"'hh' hh");
r = SendMessageA(hWnd, DTM_SETFORMATA, 0, (LPARAM)"'hh' hh");
expect(1, r);
ZeroMemory(&systime, sizeof(systime));
systime.wYear = 2000;
systime.wMonth = systime.wDay = 1;
r = SendMessage(hWnd, DTM_SETSYSTEMTIME, 0, (LPARAM)&systime);
r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, 0, (LPARAM)&systime);
expect(1, r);
GetWindowText(hWnd, txt, 256);
GetWindowTextA(hWnd, txt, 256);
ok(strcmp(txt, "hh 12") == 0, "String mismatch (\"%s\" vs \"hh 12\")\n", txt);
DestroyWindow(hWnd);
@ -218,17 +217,17 @@ static void test_mccolor_types(HWND hWndDateTime, int mccolor_type, const char*
COLORREF theColor, prevColor, crColor;
theColor=RGB(0,0,0);
crColor = SendMessage(hWndDateTime, DTM_SETMCCOLOR, mccolor_type, theColor);
crColor = SendMessageA(hWndDateTime, DTM_SETMCCOLOR, mccolor_type, theColor);
ok(crColor != ~0u, "%s: Set RGB(0,0,0): Expected COLORREF of previous value, got %d\n", mccolor_name, crColor);
prevColor=theColor;
theColor=RGB(255,255,255);
crColor = SendMessage(hWndDateTime, DTM_SETMCCOLOR, mccolor_type, theColor);
crColor = SendMessageA(hWndDateTime, DTM_SETMCCOLOR, mccolor_type, theColor);
ok(crColor==prevColor, "%s: Set RGB(255,255,255): Expected COLORREF of previous value, got %d\n", mccolor_name, crColor);
prevColor=theColor;
theColor=RGB(100,180,220);
crColor = SendMessage(hWndDateTime, DTM_SETMCCOLOR, mccolor_type, theColor);
crColor = SendMessageA(hWndDateTime, DTM_SETMCCOLOR, mccolor_type, theColor);
ok(crColor==prevColor, "%s: Set RGB(100,180,220): Expected COLORREF of previous value, got %d\n", mccolor_name, crColor);
crColor = SendMessage(hWndDateTime, DTM_GETMCCOLOR, mccolor_type, 0);
crColor = SendMessageA(hWndDateTime, DTM_GETMCCOLOR, mccolor_type, 0);
ok(crColor==theColor, "%s: GETMCCOLOR: Expected %d, got %d\n", mccolor_name, theColor, crColor);
}
@ -262,8 +261,8 @@ static void test_dtm_set_and_get_mcfont(void)
flush_sequences(sequences, NUM_MSG_SEQUENCES);
hFontOrig = GetStockObject(DEFAULT_GUI_FONT);
SendMessage(hWnd, DTM_SETMCFONT, (WPARAM)hFontOrig, TRUE);
hFontNew = (HFONT)SendMessage(hWnd, DTM_GETMCFONT, 0, 0);
SendMessageA(hWnd, DTM_SETMCFONT, (WPARAM)hFontOrig, TRUE);
hFontNew = (HFONT)SendMessageA(hWnd, DTM_GETMCFONT, 0, 0);
ok(hFontOrig == hFontNew, "Expected hFontOrig==hFontNew, hFontOrig=%p, hFontNew=%p\n", hFontOrig, hFontNew);
ok_sequence(sequences, DATETIME_SEQ_INDEX, test_dtm_set_and_get_mcfont_seq, "test_dtm_set_and_get_mcfont", FALSE);
@ -280,7 +279,7 @@ static void test_dtm_get_monthcal(void)
flush_sequences(sequences, NUM_MSG_SEQUENCES);
todo_wine {
r = SendMessage(hWnd, DTM_GETMONTHCAL, 0, 0);
r = SendMessageA(hWnd, DTM_GETMONTHCAL, 0, 0);
ok(r == 0, "Expected NULL(no child month calendar control), got %ld\n", r);
}
@ -344,13 +343,13 @@ static void test_dtm_set_and_get_range(void)
/* initialize st[1] to all invalid numbers */
fill_systime_struct(&st[1], 0, 0, 7, 0, 24, 60, 60, 1000);
r = SendMessage(hWnd, DTM_SETRANGE, GDTR_MIN, (LPARAM)st);
r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN, (LPARAM)st);
expect(1, r);
r = SendMessage(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
ok(r == GDTR_MIN, "Expected %x, not %x(GDTR_MAX) or %x(GDTR_MIN | GDTR_MAX), got %lx\n", GDTR_MIN, GDTR_MAX, GDTR_MIN | GDTR_MAX, r);
expect_systime(&st[0], &getSt[0]);
r = SendMessage(hWnd, DTM_SETRANGE, GDTR_MAX, (LPARAM)st);
r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MAX, (LPARAM)st);
expect_unsuccess(0, r);
/* set st[0] to all invalid numbers */
@ -358,25 +357,25 @@ static void test_dtm_set_and_get_range(void)
/* set st[1] to highest possible value */
fill_systime_struct(&st[1], 30827, 12, 6, 31, 23, 59, 59, 999);
r = SendMessage(hWnd, DTM_SETRANGE, GDTR_MAX, (LPARAM)st);
r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MAX, (LPARAM)st);
expect(1, r);
r = SendMessage(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
todo_wine {
ok(r == GDTR_MAX, "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MIN | GDTR_MAX), got %lx\n", GDTR_MAX, GDTR_MIN, GDTR_MIN | GDTR_MAX, r);
}
expect_systime(&st[1], &getSt[1]);
r = SendMessage(hWnd, DTM_SETRANGE, GDTR_MIN, (LPARAM)st);
r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN, (LPARAM)st);
expect_unsuccess(0, r);
r = SendMessage(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
expect_unsuccess(0, r);
/* set st[0] to highest possible value */
fill_systime_struct(&st[0], 30827, 12, 6, 31, 23, 59, 59, 999);
r = SendMessage(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
expect(1, r);
r = SendMessage(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
expect_systime(&st[0], &getSt[0]);
expect_systime(&st[1], &getSt[1]);
@ -386,9 +385,9 @@ static void test_dtm_set_and_get_range(void)
/* set st[1] to highest possible value */
fill_systime_struct(&st[1], 30827, 12, 6, 31, 23, 59, 59, 999);
r = SendMessage(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
expect(1, r);
r = SendMessage(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
expect_systime(&st[0], &getSt[0]);
expect_systime(&st[1], &getSt[1]);
@ -398,9 +397,9 @@ static void test_dtm_set_and_get_range(void)
/* set st[1] to value lower than maximum */
fill_systime_struct(&st[1], 2007, 3, 2, 31, 23, 59, 59, 999);
r = SendMessage(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
expect(1, r);
r = SendMessage(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
expect_systime(&st[0], &getSt[0]);
expect_systime(&st[1], &getSt[1]);
@ -426,9 +425,9 @@ static void test_dtm_set_range_swap_min_max(void)
fill_systime_struct(&st[0], 2007, 2, 4, 15, 2, 2, 2, 2);
r = SendMessage(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st[0]);
r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st[0]);
expect(1, r);
r = SendMessage(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&origSt);
r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&origSt);
ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld\n", GDT_VALID, GDT_NONE, GDT_ERROR, r);
expect_systime(&st[0], &origSt);
@ -438,9 +437,9 @@ static void test_dtm_set_range_swap_min_max(void)
/* since min>max, min and max values should be swapped by DTM_SETRANGE
automatically */
r = SendMessage(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
expect(1, r);
r = SendMessage(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
todo_wine {
ok(compare_systime(&st[0], &getSt[0]) == 1 ||
@ -454,9 +453,9 @@ static void test_dtm_set_range_swap_min_max(void)
fill_systime_struct(&st[0], 1980, 1, 3, 23, 14, 34, 37, 465);
r = SendMessage(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st[0]);
r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st[0]);
expect(1, r);
r = SendMessage(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt[0]);
r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt[0]);
ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld\n", GDT_VALID, GDT_NONE, GDT_ERROR, r);
/* the time part seems to not change after swapping the min and max values
and doing DTM_SETSYSTEMTIME */
@ -472,12 +471,12 @@ static void test_dtm_set_range_swap_min_max(void)
/* set st[1] to value lower than maximum */
fill_systime_struct(&st[1], 2007, 3, 2, 31, 23, 59, 59, 999);
r = SendMessage(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
expect(1, r);
/* for some reason after we swapped the min and max values before,
whenever we do a DTM_SETRANGE, the DTM_GETRANGE will return the values
swapped*/
r = SendMessage(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
todo_wine {
ok(compare_systime(&st[0], &getSt[1]) == 1 ||
@ -495,9 +494,9 @@ static void test_dtm_set_range_swap_min_max(void)
/* set min>max again, so that the return values of DTM_GETRANGE are no
longer swapped the next time we do a DTM SETRANGE and DTM_GETRANGE*/
r = SendMessage(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
expect(1, r);
r = SendMessage(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
expect_systime(&st[0], &getSt[1]);
expect_systime(&st[1], &getSt[0]);
@ -507,9 +506,9 @@ static void test_dtm_set_range_swap_min_max(void)
/* set st[1] to highest possible value */
fill_systime_struct(&st[1], 30827, 12, 6, 31, 23, 59, 59, 999);
r = SendMessage(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
expect(1, r);
r = SendMessage(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
expect_systime(&st[0], &getSt[0]);
expect_systime(&st[1], &getSt[1]);
@ -529,7 +528,7 @@ static void test_dtm_set_and_get_system_time(void)
ok(hWndDateTime_test_gdt_none!=NULL, "Expected non NULL, got %p\n", hWndDateTime_test_gdt_none);
if(hWndDateTime_test_gdt_none) {
r = SendMessage(hWndDateTime_test_gdt_none, DTM_SETSYSTEMTIME, GDT_NONE, (LPARAM)&st);
r = SendMessageA(hWndDateTime_test_gdt_none, DTM_SETSYSTEMTIME, GDT_NONE, (LPARAM)&st);
expect(0, r);
}
else {
@ -544,128 +543,128 @@ static void test_dtm_set_and_get_system_time(void)
hWnd = create_datetime_control(DTS_SHOWNONE);
flush_sequences(sequences, NUM_MSG_SEQUENCES);
r = SendMessage(hWnd, DTM_SETSYSTEMTIME, GDT_NONE, (LPARAM)&st);
r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_NONE, (LPARAM)&st);
expect(1, r);
r = SendMessage(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt);
r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt);
ok(r == GDT_NONE, "Expected %d, not %d(GDT_VALID) or %d(GDT_ERROR), got %ld\n", GDT_NONE, GDT_VALID, GDT_ERROR, r);
/* set st to lowest possible value */
fill_systime_struct(&st, 1601, 1, 0, 1, 0, 0, 0, 0);
r = SendMessage(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
expect(1, r);
/* set st to highest possible value */
fill_systime_struct(&st, 30827, 12, 6, 31, 23, 59, 59, 999);
r = SendMessage(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
expect(1, r);
/* set st to value between min and max */
fill_systime_struct(&st, 1980, 1, 3, 23, 14, 34, 37, 465);
r = SendMessage(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
expect(1, r);
r = SendMessage(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt);
r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt);
ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld\n", GDT_VALID, GDT_NONE, GDT_ERROR, r);
expect_systime(&st, &getSt);
/* set st to invalid value */
fill_systime_struct(&st, 0, 0, 7, 0, 24, 60, 60, 1000);
r = SendMessage(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
expect_unsuccess(0, r);
ok_sequence(sequences, DATETIME_SEQ_INDEX, test_dtm_set_and_get_system_time_seq, "test_dtm_set_and_get_system_time", FALSE);
/* set to some valid value */
GetSystemTime(&ref);
r = SendMessage(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&ref);
r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&ref);
expect(1, r);
r = SendMessage(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt);
r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt);
expect(GDT_VALID, r);
expect_systime(&ref, &getSt);
/* year invalid */
st = ref;
st.wYear = 0;
r = SendMessage(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
todo_wine expect(1, r);
r = SendMessage(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt);
r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt);
expect(GDT_VALID, r);
expect_systime(&ref, &getSt);
/* month invalid */
st = ref;
st.wMonth = 13;
r = SendMessage(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
expect(0, r);
r = SendMessage(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt);
r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt);
expect(GDT_VALID, r);
expect_systime(&ref, &getSt);
/* day invalid */
st = ref;
st.wDay = 32;
r = SendMessage(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
expect(0, r);
r = SendMessage(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt);
r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt);
expect(GDT_VALID, r);
expect_systime(&ref, &getSt);
/* day invalid for current month */
st = ref;
st.wDay = 30;
st.wMonth = 2;
r = SendMessage(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
expect(0, r);
r = SendMessage(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt);
r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt);
expect(GDT_VALID, r);
expect_systime(&ref, &getSt);
/* day of week isn't validated */
st = ref;
st.wDayOfWeek = 10;
r = SendMessage(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
expect(1, r);
r = SendMessage(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt);
r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt);
expect(GDT_VALID, r);
expect_systime(&ref, &getSt);
/* hour invalid */
st = ref;
st.wHour = 25;
r = SendMessage(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
expect(0, r);
r = SendMessage(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt);
r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt);
expect(GDT_VALID, r);
expect_systime(&ref, &getSt);
/* minute invalid */
st = ref;
st.wMinute = 60;
r = SendMessage(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
expect(0, r);
r = SendMessage(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt);
r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt);
expect(GDT_VALID, r);
expect_systime(&ref, &getSt);
/* sec invalid */
st = ref;
st.wSecond = 60;
r = SendMessage(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
expect(0, r);
r = SendMessage(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt);
r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt);
expect(GDT_VALID, r);
expect_systime(&ref, &getSt);
/* msec invalid */
st = ref;
st.wMilliseconds = 1000;
r = SendMessage(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
expect(0, r);
r = SendMessage(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt);
r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt);
expect(GDT_VALID, r);
expect_systime(&ref, &getSt);
/* day of week should be calculated automatically,
actual day of week for this date is 4 */
fill_systime_struct(&st, 2009, 10, 1, 1, 0, 0, 10, 200);
r = SendMessage(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
expect(1, r);
r = SendMessage(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt);
r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt);
expect(GDT_VALID, r);
/* 01.10.2009 is Thursday */
expect(4, (LRESULT)getSt.wDayOfWeek);
@ -687,35 +686,35 @@ static void test_dtm_set_and_get_systemtime_with_limits(void)
fill_systime_struct(&st[0], 1980, 1, 3, 23, 14, 34, 37, 465);
fill_systime_struct(&st[1], 2007, 3, 2, 31, 23, 59, 59, 999);
r = SendMessage(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
expect(1, r);
r = SendMessage(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
expect_systime(&st[0], &getSt[0]);
expect_systime(&st[1], &getSt[1]);
/* Initially set a valid time */
fill_systime_struct(&refSt, 1999, 9, 4, 9, 19, 9, 9, 999);
r = SendMessage(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&refSt);
r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&refSt);
expect(1, r);
r = SendMessage(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt[0]);
r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt[0]);
ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld\n", GDT_VALID, GDT_NONE, GDT_ERROR, r);
expect_systime(&refSt, &getSt[0]);
/* Now set an out-of-bounds time */
fill_systime_struct(&st[0], 2010, 1, 0, 1, 0, 0, 0, 0);
r = SendMessage(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st[0]);
r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st[0]);
expect(1, r);
r = SendMessage(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt[0]);
r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt[0]);
ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld\n", GDT_VALID, GDT_NONE, GDT_ERROR, r);
expect_systime(&refSt, &getSt[0]);
fill_systime_struct(&st[0], 1977, 1, 0, 1, 0, 0, 0, 0);
r = SendMessage(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st[0]);
r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st[0]);
expect(1, r);
r = SendMessage(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt[0]);
r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt[0]);
ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld\n", GDT_VALID, GDT_NONE, GDT_ERROR, r);
expect_systime(&refSt, &getSt[0]);
@ -733,14 +732,14 @@ static void test_wm_set_get_text(void)
hWnd = create_datetime_control(0);
ret = SendMessage(hWnd, WM_SETTEXT, 0, (LPARAM)a_str);
ret = SendMessageA(hWnd, WM_SETTEXT, 0, (LPARAM)a_str);
ok(CB_ERR == ret ||
broken(0 == ret) || /* comctl32 <= 4.72 */
broken(1 == ret), /* comctl32 <= 4.70 */
"Expected CB_ERR, got %ld\n", ret);
buff[0] = 0;
ret = SendMessage(hWnd, WM_GETTEXT, sizeof(buff), (LPARAM)buff);
ret = SendMessageA(hWnd, WM_GETTEXT, sizeof(buff), (LPARAM)buff);
ok(strcmp(buff, a_str) != 0, "Expected text to change, got %s\n", buff);
ok(ret != 0, "Expected non-zero return value\n");
@ -752,7 +751,7 @@ static void test_wm_set_get_text(void)
skip("DateTimePicker Control only supports Gregorian calendar (type: %s)\n", caltype);
else {
SetLastError(0xdeadbeef);
ret = GetDateFormat(LOCALE_USER_DEFAULT, 0, NULL, NULL, time, sizeof(time));
ret = GetDateFormatA(LOCALE_USER_DEFAULT, 0, NULL, NULL, time, sizeof(time));
if (ret == 0)
skip("GetDateFormat failed, returned %ld, error %d\n", ret, GetLastError());
else
@ -769,16 +768,16 @@ static void test_dts_shownone(void)
/* it isn't allowed to change DTS_SHOWNONE after creation */
hwnd = create_datetime_control(0);
style = GetWindowLong(hwnd, GWL_STYLE);
SetWindowLong(hwnd, GWL_STYLE, style | DTS_SHOWNONE);
style = GetWindowLong(hwnd, GWL_STYLE);
style = GetWindowLongA(hwnd, GWL_STYLE);
SetWindowLongA(hwnd, GWL_STYLE, style | DTS_SHOWNONE);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(!(style & DTS_SHOWNONE), "Expected DTS_SHOWNONE not to be set\n");
DestroyWindow(hwnd);
hwnd = create_datetime_control(DTS_SHOWNONE);
style = GetWindowLong(hwnd, GWL_STYLE);
SetWindowLong(hwnd, GWL_STYLE, style & ~DTS_SHOWNONE);
style = GetWindowLong(hwnd, GWL_STYLE);
style = GetWindowLongA(hwnd, GWL_STYLE);
SetWindowLongA(hwnd, GWL_STYLE, style & ~DTS_SHOWNONE);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(style & DTS_SHOWNONE, "Expected DTS_SHOWNONE to be set\n");
DestroyWindow(hwnd);
}

View File

@ -97,16 +97,16 @@ static const struct message add_header_to_parent_seq[] = {
};
static const struct message insertItem_seq[] = {
{ HDM_INSERTITEM, sent|wparam, 0 },
{ HDM_INSERTITEM, sent|wparam, 1 },
{ HDM_INSERTITEM, sent|wparam, 2 },
{ HDM_INSERTITEM, sent|wparam, 3 },
{ HDM_INSERTITEMA, sent|wparam, 0 },
{ HDM_INSERTITEMA, sent|wparam, 1 },
{ HDM_INSERTITEMA, sent|wparam, 2 },
{ HDM_INSERTITEMA, sent|wparam, 3 },
{ 0 }
};
static const struct message getItem_seq[] = {
{ HDM_GETITEM, sent|wparam, 3 },
{ HDM_GETITEM, sent|wparam, 0 },
{ HDM_GETITEMA, sent|wparam, 3 },
{ HDM_GETITEMA, sent|wparam, 0 },
{ 0 }
};
@ -128,8 +128,8 @@ static const struct message orderArray_seq[] = {
};
static const struct message setItem_seq[] = {
{ HDM_SETITEM, sent|wparam, 0 },
{ HDM_SETITEM, sent|wparam, 1 },
{ HDM_SETITEMA, sent|wparam, 0 },
{ HDM_SETITEMA, sent|wparam, 1 },
{ 0 }
};
@ -244,7 +244,7 @@ static LONG addItem(HWND hdex, int idx, LPSTR text)
hdItem.cxy = 100;
hdItem.pszText = text;
hdItem.cchTextMax = 0;
return SendMessage(hdex, HDM_INSERTITEMA, idx, (LPARAM)&hdItem);
return SendMessageA(hdex, HDM_INSERTITEMA, idx, (LPARAM)&hdItem);
}
static LONG setItem(HWND hdex, int idx, LPSTR text, BOOL fCheckNotifies)
@ -259,7 +259,7 @@ static LONG setItem(HWND hdex, int idx, LPSTR text, BOOL fCheckNotifies)
expect_notify(HDN_ITEMCHANGINGA, FALSE, &hdexItem);
expect_notify(HDN_ITEMCHANGEDA, FALSE, &hdexItem);
}
ret = SendMessage(hdex, HDM_SETITEMA, idx, (LPARAM)&hdexItem);
ret = SendMessageA(hdex, HDM_SETITEMA, idx, (LPARAM)&hdexItem);
if (fCheckNotifies)
ok(notifies_received(), "setItem(): not all expected notifies were received\n");
return ret;
@ -279,19 +279,19 @@ static LONG setItemUnicodeNotify(HWND hdex, int idx, LPSTR text, LPWSTR wText)
expect_notify(HDN_ITEMCHANGINGW, TRUE, (HDITEMA*)&hdexNotify);
expect_notify(HDN_ITEMCHANGEDW, TRUE, (HDITEMA*)&hdexNotify);
ret = SendMessage(hdex, HDM_SETITEMA, idx, (LPARAM)&hdexItem);
ret = SendMessageA(hdex, HDM_SETITEMA, idx, (LPARAM)&hdexItem);
ok(notifies_received(), "setItemUnicodeNotify(): not all expected notifies were received\n");
return ret;
}
static LONG delItem(HWND hdex, int idx)
{
return SendMessage(hdex, HDM_DELETEITEM, idx, 0);
return SendMessageA(hdex, HDM_DELETEITEM, idx, 0);
}
static LONG getItemCount(HWND hdex)
{
return SendMessage(hdex, HDM_GETITEMCOUNT, 0, 0);
return SendMessageA(hdex, HDM_GETITEMCOUNT, 0, 0);
}
static LONG getItem(HWND hdex, int idx, LPSTR textBuffer)
@ -300,16 +300,16 @@ static LONG getItem(HWND hdex, int idx, LPSTR textBuffer)
hdItem.mask = HDI_TEXT;
hdItem.pszText = textBuffer;
hdItem.cchTextMax = MAX_CHARS;
return SendMessage(hdex, HDM_GETITEMA, idx, (LPARAM)&hdItem);
return SendMessageA(hdex, HDM_GETITEMA, idx, (LPARAM)&hdItem);
}
static void addReadDelItem(HWND hdex, HDITEMA *phdiCreate, int maskRead, HDITEMA *phdiRead)
{
ok(SendMessage(hdex, HDM_INSERTITEMA, 0, (LPARAM)phdiCreate)!=-1, "Adding item failed\n");
ok(SendMessageA(hdex, HDM_INSERTITEMA, 0, (LPARAM)phdiCreate)!=-1, "Adding item failed\n");
ZeroMemory(phdiRead, sizeof(HDITEMA));
phdiRead->mask = maskRead;
ok(SendMessage(hdex, HDM_GETITEMA, 0, (LPARAM)phdiRead)!=0, "Getting item data failed\n");
ok(SendMessage(hdex, HDM_DELETEITEM, 0, 0)!=0, "Deleting item failed\n");
ok(SendMessageA(hdex, HDM_GETITEMA, 0, (LPARAM)phdiRead)!=0, "Getting item data failed\n");
ok(SendMessageA(hdex, HDM_DELETEITEM, 0, 0)!=0, "Deleting item failed\n");
}
static HWND create_header_control (void)
@ -319,10 +319,10 @@ static HWND create_header_control (void)
RECT rectwin;
WINDOWPOS winpos;
handle = CreateWindowEx(0, WC_HEADER, NULL,
WS_CHILD|WS_BORDER|WS_VISIBLE|HDS_BUTTONS|HDS_HORZ,
0, 0, 0, 0,
hHeaderParentWnd, NULL, NULL, NULL);
handle = CreateWindowExA(0, WC_HEADERA, NULL,
WS_CHILD|WS_BORDER|WS_VISIBLE|HDS_BUTTONS|HDS_HORZ,
0, 0, 0, 0,
hHeaderParentWnd, NULL, NULL, NULL);
assert(handle);
if (winetest_interactive)
@ -331,7 +331,7 @@ static HWND create_header_control (void)
GetClientRect(hHeaderParentWnd,&rectwin);
hlayout.prc = &rectwin;
hlayout.pwpos = &winpos;
SendMessageA(handle,HDM_LAYOUT,0,(LPARAM) &hlayout);
SendMessageA(handle, HDM_LAYOUT, 0, (LPARAM)&hlayout);
SetWindowPos(handle, winpos.hwndInsertAfter, winpos.x, winpos.y,
winpos.cx, winpos.cy, 0);
@ -490,16 +490,15 @@ static HWND create_custom_header_control(HWND hParent, BOOL preloadHeaderItems)
static char firstHeaderItem[] = "Name";
static char secondHeaderItem[] = "Size";
static char *items[] = {secondHeaderItem, firstHeaderItem};
HDITEM hdItem;
HDITEMA hdItem;
hdItem.mask = HDI_TEXT | HDI_WIDTH | HDI_FORMAT;
hdItem.fmt = HDF_LEFT;
hdItem.cxy = 80;
hdItem.cchTextMax = 260;
flush_sequences(sequences, NUM_MSG_SEQUENCES);
childHandle = CreateWindowEx(0, WC_HEADER, NULL,
childHandle = CreateWindowExA(0, WC_HEADERA, NULL,
WS_CHILD|WS_BORDER|WS_VISIBLE|HDS_BUTTONS|HDS_HORZ,
0, 0, 0, 0,
hParent, NULL, NULL, NULL);
@ -509,7 +508,7 @@ static HWND create_custom_header_control(HWND hParent, BOOL preloadHeaderItems)
for ( loopcnt = 0 ; loopcnt < 2 ; loopcnt++ )
{
hdItem.pszText = items[loopcnt];
retVal = SendMessage(childHandle, HDM_INSERTITEM, loopcnt, (LPARAM) &hdItem);
retVal = SendMessageA(childHandle, HDM_INSERTITEMA, loopcnt, (LPARAM) &hdItem);
ok(retVal == loopcnt, "Adding item %d failed with return value %d\n", ( loopcnt + 1 ), retVal);
}
}
@ -652,24 +651,24 @@ static void check_mask(void)
hdi.iOrder = 0;
hdi.lParam = 17;
hdi.cchTextMax = 260;
ret = SendMessage(hWndHeader, HDM_INSERTITEM, 0, (LPARAM)&hdi);
ret = SendMessageA(hWndHeader, HDM_INSERTITEMA, 0, (LPARAM)&hdi);
ok(ret == -1, "Creating an item with a zero mask should have failed\n");
if (ret != -1) SendMessage(hWndHeader, HDM_DELETEITEM, 0, 0);
if (ret != -1) SendMessageA(hWndHeader, HDM_DELETEITEM, 0, 0);
/* with a non-zero mask creation will succeed */
ZeroMemory(&hdi, sizeof(hdi));
hdi.mask = HDI_LPARAM;
ret = SendMessage(hWndHeader, HDM_INSERTITEM, 0, (LPARAM)&hdi);
ret = SendMessageA(hWndHeader, HDM_INSERTITEMA, 0, (LPARAM)&hdi);
ok(ret != -1, "Adding item with non-zero mask failed\n");
if (ret != -1)
SendMessage(hWndHeader, HDM_DELETEITEM, 0, 0);
SendMessageA(hWndHeader, HDM_DELETEITEM, 0, 0);
/* in SETITEM if the mask contains a unknown bit, it is ignored */
ZeroMemory(&hdi, sizeof(hdi));
hdi.mask = 0x08000000 | HDI_LPARAM | HDI_IMAGE;
hdi.lParam = 133;
hdi.iImage = 17;
ret = SendMessage(hWndHeader, HDM_INSERTITEM, 0, (LPARAM)&hdi);
ret = SendMessageA(hWndHeader, HDM_INSERTITEMA, 0, (LPARAM)&hdi);
ok(ret != -1, "Adding item failed\n");
if (ret != -1)
@ -677,18 +676,18 @@ static void check_mask(void)
/* check result */
ZeroMemory(&hdi, sizeof(hdi));
hdi.mask = HDI_LPARAM | HDI_IMAGE;
SendMessage(hWndHeader, HDM_GETITEM, 0, (LPARAM)&hdi);
SendMessageA(hWndHeader, HDM_GETITEMA, 0, (LPARAM)&hdi);
ok(hdi.lParam == 133, "comctl32 4.0 field not set\n");
ok(hdi.iImage == 17, "comctl32 >4.0 field not set\n");
/* but in GETITEM if an unknown bit is set, comctl32 uses only version 4.0 fields */
ZeroMemory(&hdi, sizeof(hdi));
hdi.mask = 0x08000000 | HDI_LPARAM | HDI_IMAGE;
SendMessage(hWndHeader, HDM_GETITEM, 0, (LPARAM)&hdi);
SendMessageA(hWndHeader, HDM_GETITEMA, 0, (LPARAM)&hdi);
ok(hdi.lParam == 133, "comctl32 4.0 field not read\n");
ok(hdi.iImage == 0, "comctl32 >4.0 field shouldn't be read\n");
SendMessage(hWndHeader, HDM_DELETEITEM, 0, 0);
SendMessageA(hWndHeader, HDM_DELETEITEM, 0, 0);
}
}
@ -804,7 +803,7 @@ static void test_hdm_getitemrect(HWND hParent)
ok_sequence(sequences, PARENT_SEQ_INDEX, add_header_to_parent_seq,
"adder header control to parent", FALSE);
retVal = SendMessage(hChild, HDM_GETITEMRECT, 1, (LPARAM) &rect);
retVal = SendMessageA(hChild, HDM_GETITEMRECT, 1, (LPARAM) &rect);
ok(retVal == TRUE, "Getting item rect should TRUE, got %d\n", retVal);
/* check bounding rectangle information of 2nd header item */
expect(80, rect.left);
@ -812,7 +811,7 @@ static void test_hdm_getitemrect(HWND hParent)
expect(160, rect.right);
expect(g_customheight, rect.bottom);
retVal = SendMessage(hChild, HDM_GETITEMRECT, 0, (LPARAM) &rect);
retVal = SendMessageA(hChild, HDM_GETITEMRECT, 0, (LPARAM) &rect);
ok(retVal == TRUE, "Getting item rect should TRUE, got %d\n", retVal);
/* check bounding rectangle information of 1st header item */
@ -822,7 +821,7 @@ static void test_hdm_getitemrect(HWND hParent)
expect(80, rect.right);
expect(g_customheight, rect.bottom);
retVal = SendMessage(hChild, HDM_GETITEMRECT, 10, (LPARAM) &rect);
retVal = SendMessageA(hChild, HDM_GETITEMRECT, 10, (LPARAM) &rect);
ok(retVal == 0, "Getting rect of nonexistent item should return 0, got %d\n", retVal);
ok_sequence(sequences, HEADER_SEQ_INDEX, getItemRect_seq, "getItemRect sequence testing", FALSE);
@ -845,7 +844,7 @@ static void test_hdm_layout(HWND hParent)
"adder header control to parent", FALSE);
flush_sequences(sequences, NUM_MSG_SEQUENCES);
retVal = SendMessage(hChild, HDM_LAYOUT, 0, (LPARAM) &hdLayout);
retVal = SendMessageA(hChild, HDM_LAYOUT, 0, (LPARAM) &hdLayout);
expect(TRUE, retVal);
ok_sequence(sequences, HEADER_SEQ_INDEX, layout_seq, "layout sequence testing", FALSE);
@ -864,7 +863,7 @@ static void test_hdm_ordertoindex(HWND hParent)
"adder header control to parent", FALSE);
flush_sequences(sequences, NUM_MSG_SEQUENCES);
retVal = SendMessage(hChild, HDM_ORDERTOINDEX, 1, 0);
retVal = SendMessageA(hChild, HDM_ORDERTOINDEX, 1, 0);
expect(1, retVal);
ok_sequence(sequences, HEADER_SEQ_INDEX, orderToIndex_seq, "orderToIndex sequence testing", FALSE);
@ -892,7 +891,7 @@ static void test_hdm_hittest(HWND hParent)
"adder header control to parent", FALSE);
flush_sequences(sequences, NUM_MSG_SEQUENCES);
retVal = SendMessage(hChild, HDM_HITTEST, 0, (LPARAM) &hdHitTestInfo);
retVal = SendMessageA(hChild, HDM_HITTEST, 0, (LPARAM) &hdHitTestInfo);
expect(0, retVal);
expect(0, hdHitTestInfo.iItem);
expect(HHT_ONDIVIDER, hdHitTestInfo.flags);
@ -900,7 +899,7 @@ static void test_hdm_hittest(HWND hParent)
pt.x = secondItemRightBoundary - 1;
pt.y = bottomBoundary - 1;
hdHitTestInfo.pt = pt;
retVal = SendMessage(hChild, HDM_HITTEST, 1, (LPARAM) &hdHitTestInfo);
retVal = SendMessageA(hChild, HDM_HITTEST, 1, (LPARAM) &hdHitTestInfo);
expect(1, retVal);
expect(1, hdHitTestInfo.iItem);
expect(HHT_ONDIVIDER, hdHitTestInfo.flags);
@ -908,7 +907,7 @@ static void test_hdm_hittest(HWND hParent)
pt.x = secondItemRightBoundary;
pt.y = bottomBoundary + 1;
hdHitTestInfo.pt = pt;
retVal = SendMessage(hChild, HDM_HITTEST, 0, (LPARAM) &hdHitTestInfo);
retVal = SendMessageA(hChild, HDM_HITTEST, 0, (LPARAM) &hdHitTestInfo);
expect(-1, retVal);
expect(-1, hdHitTestInfo.iItem);
expect(HHT_BELOW, hdHitTestInfo.flags);
@ -932,12 +931,12 @@ static void test_hdm_sethotdivider(HWND hParent)
"adder header control to parent", FALSE);
flush_sequences(sequences, NUM_MSG_SEQUENCES);
retVal = SendMessage(hChild, HDM_SETHOTDIVIDER, TRUE, MAKELPARAM(5, 5));
retVal = SendMessageA(hChild, HDM_SETHOTDIVIDER, TRUE, MAKELPARAM(5, 5));
expect(0, retVal);
retVal = SendMessage(hChild, HDM_SETHOTDIVIDER, FALSE, 100);
retVal = SendMessageA(hChild, HDM_SETHOTDIVIDER, FALSE, 100);
expect(100, retVal);
retVal = SendMessage(hChild, HDM_SETHOTDIVIDER, FALSE, 1);
retVal = SendMessageA(hChild, HDM_SETHOTDIVIDER, FALSE, 1);
expect(1, retVal);
if (winetest_interactive)
ok_sequence(sequences, HEADER_SEQ_INDEX, setHotDivider_seq_interactive,
@ -963,13 +962,13 @@ static void test_hdm_imageMessages(HWND hParent)
flush_sequences(sequences, NUM_MSG_SEQUENCES);
hIml = (HIMAGELIST) SendMessage(hChild, HDM_SETIMAGELIST, 0, (LPARAM) hImageList);
hIml = (HIMAGELIST) SendMessageA(hChild, HDM_SETIMAGELIST, 0, (LPARAM) hImageList);
ok(hIml == NULL, "Expected NULL, got %p\n", hIml);
hIml = (HIMAGELIST) SendMessage(hChild, HDM_GETIMAGELIST, 0, 0);
hIml = (HIMAGELIST) SendMessageA(hChild, HDM_GETIMAGELIST, 0, 0);
ok(hIml != NULL, "Expected non-NULL handle, got %p\n", hIml);
hIml = (HIMAGELIST) SendMessage(hChild, HDM_CREATEDRAGIMAGE, 0, 0);
hIml = (HIMAGELIST) SendMessageA(hChild, HDM_CREATEDRAGIMAGE, 0, 0);
ok(hIml != NULL, "Expected non-NULL handle, got %p\n", hIml);
ImageList_Destroy(hIml);
@ -992,8 +991,8 @@ static void test_hdm_filterMessages(HWND hParent)
ok_sequence(sequences, PARENT_SEQ_INDEX, add_header_to_parent_seq,
"adder header control to parent", FALSE);
timeout = SendMessage(hChild, HDM_SETFILTERCHANGETIMEOUT, 1, 100);
SendMessage(hChild, HDM_SETFILTERCHANGETIMEOUT, 1, timeout);
timeout = SendMessageA(hChild, HDM_SETFILTERCHANGETIMEOUT, 1, 100);
SendMessageA(hChild, HDM_SETFILTERCHANGETIMEOUT, 1, timeout);
flush_sequences(sequences, NUM_MSG_SEQUENCES);
@ -1003,18 +1002,18 @@ static void test_hdm_filterMessages(HWND hParent)
* return previous filter timeout value
*/
retVal = SendMessage(hChild, HDM_SETFILTERCHANGETIMEOUT, 1, 100);
retVal = SendMessageA(hChild, HDM_SETFILTERCHANGETIMEOUT, 1, 100);
expect(timeout, retVal);
todo_wine
{
retVal = SendMessage(hChild, HDM_CLEARFILTER, 0, 1);
retVal = SendMessageA(hChild, HDM_CLEARFILTER, 0, 1);
if (retVal == 0)
win_skip("HDM_CLEARFILTER needs 5.80\n");
else
expect(1, retVal);
retVal = SendMessage(hChild, HDM_EDITFILTER, 1, 0);
retVal = SendMessageA(hChild, HDM_EDITFILTER, 1, 0);
if (retVal == 0)
win_skip("HDM_EDITFILTER needs 5.80\n");
else
@ -1041,9 +1040,9 @@ static void test_hdm_unicodeformatMessages(HWND hParent)
"adder header control to parent", FALSE);
flush_sequences(sequences, NUM_MSG_SEQUENCES);
retVal = SendMessage(hChild, HDM_SETUNICODEFORMAT, TRUE, 0);
retVal = SendMessageA(hChild, HDM_SETUNICODEFORMAT, TRUE, 0);
expect(0, retVal);
retVal = SendMessage(hChild, HDM_GETUNICODEFORMAT, 0, 0);
retVal = SendMessageA(hChild, HDM_GETUNICODEFORMAT, 0, 0);
expect(1, retVal);
ok_sequence(sequences, HEADER_SEQ_INDEX, unicodeformatMessages_seq,
@ -1062,7 +1061,7 @@ static void test_hdm_bitmapmarginMessages(HWND hParent)
"adder header control to parent", FALSE);
flush_sequences(sequences, NUM_MSG_SEQUENCES);
retVal = SendMessage(hChild, HDM_GETBITMAPMARGIN, 0, 0);
retVal = SendMessageA(hChild, HDM_GETBITMAPMARGIN, 0, 0);
if (retVal == 0)
win_skip("HDM_GETBITMAPMARGIN needs 5.80\n");
else
@ -1088,7 +1087,7 @@ static void test_hdm_index_messages(HWND hParent)
static char fourthHeaderItem[] = "Date Modified";
static char *items[] = {firstHeaderItem, secondHeaderItem, thirdHeaderItem, fourthHeaderItem};
RECT rect;
HDITEM hdItem;
HDITEMA hdItem;
hdItem.mask = HDI_TEXT | HDI_WIDTH | HDI_FORMAT;
hdItem.fmt = HDF_LEFT;
hdItem.cxy = 80;
@ -1106,26 +1105,26 @@ static void test_hdm_index_messages(HWND hParent)
for ( loopcnt = 0 ; loopcnt < 4 ; loopcnt++ )
{
hdItem.pszText = items[loopcnt];
retVal = SendMessage(hChild, HDM_INSERTITEM, loopcnt, (LPARAM) &hdItem);
retVal = SendMessageA(hChild, HDM_INSERTITEMA, loopcnt, (LPARAM) &hdItem);
ok(retVal == loopcnt, "Adding item %d failed with return value %d\n", ( loopcnt + 1 ), retVal);
}
ok_sequence(sequences, HEADER_SEQ_INDEX, insertItem_seq, "insertItem sequence testing", FALSE);
flush_sequences(sequences, NUM_MSG_SEQUENCES);
retVal = SendMessage(hChild, HDM_DELETEITEM, 3, (LPARAM) &hdItem);
retVal = SendMessageA(hChild, HDM_DELETEITEM, 3, (LPARAM) &hdItem);
ok(retVal == TRUE, "Deleting item 3 should return TRUE, got %d\n", retVal);
retVal = SendMessage(hChild, HDM_GETITEMCOUNT, 0, 0);
retVal = SendMessageA(hChild, HDM_GETITEMCOUNT, 0, 0);
ok(retVal == 3, "Getting item count should return 3, got %d\n", retVal);
retVal = SendMessage(hChild, HDM_DELETEITEM, 3, (LPARAM) &hdItem);
retVal = SendMessageA(hChild, HDM_DELETEITEM, 3, (LPARAM) &hdItem);
ok(retVal == FALSE, "Deleting already-deleted item should return FALSE, got %d\n", retVal);
retVal = SendMessage(hChild, HDM_GETITEMCOUNT, 0, 0);
retVal = SendMessageA(hChild, HDM_GETITEMCOUNT, 0, 0);
ok(retVal == 3, "Getting item count should return 3, got %d\n", retVal);
retVal = SendMessage(hChild, HDM_DELETEITEM, 2, (LPARAM) &hdItem);
retVal = SendMessageA(hChild, HDM_DELETEITEM, 2, (LPARAM) &hdItem);
ok(retVal == TRUE, "Deleting item 2 should return TRUE, got %d\n", retVal);
retVal = SendMessage(hChild, HDM_GETITEMCOUNT, 0, 0);
retVal = SendMessageA(hChild, HDM_GETITEMCOUNT, 0, 0);
ok(retVal == 2, "Getting item count should return 2, got %d\n", retVal);
ok_sequence(sequences, HEADER_SEQ_INDEX, deleteItem_getItemCount_seq,
@ -1133,10 +1132,10 @@ static void test_hdm_index_messages(HWND hParent)
flush_sequences(sequences, NUM_MSG_SEQUENCES);
retVal = SendMessage(hChild, HDM_GETITEM, 3, (LPARAM) &hdItem);
retVal = SendMessageA(hChild, HDM_GETITEMA, 3, (LPARAM) &hdItem);
ok(retVal == FALSE, "Getting already-deleted item should return FALSE, got %d\n", retVal);
retVal = SendMessage(hChild, HDM_GETITEM, 0, (LPARAM) &hdItem);
retVal = SendMessageA(hChild, HDM_GETITEMA, 0, (LPARAM) &hdItem);
ok(retVal == TRUE, "Getting the 1st header item should return TRUE, got %d\n", retVal);
ok_sequence(sequences, HEADER_SEQ_INDEX, getItem_seq, "getItem sequence testing", FALSE);
@ -1146,23 +1145,23 @@ static void test_hdm_index_messages(HWND hParent)
expect(0, strcmpResult);
expect(80, hdItem.cxy);
iSize = SendMessage(hChild, HDM_GETITEMCOUNT, 0, 0);
iSize = SendMessageA(hChild, HDM_GETITEMCOUNT, 0, 0);
/* item should be updated just after accepting new array */
ShowWindow(hChild, SW_HIDE);
retVal = SendMessage(hChild, HDM_SETORDERARRAY, iSize, (LPARAM) lpiarray);
retVal = SendMessageA(hChild, HDM_SETORDERARRAY, iSize, (LPARAM) lpiarray);
expect(TRUE, retVal);
rect.left = 0;
retVal = SendMessage(hChild, HDM_GETITEMRECT, 0, (LPARAM) &rect);
retVal = SendMessageA(hChild, HDM_GETITEMRECT, 0, (LPARAM) &rect);
expect(TRUE, retVal);
ok(rect.left != 0, "Expected updated rectangle\n");
flush_sequences(sequences, NUM_MSG_SEQUENCES);
retVal = SendMessage(hChild, HDM_SETORDERARRAY, iSize, (LPARAM) lpiarray);
retVal = SendMessageA(hChild, HDM_SETORDERARRAY, iSize, (LPARAM) lpiarray);
ok(retVal == TRUE, "Setting header items order should return TRUE, got %d\n", retVal);
retVal = SendMessage(hChild, HDM_GETORDERARRAY, iSize, (LPARAM) lpiarrayReceived);
retVal = SendMessageA(hChild, HDM_GETORDERARRAY, iSize, (LPARAM) lpiarrayReceived);
ok(retVal == TRUE, "Getting header items order should return TRUE, got %d\n", retVal);
ok_sequence(sequences, HEADER_SEQ_INDEX, orderArray_seq, "set_get_orderArray sequence testing", FALSE);
@ -1177,10 +1176,10 @@ static void test_hdm_index_messages(HWND hParent)
flush_sequences(sequences, NUM_MSG_SEQUENCES);
retVal = SendMessage(hChild, HDM_SETITEM, 0, (LPARAM) &hdItem);
retVal = SendMessageA(hChild, HDM_SETITEMA, 0, (LPARAM) &hdItem);
ok(retVal == TRUE, "Aligning 1st header item to center should return TRUE, got %d\n", retVal);
hdItem.fmt = HDF_RIGHT | HDF_STRING;
retVal = SendMessage(hChild, HDM_SETITEM, 1, (LPARAM) &hdItem);
retVal = SendMessageA(hChild, HDM_SETITEMA, 1, (LPARAM) &hdItem);
ok(retVal == TRUE, "Aligning 2nd header item to right should return TRUE, got %d\n", retVal);
ok_sequence(sequences, HEADER_SEQ_INDEX, setItem_seq, "setItem sequence testing", FALSE);
@ -1190,7 +1189,7 @@ static void test_hdm_index_messages(HWND hParent)
static void test_hdf_fixedwidth(HWND hParent)
{
HWND hChild;
HDITEM hdItem;
HDITEMA hdItem;
DWORD ret;
RECT rect;
HDHITTESTINFO ht;
@ -1201,20 +1200,20 @@ static void test_hdf_fixedwidth(HWND hParent)
hdItem.fmt = HDF_FIXEDWIDTH;
hdItem.cxy = 80;
ret = SendMessage(hChild, HDM_INSERTITEM, 0, (LPARAM)&hdItem);
ret = SendMessageA(hChild, HDM_INSERTITEMA, 0, (LPARAM)&hdItem);
expect(0, ret);
/* try to change width */
rect.right = rect.bottom = 0;
SendMessage(hChild, HDM_GETITEMRECT, 0, (LPARAM)&rect);
SendMessageA(hChild, HDM_GETITEMRECT, 0, (LPARAM)&rect);
ok(rect.right != 0, "Expected not zero width\n");
ok(rect.bottom != 0, "Expected not zero height\n");
SendMessage(hChild, WM_LBUTTONDOWN, 0, MAKELPARAM(rect.right, rect.bottom / 2));
SendMessage(hChild, WM_MOUSEMOVE, 0, MAKELPARAM(rect.right + 20, rect.bottom / 2));
SendMessage(hChild, WM_LBUTTONUP, 0, MAKELPARAM(rect.right + 20, rect.bottom / 2));
SendMessageA(hChild, WM_LBUTTONDOWN, 0, MAKELPARAM(rect.right, rect.bottom / 2));
SendMessageA(hChild, WM_MOUSEMOVE, 0, MAKELPARAM(rect.right + 20, rect.bottom / 2));
SendMessageA(hChild, WM_LBUTTONUP, 0, MAKELPARAM(rect.right + 20, rect.bottom / 2));
SendMessage(hChild, HDM_GETITEMRECT, 0, (LPARAM)&rect);
SendMessageA(hChild, HDM_GETITEMRECT, 0, (LPARAM)&rect);
if (hdItem.cxy != rect.right)
{
@ -1227,29 +1226,29 @@ static void test_hdf_fixedwidth(HWND hParent)
hdItem.mask = HDI_WIDTH;
hdItem.cxy = 90;
ret = SendMessage(hChild, HDM_SETITEM, 0, (LPARAM)&hdItem);
ret = SendMessageA(hChild, HDM_SETITEMA, 0, (LPARAM)&hdItem);
expect(TRUE, ret);
rect.right = 0;
SendMessage(hChild, HDM_GETITEMRECT, 0, (LPARAM)&rect);
SendMessageA(hChild, HDM_GETITEMRECT, 0, (LPARAM)&rect);
expect(90, rect.right);
/* hittesting doesn't report ondivider flag for HDF_FIXEDWIDTH */
ht.pt.x = rect.right - 1;
ht.pt.y = rect.bottom / 2;
SendMessage(hChild, HDM_HITTEST, 0, (LPARAM)&ht);
SendMessageA(hChild, HDM_HITTEST, 0, (LPARAM)&ht);
expect(HHT_ONHEADER, ht.flags);
/* try to adjust with message */
hdItem.mask = HDI_FORMAT;
hdItem.fmt = 0;
ret = SendMessage(hChild, HDM_SETITEM, 0, (LPARAM)&hdItem);
ret = SendMessageA(hChild, HDM_SETITEMA, 0, (LPARAM)&hdItem);
expect(TRUE, ret);
ht.pt.x = 90;
ht.pt.y = rect.bottom / 2;
SendMessage(hChild, HDM_HITTEST, 0, (LPARAM)&ht);
SendMessageA(hChild, HDM_HITTEST, 0, (LPARAM)&ht);
expect(HHT_ONDIVIDER, ht.flags);
DestroyWindow(hChild);
@ -1258,7 +1257,7 @@ static void test_hdf_fixedwidth(HWND hParent)
static void test_hds_nosizing(HWND hParent)
{
HWND hChild;
HDITEM hdItem;
HDITEMA hdItem;
DWORD ret;
RECT rect;
HDHITTESTINFO ht;
@ -1269,24 +1268,24 @@ static void test_hds_nosizing(HWND hParent)
hdItem.mask = HDI_WIDTH;
hdItem.cxy = 80;
ret = SendMessage(hChild, HDM_INSERTITEM, 0, (LPARAM)&hdItem);
ret = SendMessageA(hChild, HDM_INSERTITEMA, 0, (LPARAM)&hdItem);
expect(0, ret);
/* HDS_NOSIZING only blocks hittesting */
ret = GetWindowLong(hChild, GWL_STYLE);
SetWindowLong(hChild, GWL_STYLE, ret | HDS_NOSIZING);
ret = GetWindowLongA(hChild, GWL_STYLE);
SetWindowLongA(hChild, GWL_STYLE, ret | HDS_NOSIZING);
/* try to change width with mouse gestures */
rect.right = rect.bottom = 0;
SendMessage(hChild, HDM_GETITEMRECT, 0, (LPARAM)&rect);
SendMessageA(hChild, HDM_GETITEMRECT, 0, (LPARAM)&rect);
ok(rect.right != 0, "Expected not zero width\n");
ok(rect.bottom != 0, "Expected not zero height\n");
SendMessage(hChild, WM_LBUTTONDOWN, 0, MAKELPARAM(rect.right, rect.bottom / 2));
SendMessage(hChild, WM_MOUSEMOVE, 0, MAKELPARAM(rect.right + 20, rect.bottom / 2));
SendMessage(hChild, WM_LBUTTONUP, 0, MAKELPARAM(rect.right + 20, rect.bottom / 2));
SendMessageA(hChild, WM_LBUTTONDOWN, 0, MAKELPARAM(rect.right, rect.bottom / 2));
SendMessageA(hChild, WM_MOUSEMOVE, 0, MAKELPARAM(rect.right + 20, rect.bottom / 2));
SendMessageA(hChild, WM_LBUTTONUP, 0, MAKELPARAM(rect.right + 20, rect.bottom / 2));
SendMessage(hChild, HDM_GETITEMRECT, 0, (LPARAM)&rect);
SendMessageA(hChild, HDM_GETITEMRECT, 0, (LPARAM)&rect);
if (hdItem.cxy != rect.right)
{
@ -1297,7 +1296,7 @@ static void test_hds_nosizing(HWND hParent)
/* this style doesn't set HDF_FIXEDWIDTH for items */
hdItem.mask = HDI_FORMAT;
ret = SendMessage(hChild, HDM_GETITEM, 0, (LPARAM)&hdItem);
ret = SendMessageA(hChild, HDM_GETITEMA, 0, (LPARAM)&hdItem);
expect(TRUE, ret);
ok(!(hdItem.fmt & HDF_FIXEDWIDTH), "Unexpected HDF_FIXEDWIDTH\n");
@ -1305,26 +1304,26 @@ static void test_hds_nosizing(HWND hParent)
hdItem.mask = HDI_WIDTH;
hdItem.cxy = 90;
ret = SendMessage(hChild, HDM_SETITEM, 0, (LPARAM)&hdItem);
ret = SendMessageA(hChild, HDM_SETITEMA, 0, (LPARAM)&hdItem);
expect(TRUE, ret);
rect.right = 0;
SendMessage(hChild, HDM_GETITEMRECT, 0, (LPARAM)&rect);
SendMessageA(hChild, HDM_GETITEMRECT, 0, (LPARAM)&rect);
expect(90, rect.right);
/* hittesting doesn't report ondivider flags for HDS_NOSIZING */
ht.pt.x = rect.right - 1;
ht.pt.y = rect.bottom / 2;
SendMessage(hChild, HDM_HITTEST, 0, (LPARAM)&ht);
SendMessageA(hChild, HDM_HITTEST, 0, (LPARAM)&ht);
expect(HHT_ONHEADER, ht.flags);
/* try to adjust with message */
ret = GetWindowLong(hChild, GWL_STYLE);
SetWindowLong(hChild, GWL_STYLE, ret & ~HDS_NOSIZING);
ret = GetWindowLongA(hChild, GWL_STYLE);
SetWindowLongA(hChild, GWL_STYLE, ret & ~HDS_NOSIZING);
ht.pt.x = 90;
ht.pt.y = rect.bottom / 2;
SendMessage(hChild, HDM_HITTEST, 0, (LPARAM)&ht);
SendMessageA(hChild, HDM_HITTEST, 0, (LPARAM)&ht);
expect(HHT_ONDIVIDER, ht.flags);
DestroyWindow(hChild);
@ -1457,7 +1456,7 @@ static void run_customdraw_scenario(CUSTOMDRAWPROC proc)
static void test_customdraw(void)
{
int i;
HDITEM item;
HDITEMA item;
RECT rect;
CHAR name[] = "Test";
hWndHeader = create_header_control();
@ -1473,7 +1472,7 @@ static void test_customdraw(void)
item.cxy = 50*(i+1);
item.pszText = name;
item.lParam = i*5;
SendMessage(hWndHeader, HDM_INSERTITEM, i, (LPARAM)&item);
SendMessageA(hWndHeader, HDM_INSERTITEMA, i, (LPARAM)&item);
}
run_customdraw_scenario(customdraw_1);
@ -1483,13 +1482,13 @@ static void test_customdraw(void)
ZeroMemory(&item, sizeof(item));
item.mask = HDI_FORMAT;
item.fmt = HDF_OWNERDRAW;
SendMessage(hWndHeader, HDM_SETITEM, 1, (LPARAM)&item);
SendMessageA(hWndHeader, HDM_SETITEMA, 1, (LPARAM)&item);
g_DrawItem.CtlID = 0;
g_DrawItem.CtlType = ODT_HEADER;
g_DrawItem.hwndItem = hWndHeader;
g_DrawItem.itemID = 1;
g_DrawItem.itemState = 0;
SendMessage(hWndHeader, HDM_GETITEMRECT, 1, (LPARAM)&g_DrawItem.rcItem);
SendMessageA(hWndHeader, HDM_GETITEMRECT, 1, (LPARAM)&g_DrawItem.rcItem);
run_customdraw_scenario(customdraw_4);
ok(g_DrawItemReceived, "WM_DRAWITEM not received\n");
DestroyWindow(hWndHeader);
@ -1508,7 +1507,7 @@ static void check_order(const int expected_id[], const int expected_order[],
for (i = 0; i < count; i++)
{
hdi.mask = HDI_LPARAM|HDI_ORDER;
SendMessage(hWndHeader, HDM_GETITEMA, i, (LPARAM)&hdi);
SendMessageA(hWndHeader, HDM_GETITEMA, i, (LPARAM)&hdi);
ok(hdi.lParam == expected_id[i],
"Invalid item ids after '%s'- item %d has lParam %d\n", type, i, (int)hdi.lParam);
ok(hdi.iOrder == expected_order[i],
@ -1547,7 +1546,7 @@ static void test_header_order (void)
for (i = 0; i < 5; i++)
{
hdi.lParam = i;
SendMessage(hWndHeader, HDM_INSERTITEMA, rand1[i], (LPARAM)&hdi);
SendMessageA(hWndHeader, HDM_INSERTITEMA, rand1[i], (LPARAM)&hdi);
rand();
}
check_order(ids1, ord1, 5, "insert without iOrder");
@ -1557,7 +1556,7 @@ static void test_header_order (void)
{
hdi.lParam = i + 5;
hdi.iOrder = rand2[i];
SendMessage(hWndHeader, HDM_INSERTITEMA, rand3[i], (LPARAM)&hdi);
SendMessageA(hWndHeader, HDM_INSERTITEMA, rand3[i], (LPARAM)&hdi);
rand(); rand();
}
check_order(ids2, ord2, 10, "insert with order");
@ -1566,13 +1565,13 @@ static void test_header_order (void)
for (i=0; i<10; i++)
{
hdi.iOrder = rand5[i];
SendMessage(hWndHeader, HDM_SETITEMA, rand4[i], (LPARAM)&hdi);
SendMessageA(hWndHeader, HDM_SETITEMA, rand4[i], (LPARAM)&hdi);
rand(); rand();
}
check_order(ids2, ord3, 10, "setitems changing order");
for (i=0; i<5; i++)
SendMessage(hWndHeader, HDM_DELETEITEM, rand6[i], 0);
SendMessageA(hWndHeader, HDM_DELETEITEM, rand6[i], 0);
check_order(ids4, ord4, 5, "deleteitem");
DestroyWindow(hWndHeader);
@ -1585,7 +1584,7 @@ static LRESULT CALLBACK HeaderTestWndProc(HWND hWnd, UINT msg, WPARAM wParam, LP
case WM_NOTIFY:
{
NMHEADERA *hdr = (NMHEADER *)lParam;
NMHEADERA *hdr = (NMHEADERA*)lParam;
EXPECTEDNOTIFY *expected;
int i;
@ -1697,23 +1696,23 @@ static void check_orderarray(HWND hwnd, DWORD start, DWORD set, DWORD expected,
INT order[8];
DWORD ret, array = 0;
count = SendMessage(hwnd, HDM_GETITEMCOUNT, 0, 0);
count = SendMessageA(hwnd, HDM_GETITEMCOUNT, 0, 0);
/* initial order */
for(i = 1; i<=count; i++)
order[i-1] = start>>(4*(count-i)) & 0xf;
ret = SendMessage(hwnd, HDM_SETORDERARRAY, count, (LPARAM)order);
ret = SendMessageA(hwnd, HDM_SETORDERARRAY, count, (LPARAM)order);
ok_(__FILE__, line)(ret, "Expected HDM_SETORDERARAY to succeed, got %d\n", ret);
/* new order */
for(i = 1; i<=count; i++)
order[i-1] = set>>(4*(count-i)) & 0xf;
ret = SendMessage(hwnd, HDM_SETORDERARRAY, count, (LPARAM)order);
ret = SendMessageA(hwnd, HDM_SETORDERARRAY, count, (LPARAM)order);
ok_(__FILE__, line)(ret, "Expected HDM_SETORDERARAY to succeed, got %d\n", ret);
/* check actual order */
ret = SendMessage(hwnd, HDM_GETORDERARRAY, count, (LPARAM)order);
ret = SendMessageA(hwnd, HDM_GETORDERARRAY, count, (LPARAM)order);
ok_(__FILE__, line)(ret, "Expected HDM_GETORDERARAY to succeed, got %d\n", ret);
for(i = 1; i<=count; i++)
array |= order[i-1]<<(4*(count-i));
@ -1739,7 +1738,7 @@ static void test_hdm_orderarray(void)
addItem(hwnd, 1, NULL);
addItem(hwnd, 2, NULL);
ret = SendMessage(hwnd, HDM_GETORDERARRAY, 3, (LPARAM)order);
ret = SendMessageA(hwnd, HDM_GETORDERARRAY, 3, (LPARAM)order);
if (!ret)
{
win_skip("HDM_GETORDERARRAY not implemented.\n");
@ -1754,14 +1753,14 @@ static void test_hdm_orderarray(void)
if (0)
{
/* null pointer, crashes native */
ret = SendMessage(hwnd, HDM_SETORDERARRAY, 3, 0);
ret = SendMessageA(hwnd, HDM_SETORDERARRAY, 3, 0);
expect(FALSE, ret);
}
/* count out of limits */
ret = SendMessage(hwnd, HDM_SETORDERARRAY, 5, (LPARAM)order);
ret = SendMessageA(hwnd, HDM_SETORDERARRAY, 5, (LPARAM)order);
expect(FALSE, ret);
/* count out of limits */
ret = SendMessage(hwnd, HDM_SETORDERARRAY, 2, (LPARAM)order);
ret = SendMessageA(hwnd, HDM_SETORDERARRAY, 2, (LPARAM)order);
expect(FALSE, ret);
/* try with out of range item index */

View File

@ -867,7 +867,7 @@ static HBITMAP create_bitmap(INT cx, INT cy, COLORREF color, const char *comment
FillRect(hdc, &rc, hbrush);
DeleteObject(hbrush);
DrawText(hdc, comment, -1, &rc, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
DrawTextA(hdc, comment, -1, &rc, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
SelectObject(hdc, hbmp_old);
DeleteDC(hdc);
@ -2064,7 +2064,7 @@ START_TEST(imagelist)
ULONG_PTR ctx_cookie;
HANDLE hCtx;
HMODULE hComCtl32 = GetModuleHandle("comctl32.dll");
HMODULE hComCtl32 = GetModuleHandleA("comctl32.dll");
pImageList_Create = NULL; /* These are not needed for non-v6.0 tests*/
pImageList_Add = NULL;
pImageList_DrawIndirect = (void*)GetProcAddress(hComCtl32, "ImageList_DrawIndirect");

View File

@ -29,9 +29,9 @@ static HWND create_ipaddress_control (void)
{
HWND handle;
handle = CreateWindowEx(0, WC_IPADDRESS, NULL,
WS_BORDER|WS_VISIBLE, 0, 0, 0, 0,
NULL, NULL, NULL, NULL);
handle = CreateWindowExA(0, WC_IPADDRESSA, NULL,
WS_BORDER|WS_VISIBLE, 0, 0, 0, 0,
NULL, NULL, NULL, NULL);
return handle;
}
@ -49,12 +49,12 @@ static void test_get_set_text(void)
}
/* check text just after creation */
r = GetWindowText(hwnd, ip, sizeof(ip)/sizeof(CHAR));
r = GetWindowTextA(hwnd, ip, sizeof(ip)/sizeof(CHAR));
expect(7, r);
ok(strcmp(ip, "0.0.0.0") == 0, "Expected null IP address, got %s\n", ip);
SendMessage(hwnd, IPM_SETADDRESS, 0, MAKEIPADDRESS(127, 0, 0, 1));
r = GetWindowText(hwnd, ip, sizeof(ip)/sizeof(CHAR));
SendMessageA(hwnd, IPM_SETADDRESS, 0, MAKEIPADDRESS(127, 0, 0, 1));
r = GetWindowTextA(hwnd, ip, sizeof(ip)/sizeof(CHAR));
expect(9, r);
ok(strcmp(ip, "127.0.0.1") == 0, "Expected 127.0.0.1, got %s\n", ip);

File diff suppressed because it is too large Load Diff

View File

@ -102,8 +102,8 @@ static void test_GetPtrAW(void)
ok (count == sourcelen ||
broken(count == 0), /* win9x */
"Expected count to be %d, it was %d\n", sourcelen, count);
ok (!lstrcmp(dest, desttest) ||
broken(!lstrcmp(dest, "")), /* Win7 */
ok (!lstrcmpA(dest, desttest) ||
broken(!lstrcmpA(dest, "")), /* Win7 */
"Expected destination to not have changed\n");
count = pStr_GetPtrA(source, NULL, destsize);
@ -115,7 +115,7 @@ static void test_GetPtrAW(void)
ok (count == sourcelen ||
broken(count == sourcelen - 1), /* win9x */
"Expected count to be %d, it was %d\n", sourcelen, count);
ok (!lstrcmp(source, dest), "Expected source and destination to be the same\n");
ok (!lstrcmpA(source, dest), "Expected source and destination to be the same\n");
strcpy(dest, desttest);
count = pStr_GetPtrA(NULL, dest, destsize);