Author: jimtabor
Date: Sun Oct 27 23:22:00 2013
New Revision: 60780
URL:
http://svn.reactos.org/svn/reactos?rev=60780&view=rev
Log:
- Sync wine to 1.7.5.
Modified:
trunk/rostests/winetests/user32/listbox.c
Modified: trunk/rostests/winetests/user32/listbox.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/listbox.…
==============================================================================
--- trunk/rostests/winetests/user32/listbox.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/user32/listbox.c [iso-8859-1] Sun Oct 27 23:22:00 2013
@@ -53,16 +53,16 @@
INT_PTR ctl_id=0;
if (parent)
ctl_id=1;
- handle=CreateWindow ("LISTBOX", "TestList",
+ handle=CreateWindowA("LISTBOX", "TestList",
(LBS_STANDARD & ~LBS_SORT) | add_style,
0, 0, 100, 100,
parent, (HMENU)ctl_id, NULL, 0);
assert (handle);
- SendMessage (handle, LB_ADDSTRING, 0, (LPARAM) strings[0]);
- SendMessage (handle, LB_ADDSTRING, 0, (LPARAM) strings[1]);
- SendMessage (handle, LB_ADDSTRING, 0, (LPARAM) strings[2]);
- SendMessage (handle, LB_ADDSTRING, 0, (LPARAM) strings[3]);
+ SendMessageA(handle, LB_ADDSTRING, 0, (LPARAM) strings[0]);
+ SendMessageA(handle, LB_ADDSTRING, 0, (LPARAM) strings[1]);
+ SendMessageA(handle, LB_ADDSTRING, 0, (LPARAM) strings[2]);
+ SendMessageA(handle, LB_ADDSTRING, 0, (LPARAM) strings[3]);
#ifdef VISIBLE
ShowWindow (handle, SW_SHOW);
@@ -91,10 +91,10 @@
static void
listbox_query (HWND handle, struct listbox_stat *results)
{
- results->selected = SendMessage (handle, LB_GETCURSEL, 0, 0);
- results->anchor = SendMessage (handle, LB_GETANCHORINDEX, 0, 0);
- results->caret = SendMessage (handle, LB_GETCARETINDEX, 0, 0);
- results->selcount = SendMessage (handle, LB_GETSELCOUNT, 0, 0);
+ results->selected = SendMessageA(handle, LB_GETCURSEL, 0, 0);
+ results->anchor = SendMessageA(handle, LB_GETANCHORINDEX, 0, 0);
+ results->caret = SendMessageA(handle, LB_GETCARETINDEX, 0, 0);
+ results->selcount = SendMessageA(handle, LB_GETSELCOUNT, 0, 0);
}
static void
@@ -103,8 +103,8 @@
LPARAM lp=x+(y<<16);
WAIT;
- SendMessage (handle, WM_LBUTTONDOWN, MK_LBUTTON, lp);
- SendMessage (handle, WM_LBUTTONUP, 0, lp);
+ SendMessageA(handle, WM_LBUTTONDOWN, MK_LBUTTON, lp);
+ SendMessageA(handle, WM_LBUTTONUP, 0, lp);
REDRAW;
}
@@ -114,8 +114,8 @@
LPARAM lp=1+(scancode<<16)+(extended?KEYEVENTF_EXTENDEDKEY:0);
WAIT;
- SendMessage (handle, WM_KEYDOWN, keycode, lp);
- SendMessage (handle, WM_KEYUP , keycode, lp | 0xc000000);
+ SendMessageA(handle, WM_KEYDOWN, keycode, lp);
+ SendMessageA(handle, WM_KEYUP , keycode, lp | 0xc000000);
REDRAW;
}
@@ -146,7 +146,7 @@
listbox_query (hLB, &answer);
listbox_ok (test, init, answer);
- SendMessage (hLB, LB_GETITEMRECT, 1, (LPARAM) &second_item);
+ SendMessageA(hLB, LB_GETITEMRECT, 1, (LPARAM) &second_item);
buttonpress(hLB, (WORD)second_item.left, (WORD)second_item.top);
listbox_query (hLB, &answer);
@@ -160,12 +160,12 @@
DestroyWindow (hLB);
hLB=create_listbox (test.prop.add_style, 0);
- SendMessage (hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(1, 2));
+ SendMessageA(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(1, 2));
listbox_query (hLB, &answer);
listbox_ok (test, sel, answer);
for (i=0;i<4;i++) {
- DWORD size = SendMessage (hLB, LB_GETTEXTLEN, i, 0);
+ DWORD size = SendMessageA(hLB, LB_GETTEXTLEN, i, 0);
CHAR *txt;
WCHAR *txtw;
int resA, resW;
@@ -189,13 +189,13 @@
}
/* Confirm the count of items, and that an invalid delete does not remove anything */
- res = SendMessage (hLB, LB_GETCOUNT, 0, 0);
+ res = SendMessageA(hLB, LB_GETCOUNT, 0, 0);
ok((res==4), "Expected 4 items, got %d\n", res);
- res = SendMessage (hLB, LB_DELETESTRING, -1, 0);
+ res = SendMessageA(hLB, LB_DELETESTRING, -1, 0);
ok((res==LB_ERR), "Expected LB_ERR items, got %d\n", res);
- res = SendMessage (hLB, LB_DELETESTRING, 4, 0);
+ res = SendMessageA(hLB, LB_DELETESTRING, 4, 0);
ok((res==LB_ERR), "Expected LB_ERR items, got %d\n", res);
- res = SendMessage (hLB, LB_GETCOUNT, 0, 0);
+ res = SendMessageA(hLB, LB_GETCOUNT, 0, 0);
ok((res==4), "Expected 4 items, got %d\n", res);
WAIT;
@@ -207,29 +207,29 @@
HWND hLB;
HDC hdc;
HFONT font;
- TEXTMETRIC tm;
+ TEXTMETRICA tm;
INT itemHeight;
hLB = create_listbox (0, 0);
ok ((hdc = GetDCEx( hLB, 0, DCX_CACHE )) != 0, "Can't get hdc\n");
ok ((font = GetCurrentObject(hdc, OBJ_FONT)) != 0, "Can't get the current
font\n");
- ok (GetTextMetrics( hdc, &tm ), "Can't read font metrics\n");
+ ok (GetTextMetricsA( hdc, &tm ), "Can't read font metrics\n");
ReleaseDC( hLB, hdc);
- ok (SendMessage(hLB, WM_SETFONT, (WPARAM)font, 0) == 0, "Can't set
font\n");
-
- itemHeight = SendMessage(hLB, LB_GETITEMHEIGHT, 0, 0);
+ ok (SendMessageA(hLB, WM_SETFONT, (WPARAM)font, 0) == 0, "Can't set
font\n");
+
+ itemHeight = SendMessageA(hLB, LB_GETITEMHEIGHT, 0, 0);
ok (itemHeight == tm.tmHeight, "Item height wrong, got %d, expecting %d\n",
itemHeight, tm.tmHeight);
DestroyWindow (hLB);
- hLB = CreateWindow ("LISTBOX", "TestList",
LBS_OWNERDRAWVARIABLE,
+ hLB = CreateWindowA("LISTBOX", "TestList",
LBS_OWNERDRAWVARIABLE,
0, 0, 100, 100, NULL, NULL, NULL, 0);
- itemHeight = SendMessage(hLB, LB_GETITEMHEIGHT, 0, 0);
+ itemHeight = SendMessageA(hLB, LB_GETITEMHEIGHT, 0, 0);
ok(itemHeight == tm.tmHeight, "itemHeight %d\n", itemHeight);
- itemHeight = SendMessage(hLB, LB_GETITEMHEIGHT, 5, 0);
+ itemHeight = SendMessageA(hLB, LB_GETITEMHEIGHT, 5, 0);
ok(itemHeight == tm.tmHeight, "itemHeight %d\n", itemHeight);
- itemHeight = SendMessage(hLB, LB_GETITEMHEIGHT, -5, 0);
+ itemHeight = SendMessageA(hLB, LB_GETITEMHEIGHT, -5, 0);
ok(itemHeight == tm.tmHeight, "itemHeight %d\n", itemHeight);
DestroyWindow (hLB);
}
@@ -260,7 +260,7 @@
trace("rcItem (%d,%d-%d,%d)\n", dis->rcItem.left,
dis->rcItem.top,
dis->rcItem.right, dis->rcItem.bottom);
- SendMessage(dis->hwndItem, LB_GETITEMRECT, dis->itemID,
(LPARAM)&rc_item);
+ SendMessageA(dis->hwndItem, LB_GETITEMRECT, dis->itemID,
(LPARAM)&rc_item);
trace("item rect (%d,%d-%d,%d)\n", rc_item.left, rc_item.top,
rc_item.right, rc_item.bottom);
ok(EqualRect(&dis->rcItem, &rc_item), "item rects are not
equal\n");
@@ -271,12 +271,12 @@
break;
}
- return DefWindowProc(hwnd, msg, wparam, lparam);
+ return DefWindowProcA(hwnd, msg, wparam, lparam);
}
static HWND create_parent( void )
{
- WNDCLASS cls;
+ WNDCLASSA cls;
HWND parent;
static ATOM class;
@@ -286,20 +286,20 @@
cls.lpfnWndProc = main_window_proc;
cls.cbClsExtra = 0;
cls.cbWndExtra = 0;
- cls.hInstance = GetModuleHandle(0);
+ cls.hInstance = GetModuleHandleA(NULL);
cls.hIcon = 0;
- cls.hCursor = LoadCursor(0, IDC_ARROW);
+ cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW);
cls.hbrBackground = GetStockObject(WHITE_BRUSH);
cls.lpszMenuName = NULL;
cls.lpszClassName = "main_window_class";
- class = RegisterClass( &cls );
- }
-
- parent = CreateWindowEx(0, "main_window_class", NULL,
+ class = RegisterClassA( &cls );
+ }
+
+ parent = CreateWindowExA(0, "main_window_class", NULL,
WS_POPUP | WS_VISIBLE,
100, 100, 400, 400,
GetDesktopWindow(), 0,
- GetModuleHandle(0), NULL);
+ GetModuleHandleA(NULL), NULL);
return parent;
}
@@ -319,16 +319,16 @@
UpdateWindow(hLB);
/* make height short enough */
- SendMessage(hLB, LB_GETITEMRECT, 0, (LPARAM)&rc);
+ SendMessageA(hLB, LB_GETITEMRECT, 0, (LPARAM)&rc);
SetWindowPos(hLB, 0, 0, 0, 100, rc.bottom - rc.top + 1,
SWP_NOZORDER | SWP_NOMOVE);
/* make 0 item invisible */
- SendMessage(hLB, LB_SETTOPINDEX, 1, 0);
- ret = SendMessage(hLB, LB_GETTOPINDEX, 0, 0);
+ SendMessageA(hLB, LB_SETTOPINDEX, 1, 0);
+ ret = SendMessageA(hLB, LB_GETTOPINDEX, 0, 0);
ok(ret == 1, "wrong top index %d\n", ret);
- SendMessage(hLB, LB_GETITEMRECT, 0, (LPARAM)&rc);
+ SendMessageA(hLB, LB_GETITEMRECT, 0, (LPARAM)&rc);
trace("item 0 rect (%d,%d-%d,%d)\n", rc.left, rc.top, rc.right,
rc.bottom);
ok(!IsRectEmpty(&rc), "empty item rect\n");
ok(rc.top < 0, "rc.top is not negative (%d)\n", rc.top);
@@ -361,61 +361,61 @@
listbox_query(hLB, &answer);
listbox_test_query(test_nosel, answer);
- ret = SendMessage(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(1, 2));
+ ret = SendMessageA(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(1, 2));
ok(ret == LB_OKAY, "LB_SELITEMRANGE returned %d instead of LB_OKAY\n",
ret);
listbox_query(hLB, &answer);
listbox_test_query(test_1, answer);
- SendMessage(hLB, LB_SETSEL, FALSE, -1);
+ SendMessageA(hLB, LB_SETSEL, FALSE, -1);
listbox_query(hLB, &answer);
listbox_test_query(test_nosel, answer);
- ret = SendMessage(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(0, 4));
+ ret = SendMessageA(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(0, 4));
ok(ret == LB_OKAY, "LB_SELITEMRANGE returned %d instead of LB_OKAY\n",
ret);
listbox_query(hLB, &answer);
listbox_test_query(test_3, answer);
- SendMessage(hLB, LB_SETSEL, FALSE, -1);
+ SendMessageA(hLB, LB_SETSEL, FALSE, -1);
listbox_query(hLB, &answer);
listbox_test_query(test_nosel, answer);
- ret = SendMessage(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(-5, 5));
+ ret = SendMessageA(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(-5, 5));
ok(ret == LB_OKAY, "LB_SELITEMRANGE returned %d instead of LB_OKAY\n",
ret);
listbox_query(hLB, &answer);
listbox_test_query(test_nosel, answer);
- SendMessage(hLB, LB_SETSEL, FALSE, -1);
+ SendMessageA(hLB, LB_SETSEL, FALSE, -1);
listbox_query(hLB, &answer);
listbox_test_query(test_nosel, answer);
- ret = SendMessage(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(2, 10));
+ ret = SendMessageA(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(2, 10));
ok(ret == LB_OKAY, "LB_SELITEMRANGE returned %d instead of LB_OKAY\n",
ret);
listbox_query(hLB, &answer);
listbox_test_query(test_1, answer);
- SendMessage(hLB, LB_SETSEL, FALSE, -1);
+ SendMessageA(hLB, LB_SETSEL, FALSE, -1);
listbox_query(hLB, &answer);
listbox_test_query(test_nosel, answer);
- ret = SendMessage(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(4, 10));
+ ret = SendMessageA(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(4, 10));
ok(ret == LB_OKAY, "LB_SELITEMRANGE returned %d instead of LB_OKAY\n",
ret);
listbox_query(hLB, &answer);
listbox_test_query(test_nosel, answer);
- SendMessage(hLB, LB_SETSEL, FALSE, -1);
+ SendMessageA(hLB, LB_SETSEL, FALSE, -1);
listbox_query(hLB, &answer);
listbox_test_query(test_nosel, answer);
- ret = SendMessage(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(10, 1));
+ ret = SendMessageA(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(10, 1));
ok(ret == LB_OKAY, "LB_SELITEMRANGE returned %d instead of LB_OKAY\n",
ret);
listbox_query(hLB, &answer);
listbox_test_query(test_2, answer);
- SendMessage(hLB, LB_SETSEL, FALSE, -1);
+ SendMessageA(hLB, LB_SETSEL, FALSE, -1);
listbox_query(hLB, &answer);
listbox_test_query(test_nosel, answer);
- ret = SendMessage(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(1, -1));
+ ret = SendMessageA(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(1, -1));
ok(ret == LB_OKAY, "LB_SELITEMRANGE returned %d instead of LB_OKAY\n",
ret);
listbox_query(hLB, &answer);
listbox_test_query(test_2, answer);
@@ -428,35 +428,35 @@
HWND hList;
int r, id;
- hList = CreateWindow( "ListBox", "list test", 0,
+ hList = CreateWindowA( "ListBox", "list test", 0,
1, 1, 600, 100, NULL, NULL, NULL, NULL );
ok( hList != NULL, "failed to create listbox\n");
- id = SendMessage( hList, LB_ADDSTRING, 0, (LPARAM) "hi");
+ id = SendMessageA( hList, LB_ADDSTRING, 0, (LPARAM) "hi");
ok( id == 0, "item id wrong\n");
- r = SendMessage( hList, LB_SETITEMHEIGHT, 0, MAKELPARAM( 20, 0 ));
+ r = SendMessageA( hList, LB_SETITEMHEIGHT, 0, MAKELPARAM( 20, 0 ));
ok( r == 0, "send message failed\n");
- r = SendMessage(hList, LB_GETITEMHEIGHT, 0, 0 );
+ r = SendMessageA(hList, LB_GETITEMHEIGHT, 0, 0 );
ok( r == 20, "height wrong\n");
- r = SendMessage( hList, LB_SETITEMHEIGHT, 0, MAKELPARAM( 0, 30 ));
+ r = SendMessageA( hList, LB_SETITEMHEIGHT, 0, MAKELPARAM( 0, 30 ));
ok( r == -1, "send message failed\n");
- r = SendMessage(hList, LB_GETITEMHEIGHT, 0, 0 );
+ r = SendMessageA(hList, LB_GETITEMHEIGHT, 0, 0 );
ok( r == 20, "height wrong\n");
- r = SendMessage( hList, LB_SETITEMHEIGHT, 0, MAKELPARAM( 0x100, 0 ));
+ r = SendMessageA( hList, LB_SETITEMHEIGHT, 0, MAKELPARAM( 0x100, 0 ));
ok( r == -1, "send message failed\n");
- r = SendMessage(hList, LB_GETITEMHEIGHT, 0, 0 );
+ r = SendMessageA(hList, LB_GETITEMHEIGHT, 0, 0 );
ok( r == 20, "height wrong\n");
- r = SendMessage( hList, LB_SETITEMHEIGHT, 0, MAKELPARAM( 0xff, 0 ));
+ r = SendMessageA( hList, LB_SETITEMHEIGHT, 0, MAKELPARAM( 0xff, 0 ));
ok( r == 0, "send message failed\n");
- r = SendMessage(hList, LB_GETITEMHEIGHT, 0, 0 );
+ r = SendMessageA(hList, LB_GETITEMHEIGHT, 0, 0 );
ok( r == 0xff, "height wrong\n");
DestroyWindow( hList );
@@ -468,81 +468,81 @@
without caption). LBS_NOINTEGRALHEIGHT is required in order to test
behavior of partially-displayed item.
*/
- HWND hList = CreateWindow( "ListBox", "list test",
+ HWND hList = CreateWindowA( "ListBox", "list test",
WS_VISIBLE|WS_POPUP|LBS_NOINTEGRALHEIGHT,
1, 1, 600, 100, NULL, NULL, NULL, NULL );
ULONG r, id;
RECT rc;
/* For an empty listbox win2k returns 0x1ffff, win98 returns 0x10000, nt4 returns
0xffffffff */
- r = SendMessage(hList, LB_ITEMFROMPOINT, 0, MAKELPARAM( /* x */ 30, /* y */ 30 ));
+ r = SendMessageA(hList, LB_ITEMFROMPOINT, 0, MAKELPARAM( /* x */ 30, /* y */ 30 ));
ok( r == 0x1ffff || r == 0x10000 || r == 0xffffffff, "ret %x\n", r );
- r = SendMessage(hList, LB_ITEMFROMPOINT, 0, MAKELPARAM( 700, 30 ));
+ r = SendMessageA(hList, LB_ITEMFROMPOINT, 0, MAKELPARAM( 700, 30 ));
ok( r == 0x1ffff || r == 0x10000 || r == 0xffffffff, "ret %x\n", r );
- r = SendMessage(hList, LB_ITEMFROMPOINT, 0, MAKELPARAM( 30, 300 ));
+ r = SendMessageA(hList, LB_ITEMFROMPOINT, 0, MAKELPARAM( 30, 300 ));
ok( r == 0x1ffff || r == 0x10000 || r == 0xffffffff, "ret %x\n", r );
- id = SendMessage( hList, LB_ADDSTRING, 0, (LPARAM) "hi");
+ id = SendMessageA( hList, LB_ADDSTRING, 0, (LPARAM) "hi");
ok( id == 0, "item id wrong\n");
- id = SendMessage( hList, LB_ADDSTRING, 0, (LPARAM) "hi1");
+ id = SendMessageA( hList, LB_ADDSTRING, 0, (LPARAM) "hi1");
ok( id == 1, "item id wrong\n");
- r = SendMessage(hList, LB_ITEMFROMPOINT, 0, MAKELPARAM( /* x */ 30, /* y */ 30 ));
+ r = SendMessageA(hList, LB_ITEMFROMPOINT, 0, MAKELPARAM( /* x */ 30, /* y */ 30 ));
ok( r == 0x1, "ret %x\n", r );
- r = SendMessage(hList, LB_ITEMFROMPOINT, 0, MAKELPARAM( /* x */ 30, /* y */ 601 ));
+ r = SendMessageA(hList, LB_ITEMFROMPOINT, 0, MAKELPARAM( /* x */ 30, /* y */ 601 ));
ok( r == 0x10001 || broken(r == 1), /* nt4 */
"ret %x\n", r );
/* Resize control so that below assertions about sizes are valid */
- r = SendMessage( hList, LB_GETITEMRECT, 0, (LPARAM)&rc);
+ r = SendMessageA( hList, LB_GETITEMRECT, 0, (LPARAM)&rc);
ok( r == 1, "ret %x\n", r);
r = MoveWindow(hList, 1, 1, 600, (rc.bottom - rc.top + 1) * 9 / 2, TRUE);
ok( r != 0, "ret %x\n", r);
- id = SendMessage( hList, LB_ADDSTRING, 0, (LPARAM) "hi2");
+ id = SendMessageA( hList, LB_ADDSTRING, 0, (LPARAM) "hi2");
ok( id == 2, "item id wrong\n");
- id = SendMessage( hList, LB_ADDSTRING, 0, (LPARAM) "hi3");
+ id = SendMessageA( hList, LB_ADDSTRING, 0, (LPARAM) "hi3");
ok( id == 3, "item id wrong\n");
- id = SendMessage( hList, LB_ADDSTRING, 0, (LPARAM) "hi4");
+ id = SendMessageA( hList, LB_ADDSTRING, 0, (LPARAM) "hi4");
ok( id == 4, "item id wrong\n");
- id = SendMessage( hList, LB_ADDSTRING, 0, (LPARAM) "hi5");
+ id = SendMessageA( hList, LB_ADDSTRING, 0, (LPARAM) "hi5");
ok( id == 5, "item id wrong\n");
- id = SendMessage( hList, LB_ADDSTRING, 0, (LPARAM) "hi6");
+ id = SendMessageA( hList, LB_ADDSTRING, 0, (LPARAM) "hi6");
ok( id == 6, "item id wrong\n");
- id = SendMessage( hList, LB_ADDSTRING, 0, (LPARAM) "hi7");
+ id = SendMessageA( hList, LB_ADDSTRING, 0, (LPARAM) "hi7");
ok( id == 7, "item id wrong\n");
/* Set the listbox up so that id 1 is at the top, this leaves 5
partially visible at the bottom and 6, 7 are invisible */
- SendMessage( hList, LB_SETTOPINDEX, 1, 0);
- r = SendMessage( hList, LB_GETTOPINDEX, 0, 0);
+ SendMessageA( hList, LB_SETTOPINDEX, 1, 0);
+ r = SendMessageA( hList, LB_GETTOPINDEX, 0, 0);
ok( r == 1, "top %d\n", r);
- r = SendMessage( hList, LB_GETITEMRECT, 5, (LPARAM)&rc);
+ r = SendMessageA( hList, LB_GETITEMRECT, 5, (LPARAM)&rc);
ok( r == 1, "ret %x\n", r);
- r = SendMessage( hList, LB_GETITEMRECT, 6, (LPARAM)&rc);
+ r = SendMessageA( hList, LB_GETITEMRECT, 6, (LPARAM)&rc);
ok( r == 0, "ret %x\n", r);
- r = SendMessage( hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(/* x */ 10, /* y */ 10) );
+ r = SendMessageA( hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(/* x */ 10, /* y */ 10) );
ok( r == 1, "ret %x\n", r);
- r = SendMessage( hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(1000, 10) );
+ r = SendMessageA( hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(1000, 10) );
ok( r == 0x10001 || broken(r == 1), /* nt4 */
"ret %x\n", r );
- r = SendMessage( hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(10, -10) );
+ r = SendMessageA( hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(10, -10) );
ok( r == 0x10001 || broken(r == 1), /* nt4 */
"ret %x\n", r );
- r = SendMessage( hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(10, 100) );
+ r = SendMessageA( hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(10, 100) );
ok( r == 0x10005 || broken(r == 5), /* nt4 */
"item %x\n", r );
- r = SendMessage( hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(10, 200) );
+ r = SendMessageA( hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(10, 200) );
ok( r == 0x10005 || broken(r == 5), /* nt4 */
"item %x\n", r );
@@ -554,17 +554,17 @@
HWND hList;
int r, id;
- hList = CreateWindow( "ListBox", "list test", 0,
+ hList = CreateWindowA( "ListBox", "list test", 0,
1, 1, 600, 100, NULL, NULL, NULL, NULL );
ok( hList != NULL, "failed to create listbox\n");
- id = SendMessage( hList, LB_ADDSTRING, 0, (LPARAM) "hi");
+ id = SendMessageA( hList, LB_ADDSTRING, 0, (LPARAM) "hi");
ok( id == 0, "item id wrong\n");
- r = SendMessage( hList, LB_SETITEMDATA, 0, MAKELPARAM( 20, 0 ));
+ r = SendMessageA( hList, LB_SETITEMDATA, 0, MAKELPARAM( 20, 0 ));
ok(r == TRUE, "LB_SETITEMDATA returned %d instead of TRUE\n", r);
- r = SendMessage( hList, LB_GETITEMDATA, 0, 0);
+ r = SendMessageA( hList, LB_GETITEMDATA, 0, 0);
ok( r == 20, "get item data failed\n");
DestroyWindow( hList );
@@ -594,7 +594,7 @@
one file that fits the wildcard w*.c . Normally, the test
directory itself satisfies both conditions.
*/
- hList = CreateWindow( "ListBox", "list test",
WS_VISIBLE|WS_POPUP,
+ hList = CreateWindowA( "ListBox", "list test",
WS_VISIBLE|WS_POPUP,
1, 1, 600, 100, NULL, NULL, NULL, NULL );
assert(hList);
@@ -602,18 +602,18 @@
/* This should list all the files in the test directory. */
strcpy(pathBuffer, wildcard);
- SendMessage(hList, LB_RESETCONTENT, 0, 0);
- res = SendMessage(hList, LB_DIR, 0, (LPARAM)pathBuffer);
+ SendMessageA(hList, LB_RESETCONTENT, 0, 0);
+ res = SendMessageA(hList, LB_DIR, 0, (LPARAM)pathBuffer);
if (res == -1) /* "*" wildcard doesn't work on win9x */
{
wildcard = "*.*";
strcpy(pathBuffer, wildcard);
- res = SendMessage(hList, LB_DIR, 0, (LPARAM)pathBuffer);
+ res = SendMessageA(hList, LB_DIR, 0, (LPARAM)pathBuffer);
}
ok (res >= 0, "SendMessage(LB_DIR, 0, *) failed - 0x%08x\n",
GetLastError());
/* There should be some content in the listbox */
- itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0);
ok (itemCount > 0, "SendMessage(LB_DIR) did NOT fill the listbox!\n");
itemCount_allFiles = itemCount;
ok(res + 1 == itemCount,
@@ -622,12 +622,12 @@
/* This tests behavior when no files match the wildcard */
strcpy(pathBuffer, BAD_EXTENSION);
- SendMessage(hList, LB_RESETCONTENT, 0, 0);
- res = SendMessage(hList, LB_DIR, 0, (LPARAM)pathBuffer);
+ SendMessageA(hList, LB_RESETCONTENT, 0, 0);
+ res = SendMessageA(hList, LB_DIR, 0, (LPARAM)pathBuffer);
ok (res == -1, "SendMessage(LB_DIR, 0, %s) returned %d, expected -1\n",
BAD_EXTENSION, res);
/* There should be NO content in the listbox */
- itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0);
ok (itemCount == 0, "SendMessage(LB_DIR) DID fill the listbox!\n");
@@ -635,8 +635,8 @@
* As of this writing, this includes win.c, winstation.c, wsprintf.c
*/
strcpy(pathBuffer, "w*.c");
- SendMessage(hList, LB_RESETCONTENT, 0, 0);
- res = SendMessage(hList, LB_DIR, 0, (LPARAM)pathBuffer);
+ SendMessageA(hList, LB_RESETCONTENT, 0, 0);
+ res = SendMessageA(hList, LB_DIR, 0, (LPARAM)pathBuffer);
ok (res >= 0, "SendMessage(LB_DIR, 0, w*.c) failed - 0x%08x\n",
GetLastError());
/* Path specification does NOT converted to uppercase */
@@ -644,7 +644,7 @@
"expected no change to pathBuffer, got %s\n", pathBuffer);
/* There should be some content in the listbox */
- itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0);
ok (itemCount > 0, "SendMessage(LB_DIR) did NOT fill the listbox!\n");
itemCount_justFiles = itemCount;
ok(res + 1 == itemCount,
@@ -654,7 +654,7 @@
/* Every single item in the control should start with a w and end in .c */
for (i = 0; i < itemCount; i++) {
memset(pathBuffer, 0, MAX_PATH);
- SendMessage(hList, LB_GETTEXT, i, (LPARAM)pathBuffer);
+ SendMessageA(hList, LB_GETTEXT, i, (LPARAM)pathBuffer);
p = pathBuffer + strlen(pathBuffer);
ok(((pathBuffer[0] == 'w' || pathBuffer[0] == 'W') &&
(*(p-1) == 'c' || *(p-1) == 'C') &&
@@ -663,14 +663,14 @@
/* Test DDL_DIRECTORY */
strcpy(pathBuffer, wildcard);
- SendMessage(hList, LB_RESETCONTENT, 0, 0);
- res = SendMessage(hList, LB_DIR, DDL_DIRECTORY, (LPARAM)pathBuffer);
+ SendMessageA(hList, LB_RESETCONTENT, 0, 0);
+ res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY, (LPARAM)pathBuffer);
ok (res > 0, "SendMessage(LB_DIR, DDL_DIRECTORY, *) failed - 0x%08x\n",
GetLastError());
/* There should be some content in the listbox.
* All files plus "[..]"
*/
- itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0);
itemCount_allDirs = itemCount - itemCount_allFiles;
ok (itemCount > itemCount_allFiles,
"SendMessage(LB_DIR, DDL_DIRECTORY, *) filled with %d entries, expected >
%d\n",
@@ -681,25 +681,25 @@
/* This tests behavior when no files match the wildcard */
strcpy(pathBuffer, BAD_EXTENSION);
- SendMessage(hList, LB_RESETCONTENT, 0, 0);
- res = SendMessage(hList, LB_DIR, DDL_DIRECTORY, (LPARAM)pathBuffer);
+ SendMessageA(hList, LB_RESETCONTENT, 0, 0);
+ res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY, (LPARAM)pathBuffer);
ok (res == -1, "SendMessage(LB_DIR, DDL_DIRECTORY, %s) returned %d, expected
-1\n", BAD_EXTENSION, res);
/* There should be NO content in the listbox */
- itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0);
ok (itemCount == 0, "SendMessage(LB_DIR) DID fill the listbox!\n");
/* Test DDL_DIRECTORY */
strcpy(pathBuffer, "w*.c");
- SendMessage(hList, LB_RESETCONTENT, 0, 0);
- res = SendMessage(hList, LB_DIR, DDL_DIRECTORY, (LPARAM)pathBuffer);
+ SendMessageA(hList, LB_RESETCONTENT, 0, 0);
+ res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY, (LPARAM)pathBuffer);
ok (res >= 0, "SendMessage(LB_DIR, DDL_DIRECTORY, w*.c) failed -
0x%08x\n", GetLastError());
/* There should be some content in the listbox. Since the parent directory does not
* fit w*.c, there should be exactly the same number of items as without
DDL_DIRECTORY
*/
- itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0);
ok (itemCount == itemCount_justFiles,
"SendMessage(LB_DIR, DDL_DIRECTORY, w*.c) filled with %d entries, expected
%d\n",
itemCount, itemCount_justFiles);
@@ -710,7 +710,7 @@
/* Every single item in the control should start with a w and end in .c. */
for (i = 0; i < itemCount; i++) {
memset(pathBuffer, 0, MAX_PATH);
- SendMessage(hList, LB_GETTEXT, i, (LPARAM)pathBuffer);
+ SendMessageA(hList, LB_GETTEXT, i, (LPARAM)pathBuffer);
p = pathBuffer + strlen(pathBuffer);
ok(
((pathBuffer[0] == 'w' || pathBuffer[0] == 'W') &&
@@ -721,8 +721,8 @@
/* Test DDL_DRIVES|DDL_EXCLUSIVE */
strcpy(pathBuffer, wildcard);
- SendMessage(hList, LB_RESETCONTENT, 0, 0);
- res = SendMessage(hList, LB_DIR, DDL_DRIVES|DDL_EXCLUSIVE, (LPARAM)pathBuffer);
+ SendMessageA(hList, LB_RESETCONTENT, 0, 0);
+ res = SendMessageA(hList, LB_DIR, DDL_DRIVES|DDL_EXCLUSIVE, (LPARAM)pathBuffer);
ok (res >= 0, "SendMessage(LB_DIR, DDL_DRIVES|DDL_EXCLUSIVE, *) failed -
0x%08x\n", GetLastError());
/* There should be some content in the listbox. In particular, there should
@@ -730,7 +730,7 @@
* have been added. Depending on the user setting, more drives might have
* been added.
*/
- itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0);
ok (itemCount >= 1,
"SendMessage(LB_DIR, DDL_DRIVES|DDL_EXCLUSIVE, *) filled with %d entries,
expected at least %d\n",
itemCount, 1);
@@ -741,7 +741,7 @@
for (i = 0; i < itemCount; i++) {
memset(pathBuffer, 0, MAX_PATH);
driveletter = '\0';
- SendMessage(hList, LB_GETTEXT, i, (LPARAM)pathBuffer);
+ SendMessageA(hList, LB_GETTEXT, i, (LPARAM)pathBuffer);
ok( strlen(pathBuffer) == 5, "Length of drive string is not 5\n" );
ok( sscanf(pathBuffer, "[-%c-]", &driveletter) == 1, "Element
%d (%s) does not fit [-X-]\n", i, pathBuffer);
ok( driveletter >= 'a' && driveletter <= 'z',
"Drive letter not in range a..z, got ascii %d\n", driveletter);
@@ -754,12 +754,12 @@
/* This tests behavior when no files match the wildcard */
strcpy(pathBuffer, BAD_EXTENSION);
- SendMessage(hList, LB_RESETCONTENT, 0, 0);
- res = SendMessage(hList, LB_DIR, DDL_DRIVES|DDL_EXCLUSIVE, (LPARAM)pathBuffer);
+ SendMessageA(hList, LB_RESETCONTENT, 0, 0);
+ res = SendMessageA(hList, LB_DIR, DDL_DRIVES|DDL_EXCLUSIVE, (LPARAM)pathBuffer);
ok (res == itemCount_justDrives -1, "SendMessage(LB_DIR,
DDL_DRIVES|DDL_EXCLUSIVE, %s) returned %d, expected %d\n",
BAD_EXTENSION, res, itemCount_justDrives -1);
- itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0);
ok (itemCount == itemCount_justDrives, "SendMessage(LB_DIR) returned %d expected
%d\n",
itemCount, itemCount_justDrives);
@@ -768,8 +768,8 @@
/* Test DDL_DRIVES. */
strcpy(pathBuffer, wildcard);
- SendMessage(hList, LB_RESETCONTENT, 0, 0);
- res = SendMessage(hList, LB_DIR, DDL_DRIVES, (LPARAM)pathBuffer);
+ SendMessageA(hList, LB_RESETCONTENT, 0, 0);
+ res = SendMessageA(hList, LB_DIR, DDL_DRIVES, (LPARAM)pathBuffer);
ok (res > 0, "SendMessage(LB_DIR, DDL_DRIVES, *) failed - 0x%08x\n",
GetLastError());
/* There should be some content in the listbox. In particular, there should
@@ -777,7 +777,7 @@
* have been added. Depending on the user setting, more drives might have
* been added.
*/
- itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0);
ok (itemCount == itemCount_justDrives + itemCount_allFiles,
"SendMessage(LB_DIR, DDL_DRIVES, *) filled with %d entries, expected
%d\n",
itemCount, itemCount_justDrives + itemCount_allFiles);
@@ -785,19 +785,19 @@
/* This tests behavior when no files match the wildcard */
strcpy(pathBuffer, BAD_EXTENSION);
- SendMessage(hList, LB_RESETCONTENT, 0, 0);
- res = SendMessage(hList, LB_DIR, DDL_DRIVES, (LPARAM)pathBuffer);
+ SendMessageA(hList, LB_RESETCONTENT, 0, 0);
+ res = SendMessageA(hList, LB_DIR, DDL_DRIVES, (LPARAM)pathBuffer);
ok (res == itemCount_justDrives -1, "SendMessage(LB_DIR, DDL_DRIVES, %s)
returned %d, expected %d\n",
BAD_EXTENSION, res, itemCount_justDrives -1);
- itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0);
ok (itemCount == res + 1, "SendMessage(LB_DIR) returned %d expected %d\n",
itemCount, res + 1);
/* Test DDL_DRIVES. */
strcpy(pathBuffer, "w*.c");
- SendMessage(hList, LB_RESETCONTENT, 0, 0);
- res = SendMessage(hList, LB_DIR, DDL_DRIVES, (LPARAM)pathBuffer);
+ SendMessageA(hList, LB_RESETCONTENT, 0, 0);
+ res = SendMessageA(hList, LB_DIR, DDL_DRIVES, (LPARAM)pathBuffer);
ok (res > 0, "SendMessage(LB_DIR, DDL_DRIVES, w*.c) failed - 0x%08x\n",
GetLastError());
/* There should be some content in the listbox. In particular, there should
@@ -805,7 +805,7 @@
* have been added. Depending on the user setting, more drives might have
* been added.
*/
- itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0);
ok (itemCount == itemCount_justDrives + itemCount_justFiles,
"SendMessage(LB_DIR, DDL_DRIVES, w*.c) filled with %d entries, expected
%d\n",
itemCount, itemCount_justDrives + itemCount_justFiles);
@@ -815,7 +815,7 @@
for (i = 0; i < itemCount; i++) {
memset(pathBuffer, 0, MAX_PATH);
driveletter = '\0';
- SendMessage(hList, LB_GETTEXT, i, (LPARAM)pathBuffer);
+ SendMessageA(hList, LB_GETTEXT, i, (LPARAM)pathBuffer);
p = pathBuffer + strlen(pathBuffer);
if (sscanf(pathBuffer, "[-%c-]", &driveletter) == 1) {
ok( strlen(pathBuffer) == 5, "Length of drive string is not 5\n"
);
@@ -831,14 +831,14 @@
/* Test DDL_DIRECTORY|DDL_DRIVES. This does *not* imply DDL_EXCLUSIVE */
strcpy(pathBuffer, wildcard);
- SendMessage(hList, LB_RESETCONTENT, 0, 0);
- res = SendMessage(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES, (LPARAM)pathBuffer);
+ SendMessageA(hList, LB_RESETCONTENT, 0, 0);
+ res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES, (LPARAM)pathBuffer);
ok (res > 0, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES, *) failed -
0x%08x\n", GetLastError());
/* There should be some content in the listbox. In particular, there should
* be exactly the number of plain files, plus the number of mapped drives.
*/
- itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0);
ok (itemCount == itemCount_allFiles + itemCount_justDrives + itemCount_allDirs,
"SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES) filled with %d entries,
expected %d\n",
itemCount, itemCount_allFiles + itemCount_justDrives + itemCount_allDirs);
@@ -851,7 +851,7 @@
for (i = 0; i < itemCount; i++) {
memset(pathBuffer, 0, MAX_PATH);
driveletter = '\0';
- SendMessage(hList, LB_GETTEXT, i, (LPARAM)pathBuffer);
+ SendMessageA(hList, LB_GETTEXT, i, (LPARAM)pathBuffer);
if (sscanf(pathBuffer, "[-%c-]", &driveletter) == 1) {
ok( driveletter >= 'a' && driveletter <= 'z',
"Drive letter not in range a..z, got ascii %d\n", driveletter);
}
@@ -859,26 +859,26 @@
/* This tests behavior when no files match the wildcard */
strcpy(pathBuffer, BAD_EXTENSION);
- SendMessage(hList, LB_RESETCONTENT, 0, 0);
- res = SendMessage(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES, (LPARAM)pathBuffer);
+ SendMessageA(hList, LB_RESETCONTENT, 0, 0);
+ res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES, (LPARAM)pathBuffer);
ok (res == itemCount_justDrives -1, "SendMessage(LB_DIR,
DDL_DIRECTORY|DDL_DRIVES, %s) returned %d, expected %d\n",
BAD_EXTENSION, res, itemCount_justDrives -1);
- itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0);
ok (itemCount == res + 1, "SendMessage(LB_DIR) returned %d expected %d\n",
itemCount, res + 1);
/* Test DDL_DIRECTORY|DDL_DRIVES. */
strcpy(pathBuffer, "w*.c");
- SendMessage(hList, LB_RESETCONTENT, 0, 0);
- res = SendMessage(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES, (LPARAM)pathBuffer);
+ SendMessageA(hList, LB_RESETCONTENT, 0, 0);
+ res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES, (LPARAM)pathBuffer);
ok (res > 0, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES, w*.c) failed -
0x%08x\n", GetLastError());
/* There should be some content in the listbox. In particular, there should
* be exactly the number of plain files, plus the number of mapped drives.
*/
- itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0);
ok (itemCount == itemCount_justFiles + itemCount_justDrives,
"SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES) filled with %d entries,
expected %d\n",
itemCount, itemCount_justFiles + itemCount_justDrives);
@@ -891,7 +891,7 @@
for (i = 0; i < itemCount; i++) {
memset(pathBuffer, 0, MAX_PATH);
driveletter = '\0';
- SendMessage(hList, LB_GETTEXT, i, (LPARAM)pathBuffer);
+ SendMessageA(hList, LB_GETTEXT, i, (LPARAM)pathBuffer);
p = pathBuffer + strlen(pathBuffer);
if (sscanf(pathBuffer, "[-%c-]", &driveletter) == 1) {
ok( driveletter >= 'a' && driveletter <= 'z',
"Drive letter not in range a..z, got ascii %d\n", driveletter);
@@ -905,11 +905,11 @@
/* Test DDL_DIRECTORY|DDL_EXCLUSIVE. */
strcpy(pathBuffer, wildcard);
- SendMessage(hList, LB_RESETCONTENT, 0, 0);
- res = SendMessage(hList, LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, (LPARAM)pathBuffer);
+ SendMessageA(hList, LB_RESETCONTENT, 0, 0);
+ res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, (LPARAM)pathBuffer);
ok (res != -1, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, *) failed err
%u\n", GetLastError());
- itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0);
ok (itemCount == itemCount_allDirs,
"SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE) filled with %d entries,
expected %d\n",
itemCount, itemCount_allDirs);
@@ -918,41 +918,41 @@
if (itemCount && GetCurrentDirectoryA( MAX_PATH, pathBuffer ) > 3) /*
there's no [..] in drive root */
{
memset(pathBuffer, 0, MAX_PATH);
- SendMessage(hList, LB_GETTEXT, 0, (LPARAM)pathBuffer);
+ SendMessageA(hList, LB_GETTEXT, 0, (LPARAM)pathBuffer);
ok( !strcmp(pathBuffer, "[..]"), "First element is not
[..]\n");
}
/* This tests behavior when no files match the wildcard */
strcpy(pathBuffer, BAD_EXTENSION);
- SendMessage(hList, LB_RESETCONTENT, 0, 0);
- res = SendMessage(hList, LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, (LPARAM)pathBuffer);
+ SendMessageA(hList, LB_RESETCONTENT, 0, 0);
+ res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, (LPARAM)pathBuffer);
ok (res == -1, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, %s) returned
%d, expected %d\n",
BAD_EXTENSION, res, -1);
- itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0);
ok (itemCount == res + 1, "SendMessage(LB_DIR) returned %d expected %d\n",
itemCount, res + 1);
/* Test DDL_DIRECTORY|DDL_EXCLUSIVE. */
strcpy(pathBuffer, "w*.c");
- SendMessage(hList, LB_RESETCONTENT, 0, 0);
- res = SendMessage(hList, LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, (LPARAM)pathBuffer);
+ SendMessageA(hList, LB_RESETCONTENT, 0, 0);
+ res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, (LPARAM)pathBuffer);
ok (res == LB_ERR, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, w*.c)
returned %d expected %d\n", res, LB_ERR);
/* There should be no elements, since "[..]" does not fit w*.c */
- itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0);
ok (itemCount == 0,
"SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE) filled with %d entries,
expected %d\n",
itemCount, 0);
/* Test DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE. */
strcpy(pathBuffer, wildcard);
- SendMessage(hList, LB_RESETCONTENT, 0, 0);
- res = SendMessage(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE,
(LPARAM)pathBuffer);
+ SendMessageA(hList, LB_RESETCONTENT, 0, 0);
+ res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE,
(LPARAM)pathBuffer);
ok (res > 0, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE,
w*.c,) failed - 0x%08x\n", GetLastError());
/* There should be no plain files on the listbox */
- itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0);
ok (itemCount == itemCount_justDrives + itemCount_allDirs,
"SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE) filled with %d
entries, expected %d\n",
itemCount, itemCount_justDrives + itemCount_allDirs);
@@ -961,7 +961,7 @@
for (i = 0; i < itemCount; i++) {
memset(pathBuffer, 0, MAX_PATH);
driveletter = '\0';
- SendMessage(hList, LB_GETTEXT, i, (LPARAM)pathBuffer);
+ SendMessageA(hList, LB_GETTEXT, i, (LPARAM)pathBuffer);
if (sscanf(pathBuffer, "[-%c-]", &driveletter) == 1) {
ok( driveletter >= 'a' && driveletter <= 'z',
"Drive letter not in range a..z, got ascii %d\n", driveletter);
} else {
@@ -972,22 +972,22 @@
/* This tests behavior when no files match the wildcard */
strcpy(pathBuffer, BAD_EXTENSION);
- SendMessage(hList, LB_RESETCONTENT, 0, 0);
- res = SendMessage(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE,
(LPARAM)pathBuffer);
+ SendMessageA(hList, LB_RESETCONTENT, 0, 0);
+ res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE,
(LPARAM)pathBuffer);
ok (res == itemCount_justDrives -1, "SendMessage(LB_DIR,
DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE, %s) returned %d, expected %d\n",
BAD_EXTENSION, res, itemCount_justDrives -1);
- itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0);
ok (itemCount == res + 1, "SendMessage(LB_DIR) returned %d expected %d\n",
itemCount, res + 1);
/* Test DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE. */
strcpy(pathBuffer, "w*.c");
- SendMessage(hList, LB_RESETCONTENT, 0, 0);
- res = SendMessage(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE,
(LPARAM)pathBuffer);
+ SendMessageA(hList, LB_RESETCONTENT, 0, 0);
+ res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE,
(LPARAM)pathBuffer);
ok (res >= 0, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE,
w*.c,) failed - 0x%08x\n", GetLastError());
/* There should be no plain files on the listbox, and no [..], since it does not fit
w*.c */
- itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0);
ok (itemCount == itemCount_justDrives,
"SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE) filled with %d
entries, expected %d\n",
itemCount, itemCount_justDrives);
@@ -996,7 +996,7 @@
for (i = 0; i < itemCount; i++) {
memset(pathBuffer, 0, MAX_PATH);
driveletter = '\0';
- SendMessage(hList, LB_GETTEXT, i, (LPARAM)pathBuffer);
+ SendMessageA(hList, LB_GETTEXT, i, (LPARAM)pathBuffer);
ok (sscanf(pathBuffer, "[-%c-]", &driveletter) == 1, "Element
%d (%s) does not fit [-X-]\n", i, pathBuffer);
ok( driveletter >= 'a' && driveletter <= 'z',
"Drive letter not in range a..z, got ascii %d\n", driveletter);
}
@@ -1011,16 +1011,16 @@
#define ID_TEST_LABEL 1001
#define ID_TEST_LISTBOX 1002
-static BOOL on_listbox_container_create (HWND hwnd, LPCREATESTRUCT lpcs)
-{
- g_label = CreateWindow(
+static BOOL on_listbox_container_create (HWND hwnd, LPCREATESTRUCTA lpcs)
+{
+ g_label = CreateWindowA(
"Static",
"Contents of static control before DlgDirList.",
WS_CHILD | WS_VISIBLE,
10, 10, 512, 32,
hwnd, (HMENU)ID_TEST_LABEL, NULL, 0);
if (!g_label) return FALSE;
- g_listBox = CreateWindow(
+ g_listBox = CreateWindowA(
"ListBox",
"DlgDirList test",
WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER | WS_VSCROLL,
@@ -1060,7 +1060,7 @@
cls.cbWndExtra = 0;
cls.hInstance = hInst;
cls.hIcon = NULL;
- cls.hCursor = LoadCursorA (NULL, IDC_ARROW);
+ cls.hCursor = LoadCursorA (NULL, (LPCSTR)IDC_ARROW);
cls.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
cls.lpszMenuName = NULL;
cls.lpfnWndProc = listbox_container_window_procA;
@@ -1098,7 +1098,7 @@
hInst = GetModuleHandleA(0);
if (!RegisterListboxWindowClass(hInst)) assert(0);
- hWnd = CreateWindow("ListboxContainerClass",
"ListboxContainerClass",
+ hWnd = CreateWindowA("ListboxContainerClass",
"ListboxContainerClass",
WS_OVERLAPPEDWINDOW | WS_VISIBLE,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
NULL, NULL, hInst, 0);
@@ -1107,13 +1107,13 @@
/* Test for standard usage */
/* The following should be overwritten by the directory path */
- SendMessage(g_label, WM_SETTEXT, 0, (LPARAM)"default contents");
+ SendMessageA(g_label, WM_SETTEXT, 0, (LPARAM)"default contents");
/* This should list all the w*.c files in the test directory
* As of this writing, this includes win.c, winstation.c, wsprintf.c
*/
strcpy(pathBuffer, "w*.c");
- res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, 0);
+ res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, 0);
ok (res == 1, "DlgDirList(*.c, 0) returned %d - expected 1 - 0x%08x\n",
res, GetLastError());
/* Path specification gets converted to uppercase */
@@ -1121,19 +1121,19 @@
"expected conversion to uppercase, got %s\n", pathBuffer);
/* Loaded path should have overwritten the label text */
- SendMessage(g_label, WM_GETTEXT, MAX_PATH, (LPARAM)pathBuffer);
+ SendMessageA(g_label, WM_GETTEXT, MAX_PATH, (LPARAM)pathBuffer);
trace("Static control after DlgDirList: %s\n", pathBuffer);
ok (strcmp("default contents", pathBuffer), "DlgDirList() did not
modify static control!\n");
/* There should be some content in the listbox */
- itemCount = SendMessage(g_listBox, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0);
ok (itemCount > 0, "DlgDirList() did NOT fill the listbox!\n");
itemCount_justFiles = itemCount;
/* Every single item in the control should start with a w and end in .c */
for (i = 0; i < itemCount; i++) {
memset(pathBuffer, 0, MAX_PATH);
- SendMessage(g_listBox, LB_GETTEXT, i, (LPARAM)pathBuffer);
+ SendMessageA(g_listBox, LB_GETTEXT, i, (LPARAM)pathBuffer);
p = pathBuffer + strlen(pathBuffer);
ok(((pathBuffer[0] == 'w' || pathBuffer[0] == 'W') &&
(*(p-1) == 'c' || *(p-1) == 'C') &&
@@ -1142,15 +1142,15 @@
/* Test behavior when no files match the wildcard */
strcpy(pathBuffer, BAD_EXTENSION);
- res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, 0);
+ res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, 0);
ok (res == 1, "DlgDirList(%s, 0) returned %d expected 1\n", BAD_EXTENSION,
res);
- itemCount = SendMessage(g_listBox, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0);
ok (itemCount == 0, "DlgDirList() DID fill the listbox!\n");
/* Test DDL_DIRECTORY */
strcpy(pathBuffer, "w*.c");
- res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL,
+ res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL,
DDL_DIRECTORY);
ok (res == 1, "DlgDirList(*.c, DDL_DIRECTORY) failed - 0x%08x\n",
GetLastError());
@@ -1158,7 +1158,7 @@
* be exactly more elements than before, since the directories should
* have been added.
*/
- itemCount = SendMessage(g_listBox, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0);
itemCount_allDirs = itemCount - itemCount_justFiles;
ok (itemCount >= itemCount_justFiles,
"DlgDirList(DDL_DIRECTORY) filled with %d entries, expected >
%d\n",
@@ -1169,7 +1169,7 @@
*/
for (i = 0; i < itemCount; i++) {
memset(pathBuffer, 0, MAX_PATH);
- SendMessage(g_listBox, LB_GETTEXT, i, (LPARAM)pathBuffer);
+ SendMessageA(g_listBox, LB_GETTEXT, i, (LPARAM)pathBuffer);
p = pathBuffer + strlen(pathBuffer);
ok( (pathBuffer[0] == '[' && pathBuffer[strlen(pathBuffer)-1] ==
']') ||
((pathBuffer[0] == 'w' || pathBuffer[0] == 'W') &&
@@ -1179,17 +1179,17 @@
/* Test behavior when no files match the wildcard */
strcpy(pathBuffer, BAD_EXTENSION);
- res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL,
+ res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL,
DDL_DIRECTORY);
ok (res == 1, "DlgDirList(%s, DDL_DIRECTORY) returned %d expected 1\n",
BAD_EXTENSION, res);
- itemCount = SendMessage(g_listBox, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0);
ok (itemCount == itemCount_allDirs,
"DlgDirList() incorrectly filled the listbox! (expected %d got %d)\n",
itemCount_allDirs, itemCount);
for (i = 0; i < itemCount; i++) {
memset(pathBuffer, 0, MAX_PATH);
- SendMessage(g_listBox, LB_GETTEXT, i, (LPARAM)pathBuffer);
+ SendMessageA(g_listBox, LB_GETTEXT, i, (LPARAM)pathBuffer);
ok( pathBuffer[0] == '[' && pathBuffer[strlen(pathBuffer)-1] ==
']',
"Element %d (%s) does not fit requested [...]\n", i, pathBuffer);
}
@@ -1197,7 +1197,7 @@
/* Test DDL_DRIVES. At least on WinXP-SP2, this implies DDL_EXCLUSIVE */
strcpy(pathBuffer, "w*.c");
- res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL,
+ res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL,
DDL_DRIVES);
ok (res == 1, "DlgDirList(*.c, DDL_DRIVES) failed - 0x%08x\n",
GetLastError());
@@ -1206,7 +1206,7 @@
* have been added. Depending on the user setting, more drives might have
* been added.
*/
- itemCount = SendMessage(g_listBox, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0);
ok (itemCount >= 1,
"DlgDirList(DDL_DRIVES) filled with %d entries, expected at least
%d\n",
itemCount, 1);
@@ -1216,7 +1216,7 @@
for (i = 0; i < itemCount; i++) {
memset(pathBuffer, 0, MAX_PATH);
driveletter = '\0';
- SendMessage(g_listBox, LB_GETTEXT, i, (LPARAM)pathBuffer);
+ SendMessageA(g_listBox, LB_GETTEXT, i, (LPARAM)pathBuffer);
ok( strlen(pathBuffer) == 5, "Length of drive string is not 5\n" );
ok( sscanf(pathBuffer, "[-%c-]", &driveletter) == 1, "Element
%d (%s) does not fit [-X-]\n", i, pathBuffer);
ok( driveletter >= 'a' && driveletter <= 'z',
"Drive letter not in range a..z, got ascii %d\n", driveletter);
@@ -1229,17 +1229,17 @@
/* Test behavior when no files match the wildcard */
strcpy(pathBuffer, BAD_EXTENSION);
- res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL,
+ res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL,
DDL_DRIVES);
ok (res == 1, "DlgDirList(%s, DDL_DRIVES) returned %d expected 1\n",
BAD_EXTENSION, res);
- itemCount = SendMessage(g_listBox, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0);
ok (itemCount == itemCount_justDrives, "DlgDirList() incorrectly filled the
listbox!\n");
/* Test DDL_DIRECTORY|DDL_DRIVES. This does *not* imply DDL_EXCLUSIVE */
strcpy(pathBuffer, "w*.c");
- res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL,
+ res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL,
DDL_DIRECTORY|DDL_DRIVES);
ok (res == 1, "DlgDirList(*.c, DDL_DIRECTORY|DDL_DRIVES) failed -
0x%08x\n", GetLastError());
@@ -1247,7 +1247,7 @@
* be exactly the number of plain files, plus the number of mapped drives,
* plus one "[..]"
*/
- itemCount = SendMessage(g_listBox, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0);
ok (itemCount == itemCount_justFiles + itemCount_justDrives + itemCount_allDirs,
"DlgDirList(DDL_DIRECTORY|DDL_DRIVES) filled with %d entries, expected
%d\n",
itemCount, itemCount_justFiles + itemCount_justDrives + itemCount_allDirs);
@@ -1259,7 +1259,7 @@
for (i = 0; i < itemCount; i++) {
memset(pathBuffer, 0, MAX_PATH);
driveletter = '\0';
- SendMessage(g_listBox, LB_GETTEXT, i, (LPARAM)pathBuffer);
+ SendMessageA(g_listBox, LB_GETTEXT, i, (LPARAM)pathBuffer);
p = pathBuffer + strlen(pathBuffer);
if (sscanf(pathBuffer, "[-%c-]", &driveletter) == 1) {
ok( driveletter >= 'a' && driveletter <= 'z',
"Drive letter not in range a..z, got ascii %d\n", driveletter);
@@ -1273,11 +1273,11 @@
/* Test behavior when no files match the wildcard */
strcpy(pathBuffer, BAD_EXTENSION);
- res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL,
+ res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL,
DDL_DIRECTORY|DDL_DRIVES);
ok (res == 1, "DlgDirList(%s, DDL_DIRECTORY|DDL_DRIVES) returned %d expected
1\n", BAD_EXTENSION, res);
- itemCount = SendMessage(g_listBox, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0);
ok (itemCount == itemCount_justDrives + itemCount_allDirs,
"DlgDirList() incorrectly filled the listbox! (expected %d got %d)\n",
itemCount_justDrives + itemCount_allDirs, itemCount);
@@ -1286,12 +1286,12 @@
/* Test DDL_DIRECTORY|DDL_EXCLUSIVE. */
strcpy(pathBuffer, "w*.c");
- res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL,
+ res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL,
DDL_DIRECTORY|DDL_EXCLUSIVE);
ok (res == 1, "DlgDirList(*.c, DDL_DIRECTORY|DDL_EXCLUSIVE) failed -
0x%08x\n", GetLastError());
/* There should be exactly one element: "[..]" */
- itemCount = SendMessage(g_listBox, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0);
ok (itemCount == itemCount_allDirs,
"DlgDirList(DDL_DIRECTORY|DDL_EXCLUSIVE) filled with %d entries, expected
%d\n",
itemCount, itemCount_allDirs);
@@ -1299,28 +1299,28 @@
if (itemCount && GetCurrentDirectoryA( MAX_PATH, pathBuffer ) > 3) /*
there's no [..] in drive root */
{
memset(pathBuffer, 0, MAX_PATH);
- SendMessage(g_listBox, LB_GETTEXT, 0, (LPARAM)pathBuffer);
+ SendMessageA(g_listBox, LB_GETTEXT, 0, (LPARAM)pathBuffer);
ok( !strcmp(pathBuffer, "[..]"), "First (and only) element is not
[..]\n");
}
/* Test behavior when no files match the wildcard */
strcpy(pathBuffer, BAD_EXTENSION);
- res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL,
+ res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL,
DDL_DIRECTORY|DDL_EXCLUSIVE);
ok (res == 1, "DlgDirList(%s, DDL_DIRECTORY|DDL_EXCLUSIVE) returned %d expected
1\n", BAD_EXTENSION, res);
- itemCount = SendMessage(g_listBox, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0);
ok (itemCount == itemCount_allDirs, "DlgDirList() incorrectly filled the
listbox!\n");
/* Test DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE. */
strcpy(pathBuffer, "w*.c");
- res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL,
+ res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL,
DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE);
ok (res == 1, "DlgDirList(*.c, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE) failed -
0x%08x\n", GetLastError());
/* There should be no plain files on the listbox */
- itemCount = SendMessage(g_listBox, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0);
ok (itemCount == itemCount_justDrives + itemCount_allDirs,
"DlgDirList(DDL_DIRECTORY|DDL_EXCLUSIVE) filled with %d entries, expected
%d\n",
itemCount, itemCount_justDrives + itemCount_allDirs);
@@ -1328,7 +1328,7 @@
for (i = 0; i < itemCount; i++) {
memset(pathBuffer, 0, MAX_PATH);
driveletter = '\0';
- SendMessage(g_listBox, LB_GETTEXT, i, (LPARAM)pathBuffer);
+ SendMessageA(g_listBox, LB_GETTEXT, i, (LPARAM)pathBuffer);
if (sscanf(pathBuffer, "[-%c-]", &driveletter) == 1) {
ok( driveletter >= 'a' && driveletter <= 'z',
"Drive letter not in range a..z, got ascii %d\n", driveletter);
} else {
@@ -1339,25 +1339,25 @@
/* Test behavior when no files match the wildcard */
strcpy(pathBuffer, BAD_EXTENSION);
- res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL,
+ res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL,
DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE);
ok (res == 1, "DlgDirList(%s, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE) returned
%d expected 1\n", BAD_EXTENSION, res);
- itemCount = SendMessage(g_listBox, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0);
ok (itemCount == itemCount_justDrives + itemCount_allDirs,
"DlgDirList() incorrectly filled the listbox!\n");
/* Now test DlgDirSelectEx() in normal operation */
/* Fill with everything - drives, directory and all plain files. */
strcpy(pathBuffer, "*");
- res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL,
+ res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL,
DDL_DIRECTORY|DDL_DRIVES);
ok (res != 0, "DlgDirList(*, DDL_DIRECTORY|DDL_DRIVES) failed - 0x%08x\n",
GetLastError());
- SendMessage(g_listBox, LB_SETCURSEL, -1, 0); /* Unselect any current selection */
+ SendMessageA(g_listBox, LB_SETCURSEL, -1, 0); /* Unselect any current selection */
memset(pathBuffer, 0, MAX_PATH);
SetLastError(0xdeadbeef);
- res = DlgDirSelectEx(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX);
+ res = DlgDirSelectExA(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX);
ok (GetLastError() == 0xdeadbeef,
"DlgDirSelectEx() with no selection modified last error code from 0xdeadbeef
to 0x%08x\n",
GetLastError());
@@ -1367,19 +1367,19 @@
ok (strlen(pathBuffer) == 0, "DlgDirSelectEx() with no selection filled buffer
with %s\n", pathBuffer);
*/
/* Test proper drive/dir/file recognition */
- itemCount = SendMessage(g_listBox, LB_GETCOUNT, 0, 0);
+ itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0);
for (i = 0; i < itemCount; i++) {
memset(itemBuffer, 0, MAX_PATH);
memset(pathBuffer, 0, MAX_PATH);
memset(tempBuffer, 0, MAX_PATH);
driveletter = '\0';
- SendMessage(g_listBox, LB_GETTEXT, i, (LPARAM)itemBuffer);
- res = SendMessage(g_listBox, LB_SETCURSEL, i, 0);
- ok (res == i, "SendMessage(LB_SETCURSEL, %d) failed\n", i);
+ SendMessageA(g_listBox, LB_GETTEXT, i, (LPARAM)itemBuffer);
+ res = SendMessageA(g_listBox, LB_SETCURSEL, i, 0);
+ ok (res == i, "SendMessageA(LB_SETCURSEL, %d) failed\n", i);
if (sscanf(itemBuffer, "[-%c-]", &driveletter) == 1) {
/* Current item is a drive letter */
SetLastError(0xdeadbeef);
- res = DlgDirSelectEx(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX);
+ res = DlgDirSelectExA(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX);
ok (GetLastError() == 0xdeadbeef,
"DlgDirSelectEx() with selection at %d modified last error code from
0xdeadbeef to 0x%08x\n",
i, GetLastError());
@@ -1391,7 +1391,7 @@
} else if (itemBuffer[0] == '[') {
/* Current item is the parent directory */
SetLastError(0xdeadbeef);
- res = DlgDirSelectEx(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX);
+ res = DlgDirSelectExA(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX);
ok (GetLastError() == 0xdeadbeef,
"DlgDirSelectEx() with selection at %d modified last error code from
0xdeadbeef to 0x%08x\n",
i, GetLastError());
@@ -1402,13 +1402,13 @@
ok (*(p-1) == '\\', "DlgDirSelectEx did NOT tack on a backslash
to dir, got %s\n", pathBuffer);
tempBuffer[0] = '[';
- strncpy(tempBuffer + 1, pathBuffer, strlen(pathBuffer) - 1);
+ lstrcpynA(tempBuffer + 1, pathBuffer, strlen(pathBuffer));
strcat(tempBuffer, "]");
ok (!strcmp(tempBuffer, itemBuffer), "Formatted directory should be %s,
got %s\n", tempBuffer, itemBuffer);
} else {
/* Current item is a plain file */
SetLastError(0xdeadbeef);
- res = DlgDirSelectEx(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX);
+ res = DlgDirSelectExA(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX);
ok (GetLastError() == 0xdeadbeef,
"DlgDirSelectEx() with selection at %d modified last error code from
0xdeadbeef to 0x%08x\n",
i, GetLastError());
@@ -1427,22 +1427,22 @@
/* Now test DlgDirSelectEx() in abnormal operation */
/* Fill list with bogus entries, that look somewhat valid */
- SendMessage(g_listBox, LB_RESETCONTENT, 0, 0);
- SendMessage(g_listBox, LB_ADDSTRING, 0, (LPARAM)"[notexist.dir]");
- SendMessage(g_listBox, LB_ADDSTRING, 0, (LPARAM)"notexist.fil");
- itemCount = SendMessage(g_listBox, LB_GETCOUNT, 0, 0);
+ SendMessageA(g_listBox, LB_RESETCONTENT, 0, 0);
+ SendMessageA(g_listBox, LB_ADDSTRING, 0, (LPARAM)"[notexist.dir]");
+ SendMessageA(g_listBox, LB_ADDSTRING, 0, (LPARAM)"notexist.fil");
+ itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0);
for (i = 0; i < itemCount; i++) {
memset(itemBuffer, 0, MAX_PATH);
memset(pathBuffer, 0, MAX_PATH);
memset(tempBuffer, 0, MAX_PATH);
driveletter = '\0';
- SendMessage(g_listBox, LB_GETTEXT, i, (LPARAM)itemBuffer);
- res = SendMessage(g_listBox, LB_SETCURSEL, i, 0);
+ SendMessageA(g_listBox, LB_GETTEXT, i, (LPARAM)itemBuffer);
+ res = SendMessageA(g_listBox, LB_SETCURSEL, i, 0);
ok (res == i, "SendMessage(LB_SETCURSEL, %d) failed\n", i);
if (sscanf(itemBuffer, "[-%c-]", &driveletter) == 1) {
/* Current item is a drive letter */
SetLastError(0xdeadbeef);
- res = DlgDirSelectEx(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX);
+ res = DlgDirSelectExA(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX);
ok (GetLastError() == 0xdeadbeef,
"DlgDirSelectEx() with selection at %d modified last error code from
0xdeadbeef to 0x%08x\n",
i, GetLastError());
@@ -1454,7 +1454,7 @@
} else if (itemBuffer[0] == '[') {
/* Current item is the parent directory */
SetLastError(0xdeadbeef);
- res = DlgDirSelectEx(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX);
+ res = DlgDirSelectExA(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX);
ok (GetLastError() == 0xdeadbeef,
"DlgDirSelectEx() with selection at %d modified last error code from
0xdeadbeef to 0x%08x\n",
i, GetLastError());
@@ -1465,13 +1465,13 @@
ok (*(p-1) == '\\', "DlgDirSelectEx did NOT tack on a backslash
to dir, got %s\n", pathBuffer);
tempBuffer[0] = '[';
- strncpy(tempBuffer + 1, pathBuffer, strlen(pathBuffer) - 1);
+ lstrcpynA(tempBuffer + 1, pathBuffer, strlen(pathBuffer));
strcat(tempBuffer, "]");
ok (!strcmp(tempBuffer, itemBuffer), "Formatted directory should be %s,
got %s\n", tempBuffer, itemBuffer);
} else {
/* Current item is a plain file */
SetLastError(0xdeadbeef);
- res = DlgDirSelectEx(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX);
+ res = DlgDirSelectExA(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX);
ok (GetLastError() == 0xdeadbeef,
"DlgDirSelectEx() with selection at %d modified last error code from
0xdeadbeef to 0x%08x\n",
i, GetLastError());
@@ -1488,13 +1488,13 @@
/* Test behavior when loading folders from root with and without wildcard */
strcpy(pathBuffer, "C:\\");
- res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, 0, DDL_DIRECTORY |
DDL_EXCLUSIVE);
+ res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, 0, DDL_DIRECTORY |
DDL_EXCLUSIVE);
ok(res || broken(!res) /* NT4/W2K */, "DlgDirList failed to list C:\\
folders\n");
todo_wine ok(!strcmp(pathBuffer, "*") || broken(!res) /* NT4/W2K */,
"DlgDirList set the invalid path spec '%s', expected
'*'\n", pathBuffer);
strcpy(pathBuffer, "C:\\*");
- res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, 0, DDL_DIRECTORY |
DDL_EXCLUSIVE);
+ res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, 0, DDL_DIRECTORY |
DDL_EXCLUSIVE);
ok(res || broken(!res) /* NT4/W2K */, "DlgDirList failed to list C:\\*
folders\n");
ok(!strcmp(pathBuffer, "*") || broken(!res) /* NT4/W2K */,
"DlgDirList set the invalid path spec '%s', expected
'*'\n", pathBuffer);
@@ -1502,7 +1502,7 @@
/* Try loading files from an invalid folder */
SetLastError(0xdeadbeef);
strcpy(pathBuffer, "C:\\INVALID$$DIR");
- res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, 0, DDL_DIRECTORY |
DDL_EXCLUSIVE);
+ res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, 0, DDL_DIRECTORY |
DDL_EXCLUSIVE);
todo_wine ok(!res, "DlgDirList should have failed with 0 but %d was
returned\n", res);
todo_wine ok(GetLastError() == ERROR_NO_WILDCARD_CHARACTERS,
"GetLastError should return 0x589, got 0x%X\n",GetLastError());
@@ -1523,9 +1523,9 @@
GetUpdateRect( listbox, &r, TRUE );
ok( IsRectEmpty( &r ), "got non-empty rect\n");
- ret = SendMessage( listbox, LB_SETCOUNT, 100, 0 );
+ ret = SendMessageA( listbox, LB_SETCOUNT, 100, 0 );
ok( ret == 0, "got %d\n", ret );
- ret = SendMessage( listbox, LB_GETCOUNT, 0, 0 );
+ ret = SendMessageA( listbox, LB_GETCOUNT, 0, 0 );
ok( ret == 100, "got %d\n", ret );
GetUpdateRect( listbox, &r, TRUE );
@@ -1535,7 +1535,7 @@
GetUpdateRect( listbox, &r, TRUE );
ok( IsRectEmpty( &r ), "got non-empty rect\n");
- ret = SendMessage( listbox, LB_SETCOUNT, 99, 0 );
+ ret = SendMessageA( listbox, LB_SETCOUNT, 99, 0 );
ok( ret == 0, "got %d\n", ret );
GetUpdateRect( listbox, &r, TRUE );
@@ -1564,7 +1564,7 @@
WNDPROC oldproc;
DWORD ret;
- pGetListBoxInfo = (void*)GetProcAddress(GetModuleHandle("user32"),
"GetListBoxInfo");
+ pGetListBoxInfo = (void*)GetProcAddress(GetModuleHandleA("user32.dll"),
"GetListBoxInfo");
if (!pGetListBoxInfo)
{