create_listbox (DWORD add_style, HWND parent)
{
HWND handle;
- int ctl_id=0;
+ INT_PTR ctl_id=0;
if (parent)
ctl_id=1;
handle=CreateWindow ("LISTBOX", "TestList",
parent, (HMENU)ctl_id, NULL, 0);
assert (handle);
- SendMessage (handle, LB_ADDSTRING, 0, (LPARAM) (LPCTSTR) strings[0]);
- SendMessage (handle, LB_ADDSTRING, 0, (LPARAM) (LPCTSTR) strings[1]);
- SendMessage (handle, LB_ADDSTRING, 0, (LPARAM) (LPCTSTR) strings[2]);
- SendMessage (handle, LB_ADDSTRING, 0, (LPARAM) (LPCTSTR) strings[3]);
+ 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]);
#ifdef VISIBLE
ShowWindow (handle, SW_SHOW);
cls.cbWndExtra = 0;
cls.hInstance = GetModuleHandle(0);
cls.hIcon = 0;
- cls.hCursor = LoadCursor(0, (LPSTR)IDC_ARROW);
+ cls.hCursor = LoadCursor(0, IDC_ARROW);
cls.hbrBackground = GetStockObject(WHITE_BRUSH);
cls.lpszMenuName = NULL;
cls.lpszClassName = "main_window_class";
hLB = create_listbox(LBS_OWNERDRAWFIXED | WS_CHILD | WS_VISIBLE, parent);
assert(hLB);
+ SetForegroundWindow(hLB);
UpdateWindow(hLB);
/* make height short enough */
char pathBuffer[MAX_PATH];
char * p;
char driveletter;
+ const char *wildcard = "*";
HANDLE file;
file = CreateFileA( "wtest1.tmp.c", GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL );
/* Test for standard usage */
/* This should list all the files in the test directory. */
- strcpy(pathBuffer, "*");
+ strcpy(pathBuffer, wildcard);
SendMessage(hList, LB_RESETCONTENT, 0, 0);
res = SendMessage(hList, LB_DIR, 0, (LPARAM)pathBuffer);
if (res == -1) /* "*" wildcard doesn't work on win9x */
{
- strcpy(pathBuffer, "*.*");
+ wildcard = "*.*";
+ strcpy(pathBuffer, wildcard);
res = SendMessage(hList, LB_DIR, 0, (LPARAM)pathBuffer);
}
ok (res >= 0, "SendMessage(LB_DIR, 0, *) failed - 0x%08x\n", GetLastError());
}
/* Test DDL_DIRECTORY */
- strcpy(pathBuffer, "*");
+ strcpy(pathBuffer, wildcard);
SendMessage(hList, LB_RESETCONTENT, 0, 0);
res = SendMessage(hList, LB_DIR, DDL_DIRECTORY, (LPARAM)pathBuffer);
- if (res == -1 || res <= itemCount_allFiles) /* "*" wildcard doesn't work on win9x */
- {
- strcpy(pathBuffer, "*.*");
- SendMessage(hList, LB_RESETCONTENT, 0, 0);
- res = SendMessage(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.
/* Test DDL_DRIVES|DDL_EXCLUSIVE */
- strcpy(pathBuffer, "*");
+ strcpy(pathBuffer, wildcard);
SendMessage(hList, LB_RESETCONTENT, 0, 0);
res = SendMessage(hList, LB_DIR, DDL_DRIVES|DDL_EXCLUSIVE, (LPARAM)pathBuffer);
ok (res >= 0, "SendMessage(LB_DIR, DDL_DRIVES|DDL_EXCLUSIVE, *) failed - 0x%08x\n", GetLastError());
itemCount_justFiles, itemCount_justDrives);
/* Test DDL_DRIVES. */
- strcpy(pathBuffer, "*");
+ strcpy(pathBuffer, wildcard);
SendMessage(hList, LB_RESETCONTENT, 0, 0);
res = SendMessage(hList, LB_DIR, DDL_DRIVES, (LPARAM)pathBuffer);
ok (res > 0, "SendMessage(LB_DIR, DDL_DRIVES, *) failed - 0x%08x\n", GetLastError());
* been added.
*/
itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0);
- ok (itemCount == itemCount_justDrives + itemCount_allFiles ||
- broken(itemCount == itemCount_justDrives), /* "*" wildcard broken on win9x */
+ ok (itemCount == itemCount_justDrives + itemCount_allFiles,
"SendMessage(LB_DIR, DDL_DRIVES, *) filled with %d entries, expected %d\n",
itemCount, itemCount_justDrives + itemCount_allFiles);
ok(res + 1 == itemCount, "SendMessage(LB_DIR, DDL_DRIVES, *) returned incorrect index!\n");
/* Test DDL_DIRECTORY|DDL_DRIVES. This does *not* imply DDL_EXCLUSIVE */
- strcpy(pathBuffer, "*");
+ strcpy(pathBuffer, wildcard);
SendMessage(hList, LB_RESETCONTENT, 0, 0);
res = SendMessage(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES, (LPARAM)pathBuffer);
ok (res > 0, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES, *) failed - 0x%08x\n", GetLastError());
* be exactly the number of plain files, plus the number of mapped drives.
*/
itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0);
- ok (itemCount == itemCount_allFiles + itemCount_justDrives + itemCount_allDirs ||
- broken(itemCount == itemCount_justDrives + itemCount_allDirs), /* "*" wildcard broken on win9x */
+ 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);
ok(res + 1 == itemCount, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES, w*.c) returned incorrect index!\n");
}
/* Test DDL_DIRECTORY|DDL_EXCLUSIVE. */
- strcpy(pathBuffer, "*");
+ strcpy(pathBuffer, wildcard);
SendMessage(hList, LB_RESETCONTENT, 0, 0);
res = SendMessage(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, 0);
/* Test DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE. */
- strcpy(pathBuffer, "*");
+ strcpy(pathBuffer, wildcard);
SendMessage(hList, LB_RESETCONTENT, 0, 0);
res = SendMessage(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());