From 03535e5b35eaa09d6c5135fbb8801973e32ace3e Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Tue, 22 Apr 2014 14:05:48 +0000 Subject: [PATCH] [COMCTL32_WINETEST] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62880 --- rostests/winetests/comctl32/CMakeLists.txt | 1 + rostests/winetests/comctl32/button.c | 819 ++++++++++++ rostests/winetests/comctl32/comboex.c | 99 +- rostests/winetests/comctl32/datetime.c | 173 ++- rostests/winetests/comctl32/dpa.c | 20 +- rostests/winetests/comctl32/header.c | 302 +++-- rostests/winetests/comctl32/imagelist.c | 21 +- rostests/winetests/comctl32/ipaddress.c | 18 +- rostests/winetests/comctl32/listview.c | 1326 ++++++++++---------- rostests/winetests/comctl32/misc.c | 6 +- rostests/winetests/comctl32/monthcal.c | 454 ++++--- rostests/winetests/comctl32/mru.c | 8 +- rostests/winetests/comctl32/msg.h | 2 +- rostests/winetests/comctl32/pager.c | 4 +- rostests/winetests/comctl32/progress.c | 34 +- rostests/winetests/comctl32/propsheet.c | 85 +- rostests/winetests/comctl32/rebar.c | 135 +- rostests/winetests/comctl32/status.c | 199 ++- rostests/winetests/comctl32/subclass.c | 82 +- rostests/winetests/comctl32/syslink.c | 6 +- rostests/winetests/comctl32/tab.c | 335 ++--- rostests/winetests/comctl32/testlist.c | 2 + rostests/winetests/comctl32/toolbar.c | 401 +++--- rostests/winetests/comctl32/tooltips.c | 144 ++- rostests/winetests/comctl32/trackbar.c | 402 +++--- rostests/winetests/comctl32/treeview.c | 464 ++++--- rostests/winetests/comctl32/updown.c | 150 ++- rostests/winetests/comctl32/v6util.h | 11 + 28 files changed, 3359 insertions(+), 2344 deletions(-) create mode 100644 rostests/winetests/comctl32/button.c diff --git a/rostests/winetests/comctl32/CMakeLists.txt b/rostests/winetests/comctl32/CMakeLists.txt index dbfd6a36642..9b0e6e88b17 100644 --- a/rostests/winetests/comctl32/CMakeLists.txt +++ b/rostests/winetests/comctl32/CMakeLists.txt @@ -4,6 +4,7 @@ remove_definitions(-D_WIN32_WINNT=0x502 -D_WIN32_IE=0x600) add_definitions(-DUSE_WINE_TODOS) list(APPEND SOURCE + button.c comboex.c datetime.c dpa.c diff --git a/rostests/winetests/comctl32/button.c b/rostests/winetests/comctl32/button.c new file mode 100644 index 00000000000..82cd3c0445a --- /dev/null +++ b/rostests/winetests/comctl32/button.c @@ -0,0 +1,819 @@ +/* Unit test suite for Button control. + * + * Copyright 1999 Ove Kaaven + * Copyright 2003 Dimitrie O. Paun + * Copyright 2004, 2005 Dmitry Timoshkov + * Copyright 2014 Nikolay Sivov for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +//#include +#include +#include +#include +#include +#include +#include + +#include "wine/test.h" +#include "v6util.h" +#include "msg.h" + +#define IS_WNDPROC_HANDLE(x) (((ULONG_PTR)(x) >> 16) == (~0u >> 16)) + +static BOOL (WINAPI *pSetWindowSubclass)(HWND, SUBCLASSPROC, UINT_PTR, DWORD_PTR); +static BOOL (WINAPI *pRemoveWindowSubclass)(HWND, SUBCLASSPROC, UINT_PTR); +static LRESULT (WINAPI *pDefSubclassProc)(HWND, UINT, WPARAM, LPARAM); + +/****************** button message test *************************/ +#define ID_BUTTON 0x000e + +#define COMBINED_SEQ_INDEX 0 +#define NUM_MSG_SEQUENCES 1 + +static struct msg_sequence *sequences[NUM_MSG_SEQUENCES]; + +struct wndclass_redirect_data +{ + ULONG size; + DWORD res; + ULONG name_len; + ULONG name_offset; + ULONG module_len; + ULONG module_offset; +}; + +/* returned pointer is valid as long as activation context is alive */ +static WCHAR* get_versioned_classname(const WCHAR *name) +{ + BOOL (WINAPI *pFindActCtxSectionStringW)(DWORD,const GUID *,ULONG,LPCWSTR,PACTCTX_SECTION_KEYED_DATA); + struct wndclass_redirect_data *wnddata; + ACTCTX_SECTION_KEYED_DATA data; + BOOL ret; + + pFindActCtxSectionStringW = (void*)GetProcAddress(GetModuleHandleA("kernel32"), "FindActCtxSectionStringW"); + + memset(&data, 0, sizeof(data)); + data.cbSize = sizeof(data); + + ret = pFindActCtxSectionStringW(0, NULL, + ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, + name, &data); + ok(ret, "got %d, error %u\n", ret, GetLastError()); + wnddata = (struct wndclass_redirect_data*)data.lpData; + return (WCHAR*)((BYTE*)wnddata + wnddata->name_offset); +} + +static void init_functions(void) +{ + HMODULE hmod = GetModuleHandleA("comctl32.dll"); + ok(hmod != NULL, "got %p\n", hmod); + +#define MAKEFUNC_ORD(f, ord) (p##f = (void*)GetProcAddress(hmod, (LPSTR)(ord))) + MAKEFUNC_ORD(SetWindowSubclass, 410); + MAKEFUNC_ORD(RemoveWindowSubclass, 412); + MAKEFUNC_ORD(DefSubclassProc, 413); +#undef MAKEFUNC_ORD +} + +/* try to make sure pending X events have been processed before continuing */ +static void flush_events(void) +{ + MSG msg; + int diff = 200; + int min_timeout = 100; + DWORD time = GetTickCount() + diff; + + while (diff > 0) + { + if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min_timeout, QS_ALLINPUT ) == WAIT_TIMEOUT) break; + while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); + diff = time - GetTickCount(); + } +} + +static BOOL ignore_message( UINT message ) +{ + /* these are always ignored */ + return (message >= 0xc000 || + message == WM_GETICON || + message == WM_GETOBJECT || + message == WM_TIMECHANGE || + message == WM_DISPLAYCHANGE || + message == WM_DEVICECHANGE || + message == WM_DWMNCRENDERINGCHANGED || + message == WM_GETTEXTLENGTH || + message == WM_GETTEXT); +} + +static LRESULT CALLBACK button_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, UINT_PTR id, DWORD_PTR ref_data) +{ + static LONG defwndproc_counter = 0; + LRESULT ret; + struct message msg; + + if (ignore_message( message )) return pDefSubclassProc(hwnd, message, wParam, lParam); + + switch (message) + { + case WM_SYNCPAINT: + break; + case BM_SETSTATE: + if (GetCapture()) + ok(GetCapture() == hwnd, "GetCapture() = %p\n", GetCapture()); + /* fall through */ + default: + msg.message = message; + msg.flags = sent|wparam|lparam; + if (defwndproc_counter) msg.flags |= defwinproc; + msg.wParam = wParam; + msg.lParam = lParam; + add_message(sequences, COMBINED_SEQ_INDEX, &msg); + } + + if (message == WM_NCDESTROY) + pRemoveWindowSubclass(hwnd, button_subclass_proc, 0); + + defwndproc_counter++; + ret = pDefSubclassProc(hwnd, message, wParam, lParam); + defwndproc_counter--; + + return ret; +} + +static LRESULT WINAPI test_parent_wndproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + static LONG defwndproc_counter = 0; + static LONG beginpaint_counter = 0; + LRESULT ret; + struct message msg; + + if (ignore_message( message )) return 0; + + if (message == WM_PARENTNOTIFY || message == WM_CANCELMODE || + message == WM_SETFOCUS || message == WM_KILLFOCUS || + message == WM_ENABLE || message == WM_ENTERIDLE || + message == WM_DRAWITEM || message == WM_COMMAND || + message == WM_IME_SETCONTEXT) + { + switch (message) + { + /* ignore */ + case WM_NCHITTEST: + return HTCLIENT; + case WM_SETCURSOR: + case WM_MOUSEMOVE: + case WM_NCMOUSEMOVE: + return 0; + } + + msg.message = message; + msg.flags = sent|parent|wparam|lparam; + if (defwndproc_counter) msg.flags |= defwinproc; + if (beginpaint_counter) msg.flags |= beginpaint; + msg.wParam = wParam; + msg.lParam = lParam; + add_message(sequences, COMBINED_SEQ_INDEX, &msg); + } + + if (message == WM_PAINT) + { + PAINTSTRUCT ps; + beginpaint_counter++; + BeginPaint( hwnd, &ps ); + beginpaint_counter--; + EndPaint( hwnd, &ps ); + return 0; + } + + defwndproc_counter++; + ret = DefWindowProcA(hwnd, message, wParam, lParam); + defwndproc_counter--; + + return ret; +} + +static const struct message setfocus_seq[] = +{ + { WM_IME_SETCONTEXT, sent|wparam|optional, 1 }, + { WM_IME_NOTIFY, sent|wparam|defwinproc|optional, 2 }, + { WM_SETFOCUS, sent|wparam }, + { WM_COMMAND, sent|wparam|parent, MAKEWPARAM(ID_BUTTON, BN_SETFOCUS) }, + { WM_APP, sent|wparam|lparam }, + { WM_PAINT, sent }, + { 0 } +}; + +static const struct message killfocus_seq[] = +{ + { WM_KILLFOCUS, sent|wparam, 0 }, + { WM_COMMAND, sent|wparam|parent, MAKEWPARAM(ID_BUTTON, BN_KILLFOCUS) }, + { WM_IME_SETCONTEXT, sent|wparam|optional, 0 }, + { WM_IME_NOTIFY, sent|wparam|defwinproc|optional, 1 }, + { WM_APP, sent|wparam|lparam, 0, 0 }, + { WM_PAINT, sent }, + { 0 } +}; + +static const struct message setfocus_static_seq[] = +{ + { WM_IME_SETCONTEXT, sent|wparam|optional, 1 }, + { WM_IME_NOTIFY, sent|wparam|defwinproc|optional, 2 }, + { WM_SETFOCUS, sent|wparam, 0 }, + { WM_COMMAND, sent|wparam|parent, MAKEWPARAM(ID_BUTTON, BN_SETFOCUS) }, + { WM_COMMAND, sent|wparam|parent|optional, MAKEWPARAM(ID_BUTTON, BN_CLICKED) }, /* radio button */ + { WM_APP, sent|wparam|lparam, 0, 0 }, + { WM_PAINT, sent }, + { 0 } +}; + +static const struct message setfocus_groupbox_seq[] = +{ + { WM_IME_SETCONTEXT, sent|wparam|optional, 1 }, + { WM_IME_NOTIFY, sent|wparam|defwinproc|optional, 2 }, + { WM_SETFOCUS, sent|wparam, 0 }, + { WM_COMMAND, sent|wparam|parent, MAKEWPARAM(ID_BUTTON, BN_SETFOCUS) }, + { WM_COMMAND, sent|wparam|parent|optional, MAKEWPARAM(ID_BUTTON, BN_CLICKED) }, /* radio button */ + { WM_APP, sent|wparam|lparam, 0, 0 }, + { WM_PAINT, sent }, + { 0 } +}; + +static const struct message killfocus_static_seq[] = +{ + { WM_KILLFOCUS, sent|wparam, 0 }, + { WM_COMMAND, sent|wparam|parent, MAKEWPARAM(ID_BUTTON, BN_KILLFOCUS) }, + { WM_IME_SETCONTEXT, sent|wparam|optional, 0 }, + { WM_IME_NOTIFY, sent|wparam|defwinproc|optional, 1 }, + { WM_APP, sent|wparam|lparam, 0, 0 }, + { WM_PAINT, sent }, + { 0 } +}; + +static const struct message setfocus_ownerdraw_seq[] = +{ + { WM_IME_SETCONTEXT, sent|wparam|optional, 1 }, + { WM_IME_NOTIFY, sent|wparam|defwinproc|optional, 2 }, + { WM_SETFOCUS, sent|wparam, 0 }, + { WM_DRAWITEM, sent|wparam|parent, ID_BUTTON }, + { WM_COMMAND, sent|wparam|parent, MAKEWPARAM(ID_BUTTON, BN_SETFOCUS) }, + { WM_APP, sent|wparam|lparam, 0, 0 }, + { WM_IME_SETCONTEXT, sent|wparam|optional, 1 }, + { 0 } +}; + +static const struct message killfocus_ownerdraw_seq[] = +{ + { WM_KILLFOCUS, sent|wparam, 0 }, + { WM_COMMAND, sent|wparam|parent, MAKEWPARAM(ID_BUTTON, BN_KILLFOCUS) }, + { WM_IME_SETCONTEXT, sent|wparam|optional, 0 }, + { WM_IME_NOTIFY, sent|wparam|defwinproc|optional, 1 }, + { WM_APP, sent|wparam|lparam, 0, 0 }, + { WM_PAINT, sent }, + { WM_DRAWITEM, sent|wparam|parent, ID_BUTTON }, + { 0 } +}; + +static const struct message lbuttondown_seq[] = +{ + { WM_LBUTTONDOWN, sent|wparam|lparam, 0, 0 }, + { WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 }, + { WM_IME_NOTIFY, sent|wparam|defwinproc|optional, 2 }, + { WM_SETFOCUS, sent|wparam|defwinproc, 0 }, + { BM_SETSTATE, sent|wparam|defwinproc, TRUE }, + { 0 } +}; + +static const struct message lbuttonup_seq[] = +{ + { WM_LBUTTONUP, sent|wparam|lparam, 0, 0 }, + { BM_SETSTATE, sent|wparam|defwinproc, FALSE }, + { WM_CAPTURECHANGED, sent|wparam|defwinproc, 0 }, + { WM_COMMAND, sent|wparam|defwinproc, 0 }, + { 0 } +}; + +static const struct message setfont_seq[] = +{ + { WM_SETFONT, sent }, + { 0 } +}; + +static const struct message setstyle_seq[] = +{ + { BM_SETSTYLE, sent }, + { WM_STYLECHANGING, sent|wparam|defwinproc, GWL_STYLE }, + { WM_STYLECHANGED, sent|wparam|defwinproc, GWL_STYLE }, + { WM_APP, sent|wparam|lparam, 0, 0 }, + { WM_PAINT, sent }, + { WM_NCPAINT, sent|defwinproc|optional }, /* FIXME: Wine sends it */ + { WM_ERASEBKGND, sent|defwinproc|optional }, + { 0 } +}; + +static const struct message setstyle_static_seq[] = +{ + { BM_SETSTYLE, sent }, + { WM_STYLECHANGING, sent|wparam|defwinproc, GWL_STYLE }, + { WM_STYLECHANGED, sent|wparam|defwinproc, GWL_STYLE }, + { WM_APP, sent|wparam|lparam, 0, 0 }, + { WM_PAINT, sent }, + { WM_NCPAINT, sent|defwinproc|optional }, /* FIXME: Wine sends it */ + { WM_ERASEBKGND, sent|defwinproc|optional }, + { 0 } +}; + +static const struct message setstyle_user_seq[] = +{ + { BM_SETSTYLE, sent }, + { WM_STYLECHANGING, sent|wparam|defwinproc, GWL_STYLE }, + { WM_STYLECHANGED, sent|wparam|defwinproc, GWL_STYLE }, + { WM_APP, sent|wparam|lparam, 0, 0 }, + { WM_PAINT, sent }, + { WM_NCPAINT, sent|defwinproc|optional }, /* FIXME: Wine sends it */ + { WM_ERASEBKGND, sent|defwinproc|optional }, + { 0 } +}; + +static const struct message setstyle_ownerdraw_seq[] = +{ + { BM_SETSTYLE, sent }, + { WM_STYLECHANGING, sent|wparam|defwinproc, GWL_STYLE }, + { WM_STYLECHANGED, sent|wparam|defwinproc, GWL_STYLE }, + { WM_APP, sent|wparam|lparam, 0, 0 }, + { WM_PAINT, sent }, + { WM_NCPAINT, sent|optional }, /* FIXME: Wine sends it */ + { WM_ERASEBKGND, sent|defwinproc|optional }, + { WM_DRAWITEM, sent|wparam|parent, ID_BUTTON }, + { 0 } +}; + +static const struct message setstate_seq[] = +{ + { BM_SETSTATE, sent }, + { WM_APP, sent|wparam|lparam, 0, 0 }, + { WM_PAINT, sent }, + { WM_NCPAINT, sent|optional }, /* FIXME: Wine sends it */ + { WM_ERASEBKGND, sent|defwinproc|optional }, + { 0 } +}; + +static const struct message setstate_static_seq[] = +{ + { BM_SETSTATE, sent }, + { WM_APP, sent|wparam|lparam, 0, 0 }, + { WM_PAINT, sent }, + { WM_NCPAINT, sent|optional }, /* FIXME: Wine sends it */ + { WM_ERASEBKGND, sent|defwinproc|optional }, + { 0 } +}; + +static const struct message setstate_user_seq[] = +{ + { BM_SETSTATE, sent }, + { WM_COMMAND, sent|wparam|parent, MAKEWPARAM(ID_BUTTON, BN_HILITE) }, + { WM_APP, sent|wparam|lparam, 0, 0 }, + { WM_PAINT, sent }, + { WM_NCPAINT, sent|optional }, /* FIXME: Wine sends it */ + { WM_ERASEBKGND, sent|defwinproc|optional }, + { 0 } +}; + +static const struct message setstate_ownerdraw_seq[] = +{ + { BM_SETSTATE, sent }, + { WM_APP, sent|wparam|lparam, 0, 0 }, + { WM_PAINT, sent }, + { WM_NCPAINT, sent|optional }, /* FIXME: Wine sends it */ + { WM_ERASEBKGND, sent|defwinproc|optional }, + { WM_DRAWITEM, sent|wparam|parent, ID_BUTTON }, + { 0 } +}; + +static const struct message clearstate_seq[] = +{ + { BM_SETSTATE, sent }, + { WM_COMMAND, sent|wparam|parent, MAKEWPARAM(ID_BUTTON, BN_UNHILITE) }, + { WM_APP, sent|wparam|lparam, 0, 0 }, + { WM_PAINT, sent }, + { WM_NCPAINT, sent|optional }, /* FIXME: Wine sends it */ + { WM_ERASEBKGND, sent|defwinproc|optional }, + { 0 } +}; + +static const struct message clearstate_ownerdraw_seq[] = +{ + { BM_SETSTATE, sent }, + { WM_APP, sent|wparam|lparam, 0, 0 }, + { WM_PAINT, sent }, + { WM_NCPAINT, sent|optional }, /* FIXME: Wine sends it */ + { WM_ERASEBKGND, sent|defwinproc|optional }, + { WM_DRAWITEM, sent|wparam|parent, ID_BUTTON }, + { 0 } +}; + +static const struct message setcheck_ignored_seq[] = +{ + { BM_SETCHECK, sent }, + { WM_APP, sent|wparam|lparam, 0, 0 }, + { 0 } +}; + +static const struct message setcheck_uncheck_seq[] = +{ + { BM_SETCHECK, sent }, + { WM_APP, sent|wparam|lparam, 0, 0 }, + { 0 } +}; + +static const struct message setcheck_static_seq[] = +{ + { BM_SETCHECK, sent }, + { WM_APP, sent|wparam|lparam, 0, 0 }, + { WM_PAINT, sent }, + { WM_NCPAINT, sent|optional }, /* FIXME: Wine sends it */ + { WM_ERASEBKGND, sent|defwinproc|optional }, + { 0 } +}; + +static const struct message setcheck_radio_seq[] = +{ + { BM_SETCHECK, sent }, + { WM_STYLECHANGING, sent|wparam|defwinproc, GWL_STYLE }, + { WM_STYLECHANGED, sent|wparam|defwinproc, GWL_STYLE }, + { WM_APP, sent|wparam|lparam, 0, 0 }, + { 0 } +}; + +static const struct message setcheck_radio_redraw_seq[] = +{ + { BM_SETCHECK, sent }, + { WM_STYLECHANGING, sent|wparam|defwinproc, GWL_STYLE }, + { WM_STYLECHANGED, sent|wparam|defwinproc, GWL_STYLE }, + { WM_APP, sent|wparam|lparam, 0, 0 }, + { WM_PAINT, sent }, + { WM_NCPAINT, sent|optional }, /* FIXME: Wine sends it */ + { WM_ERASEBKGND, sent|defwinproc|optional }, + { 0 } +}; + +static HWND create_button(DWORD style, HWND parent) +{ + HMENU menuid = 0; + HWND hwnd; + + if (parent) + { + style |= WS_CHILD|BS_NOTIFY; + menuid = (HMENU)ID_BUTTON; + } + hwnd = CreateWindowExA(0, "Button", "test", style, 0, 0, 50, 14, parent, menuid, 0, NULL); + ok(hwnd != NULL, "failed to create a button, 0x%08x, %p\n", style, parent); + pSetWindowSubclass(hwnd, button_subclass_proc, 0, 0); + return hwnd; +} + +static void test_button_messages(void) +{ + static const struct + { + DWORD style; + DWORD dlg_code; + const struct message *setfocus; + const struct message *killfocus; + const struct message *setstyle; + const struct message *setstate; + const struct message *clearstate; + const struct message *setcheck; + } button[] = { + { BS_PUSHBUTTON, DLGC_BUTTON | DLGC_UNDEFPUSHBUTTON, + setfocus_seq, killfocus_seq, setstyle_seq, + setstate_seq, setstate_seq, setcheck_ignored_seq }, + { BS_DEFPUSHBUTTON, DLGC_BUTTON | DLGC_DEFPUSHBUTTON, + setfocus_seq, killfocus_seq, setstyle_seq, + setstate_seq, setstate_seq, setcheck_ignored_seq }, + { BS_CHECKBOX, DLGC_BUTTON, + setfocus_static_seq, killfocus_static_seq, setstyle_static_seq, + setstate_static_seq, setstate_static_seq, setcheck_static_seq }, + { BS_AUTOCHECKBOX, DLGC_BUTTON, + setfocus_static_seq, killfocus_static_seq, setstyle_static_seq, + setstate_static_seq, setstate_static_seq, setcheck_static_seq }, + { BS_RADIOBUTTON, DLGC_BUTTON | DLGC_RADIOBUTTON, + setfocus_static_seq, killfocus_static_seq, setstyle_static_seq, + setstate_static_seq, setstate_static_seq, setcheck_radio_redraw_seq }, + { BS_3STATE, DLGC_BUTTON, + setfocus_static_seq, killfocus_static_seq, setstyle_static_seq, + setstate_static_seq, setstate_static_seq, setcheck_static_seq }, + { BS_AUTO3STATE, DLGC_BUTTON, + setfocus_static_seq, killfocus_static_seq, setstyle_static_seq, + setstate_static_seq, setstate_static_seq, setcheck_static_seq }, + { BS_GROUPBOX, DLGC_STATIC, + setfocus_groupbox_seq, killfocus_static_seq, setstyle_static_seq, + setstate_static_seq, setstate_static_seq, setcheck_ignored_seq }, + { BS_USERBUTTON, DLGC_BUTTON | DLGC_UNDEFPUSHBUTTON, + setfocus_seq, killfocus_seq, setstyle_user_seq, + setstate_user_seq, clearstate_seq, setcheck_ignored_seq }, + { BS_AUTORADIOBUTTON, DLGC_BUTTON | DLGC_RADIOBUTTON, + setfocus_static_seq, killfocus_static_seq, setstyle_static_seq, + setstate_static_seq, setstate_static_seq, setcheck_radio_redraw_seq }, + { BS_OWNERDRAW, DLGC_BUTTON, + setfocus_ownerdraw_seq, killfocus_ownerdraw_seq, setstyle_ownerdraw_seq, + setstate_ownerdraw_seq, clearstate_ownerdraw_seq, setcheck_ignored_seq }, + }; + const struct message *seq; + unsigned int i; + HWND hwnd, parent; + DWORD dlg_code; + HFONT zfont; + BOOL todo; + + /* selection with VK_SPACE should capture button window */ + hwnd = create_button(BS_CHECKBOX | WS_VISIBLE | WS_POPUP, NULL); + ok(hwnd != 0, "Failed to create button window\n"); + ReleaseCapture(); + SetFocus(hwnd); + SendMessageA(hwnd, WM_KEYDOWN, VK_SPACE, 0); + ok(GetCapture() == hwnd, "Should be captured on VK_SPACE WM_KEYDOWN\n"); + SendMessageA(hwnd, WM_KEYUP, VK_SPACE, 0); + DestroyWindow(hwnd); + + parent = CreateWindowExA(0, "TestParentClass", "Test parent", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 100, 100, 200, 200, 0, 0, 0, NULL); + ok(parent != 0, "Failed to create parent window\n"); + + for (i = 0; i < sizeof(button)/sizeof(button[0]); i++) + { + MSG msg; + DWORD style, state; + + trace("%d: button test sequence\n", i); + hwnd = create_button(button[i].style, parent); + + style = GetWindowLongA(hwnd, GWL_STYLE); + style &= ~(WS_CHILD | BS_NOTIFY); + /* XP turns a BS_USERBUTTON into BS_PUSHBUTTON */ + if (button[i].style == BS_USERBUTTON) + ok(style == BS_PUSHBUTTON, "expected style BS_PUSHBUTTON got %x\n", style); + else + ok(style == button[i].style, "expected style %x got %x\n", button[i].style, style); + + dlg_code = SendMessageA(hwnd, WM_GETDLGCODE, 0, 0); + ok(dlg_code == button[i].dlg_code, "%u: wrong dlg_code %08x\n", i, dlg_code); + + ShowWindow(hwnd, SW_SHOW); + UpdateWindow(hwnd); + SetFocus(0); + flush_events(); + SetFocus(0); + flush_sequences(sequences, NUM_MSG_SEQUENCES); + + todo = button[i].style != BS_OWNERDRAW; + ok(GetFocus() == 0, "expected focus 0, got %p\n", GetFocus()); + SetFocus(hwnd); + SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */ + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + ok_sequence(sequences, COMBINED_SEQ_INDEX, button[i].setfocus, "SetFocus(hwnd) on a button", todo); + + todo = button[i].style == BS_OWNERDRAW; + SetFocus(0); + SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */ + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + ok_sequence(sequences, COMBINED_SEQ_INDEX, button[i].killfocus, "SetFocus(0) on a button", todo); + ok(GetFocus() == 0, "expected focus 0, got %p\n", GetFocus()); + + SendMessageA(hwnd, BM_SETSTYLE, button[i].style | BS_BOTTOM, TRUE); + SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */ + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + ok_sequence(sequences, COMBINED_SEQ_INDEX, button[i].setstyle, "BM_SETSTYLE on a button", TRUE); + + style = GetWindowLongA(hwnd, GWL_STYLE); + style &= ~(WS_VISIBLE | WS_CHILD | BS_NOTIFY); + /* XP doesn't turn a BS_USERBUTTON into BS_PUSHBUTTON here! */ + ok(style == button[i].style, "expected style %04x got %04x\n", button[i].style, style); + + state = SendMessageA(hwnd, BM_GETSTATE, 0, 0); + ok(state == 0, "expected state 0, got %04x\n", state); + + flush_sequences(sequences, NUM_MSG_SEQUENCES); + + SendMessageA(hwnd, BM_SETSTATE, TRUE, 0); + SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */ + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + ok_sequence(sequences, COMBINED_SEQ_INDEX, button[i].setstate, "BM_SETSTATE/TRUE on a button", TRUE); + + state = SendMessageA(hwnd, BM_GETSTATE, 0, 0); + ok(state == BST_PUSHED, "expected state 0x0004, got %04x\n", state); + + style = GetWindowLongA(hwnd, GWL_STYLE); + style &= ~(WS_CHILD | BS_NOTIFY | WS_VISIBLE); + ok(style == button[i].style, "expected style %04x got %04x\n", button[i].style, style); + + flush_sequences(sequences, NUM_MSG_SEQUENCES); + + SendMessageA(hwnd, BM_SETSTATE, FALSE, 0); + SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */ + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + ok_sequence(sequences, COMBINED_SEQ_INDEX, button[i].clearstate, "BM_SETSTATE/FALSE on a button", TRUE); + + state = SendMessageA(hwnd, BM_GETSTATE, 0, 0); + ok(state == 0, "expected state 0, got %04x\n", state); + + style = GetWindowLongA(hwnd, GWL_STYLE); + style &= ~(WS_CHILD | BS_NOTIFY | WS_VISIBLE); + ok(style == button[i].style, "expected style %04x got %04x\n", button[i].style, style); + + state = SendMessageA(hwnd, BM_GETCHECK, 0, 0); + ok(state == BST_UNCHECKED, "expected BST_UNCHECKED, got %04x\n", state); + + flush_sequences(sequences, NUM_MSG_SEQUENCES); + + if (button[i].style == BS_RADIOBUTTON || + button[i].style == BS_AUTORADIOBUTTON) + { + seq = setcheck_radio_seq; + todo = TRUE; + } + else + { + seq = setcheck_ignored_seq; + todo = FALSE; + } + SendMessageA(hwnd, BM_SETCHECK, BST_UNCHECKED, 0); + SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */ + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + ok_sequence(sequences, COMBINED_SEQ_INDEX, seq, "BM_SETCHECK on a button", todo); + + state = SendMessageA(hwnd, BM_GETCHECK, 0, 0); + ok(state == BST_UNCHECKED, "expected BST_UNCHECKED, got %04x\n", state); + + style = GetWindowLongA(hwnd, GWL_STYLE); + style &= ~(WS_CHILD | BS_NOTIFY | WS_VISIBLE); + ok(style == button[i].style, "expected style %04x got %04x\n", button[i].style, style); + + flush_sequences(sequences, NUM_MSG_SEQUENCES); + + SendMessageA(hwnd, BM_SETCHECK, BST_CHECKED, 0); + SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */ + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + + if (button[i].style == BS_PUSHBUTTON || + button[i].style == BS_DEFPUSHBUTTON || + button[i].style == BS_GROUPBOX || + button[i].style == BS_USERBUTTON || + button[i].style == BS_OWNERDRAW) + { + ok_sequence(sequences, COMBINED_SEQ_INDEX, button[i].setcheck, "BM_SETCHECK on a button", FALSE); + state = SendMessageA(hwnd, BM_GETCHECK, 0, 0); + ok(state == BST_UNCHECKED, "expected check BST_UNCHECKED, got %04x\n", state); + } + else + { + ok_sequence(sequences, COMBINED_SEQ_INDEX, button[i].setcheck, "BM_SETCHECK on a button", TRUE); + state = SendMessageA(hwnd, BM_GETCHECK, 0, 0); + ok(state == BST_CHECKED, "expected check BST_CHECKED, got %04x\n", state); + } + + style = GetWindowLongA(hwnd, GWL_STYLE); + style &= ~(WS_CHILD | BS_NOTIFY | WS_VISIBLE); + if (button[i].style == BS_RADIOBUTTON || + button[i].style == BS_AUTORADIOBUTTON) + ok(style == (button[i].style | WS_TABSTOP), "expected style %04x | WS_TABSTOP got %04x\n", button[i].style, style); + else + ok(style == button[i].style, "expected style %04x got %04x\n", button[i].style, style); + + DestroyWindow(hwnd); + } + + DestroyWindow(parent); + + hwnd = create_button(BS_PUSHBUTTON, NULL); + + SetForegroundWindow(hwnd); + flush_events(); + + SetActiveWindow(hwnd); + SetFocus(0); + flush_sequences(sequences, NUM_MSG_SEQUENCES); + + SendMessageA(hwnd, WM_LBUTTONDOWN, 0, 0); + ok_sequence(sequences, COMBINED_SEQ_INDEX, lbuttondown_seq, "WM_LBUTTONDOWN on a button", FALSE); + + SendMessageA(hwnd, WM_LBUTTONUP, 0, 0); + ok_sequence(sequences, COMBINED_SEQ_INDEX, lbuttonup_seq, "WM_LBUTTONUP on a button", TRUE); + + flush_sequences(sequences, NUM_MSG_SEQUENCES); + zfont = GetStockObject(SYSTEM_FONT); + SendMessageA(hwnd, WM_SETFONT, (WPARAM)zfont, TRUE); + UpdateWindow(hwnd); + ok_sequence(sequences, COMBINED_SEQ_INDEX, setfont_seq, "WM_SETFONT on a button", FALSE); + + DestroyWindow(hwnd); +} + +static void test_button_class(void) +{ + static const WCHAR testW[] = {'t','e','s','t',0}; + WNDCLASSEXW exW, ex2W; + WNDCLASSEXA exA; + char buffA[100]; + WCHAR *nameW; + HWND hwnd; + BOOL ret; + int len; + + ret = GetClassInfoExA(NULL, WC_BUTTONA, &exA); + ok(ret, "got %d\n", ret); +todo_wine + ok(IS_WNDPROC_HANDLE(exA.lpfnWndProc), "got %p\n", exA.lpfnWndProc); + + ret = GetClassInfoExW(NULL, WC_BUTTONW, &exW); + ok(ret, "got %d\n", ret); + ok(!IS_WNDPROC_HANDLE(exW.lpfnWndProc), "got %p\n", exW.lpfnWndProc); + + /* check that versioned class is also accessible */ + nameW = get_versioned_classname(WC_BUTTONW); + ok(lstrcmpW(nameW, WC_BUTTONW), "got %s\n", wine_dbgstr_w(nameW)); + + ret = GetClassInfoExW(NULL, nameW, &ex2W); +todo_wine { + ok(ret, "got %d\n", ret); + ok(ex2W.lpfnWndProc == exW.lpfnWndProc, "got %p, %p\n", exW.lpfnWndProc, ex2W.lpfnWndProc); +} + + /* Check reported class name */ + hwnd = create_button(BS_CHECKBOX, NULL); + len = GetClassNameA(hwnd, buffA, sizeof(buffA)); + ok(len == strlen(buffA), "got %d\n", len); + ok(!strcmp(buffA, "Button"), "got %s\n", buffA); + + len = RealGetWindowClassA(hwnd, buffA, sizeof(buffA)); + ok(len == strlen(buffA), "got %d\n", len); + ok(!strcmp(buffA, "Button"), "got %s\n", buffA); + DestroyWindow(hwnd); + + /* explicitely create with versioned class name */ + hwnd = CreateWindowExW(0, nameW, testW, BS_CHECKBOX, 0, 0, 50, 14, NULL, 0, 0, NULL); +todo_wine + ok(hwnd != NULL, "failed to create a window %s\n", wine_dbgstr_w(nameW)); +if (hwnd) +{ + len = GetClassNameA(hwnd, buffA, sizeof(buffA)); + ok(len == strlen(buffA), "got %d\n", len); + ok(!strcmp(buffA, "Button"), "got %s\n", buffA); + + len = RealGetWindowClassA(hwnd, buffA, sizeof(buffA)); + ok(len == strlen(buffA), "got %d\n", len); + ok(!strcmp(buffA, "Button"), "got %s\n", buffA); + + DestroyWindow(hwnd); +} +} + +static void register_parent_class(void) +{ + WNDCLASSA cls; + + cls.style = 0; + cls.lpfnWndProc = test_parent_wndproc; + cls.cbClsExtra = 0; + cls.cbWndExtra = 0; + cls.hInstance = GetModuleHandleA(0); + cls.hIcon = 0; + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); + cls.hbrBackground = GetStockObject(WHITE_BRUSH); + cls.lpszMenuName = NULL; + cls.lpszClassName = "TestParentClass"; + RegisterClassA(&cls); +} + +START_TEST(button) +{ + ULONG_PTR ctx_cookie; + HANDLE hCtx; + + if (!load_v6_module(&ctx_cookie, &hCtx)) + return; + + register_parent_class(); + + init_functions(); + init_msg_sequences(sequences, NUM_MSG_SEQUENCES); + + test_button_class(); + test_button_messages(); + + unload_v6_module(ctx_cookie, hCtx); +} diff --git a/rostests/winetests/comctl32/comboex.c b/rostests/winetests/comctl32/comboex.c index 0f78bbec309..3e30558a6f1 100644 --- a/rostests/winetests/comctl32/comboex.c +++ b/rostests/winetests/comctl32/comboex.c @@ -53,37 +53,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) @@ -122,7 +122,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); @@ -133,15 +133,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); @@ -271,8 +269,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); @@ -286,19 +284,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 || @@ -307,11 +305,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 || @@ -319,17 +317,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 || @@ -337,11 +335,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); @@ -372,18 +370,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); @@ -477,7 +475,7 @@ static LRESULT CALLBACK ComboExTestWndProc(HWND hWnd, UINT msg, WPARAM wParam, L return 0L; } -static int init(void) +static BOOL init(void) { HMODULE hComctl32; BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*); @@ -489,7 +487,7 @@ static int init(void) if (!pInitCommonControlsEx) { win_skip("InitCommonControlsEx() is missing. Skipping the tests\n"); - return 0; + return FALSE; } iccex.dwSize = sizeof(iccex); iccex.dwICC = ICC_USEREX_CLASSES; @@ -502,7 +500,7 @@ static int init(void) wc.cbWndExtra = 0; wc.hInstance = GetModuleHandleA(NULL); wc.hIcon = NULL; - wc.hCursor = LoadCursorA(NULL, IDC_ARROW); + wc.hCursor = LoadCursorA(NULL, (LPCSTR)IDC_ARROW); wc.hbrBackground = GetSysColorBrush(COLOR_WINDOW); wc.lpszMenuName = NULL; wc.lpszClassName = ComboExTestClass; @@ -511,10 +509,11 @@ static int init(void) hComboExParentWnd = CreateWindowExA(0, ComboExTestClass, "ComboEx test", WS_OVERLAPPEDWINDOW|WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 680, 260, NULL, NULL, GetModuleHandleA(NULL), 0); - assert(hComboExParentWnd != NULL); + ok(hComboExParentWnd != NULL, "failed to create parent window\n"); hMainHinst = GetModuleHandleA(NULL); - return 1; + + return hComboExParentWnd != NULL; } static void cleanup(void) @@ -537,9 +536,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) @@ -575,7 +574,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); @@ -584,16 +583,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); diff --git a/rostests/winetests/comctl32/datetime.c b/rostests/winetests/comctl32/datetime.c index 1a21f84cc03..415e72fa122 100644 --- a/rostests/winetests/comctl32/datetime.c +++ b/rostests/winetests/comctl32/datetime.c @@ -165,8 +165,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, @@ -195,24 +195,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); @@ -223,17 +222,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); } @@ -267,8 +266,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); @@ -285,7 +284,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); } @@ -349,13 +348,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 */ @@ -363,25 +362,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]); @@ -391,9 +390,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]); @@ -403,9 +402,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]); @@ -431,9 +430,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); @@ -443,9 +442,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 || @@ -459,9 +458,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 */ @@ -477,12 +476,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 || @@ -500,9 +499,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]); @@ -512,9 +511,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]); @@ -534,7 +533,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 { @@ -549,128 +548,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); @@ -692,35 +691,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]); @@ -738,14 +737,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"); @@ -757,7 +756,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 @@ -774,16 +773,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); } diff --git a/rostests/winetests/comctl32/dpa.c b/rostests/winetests/comctl32/dpa.c index 7c7f99b2dc7..6a8230af55d 100644 --- a/rostests/winetests/comctl32/dpa.c +++ b/rostests/winetests/comctl32/dpa.c @@ -45,24 +45,24 @@ typedef struct _STREAMDATA DWORD dwItems; } STREAMDATA, *PSTREAMDATA; -static HDPA (WINAPI *pDPA_Clone)(const HDPA,const HDPA); +static HDPA (WINAPI *pDPA_Clone)(const HDPA,HDPA); static HDPA (WINAPI *pDPA_Create)(INT); static HDPA (WINAPI *pDPA_CreateEx)(INT,HANDLE); -static PVOID (WINAPI *pDPA_DeleteAllPtrs)(const HDPA); -static PVOID (WINAPI *pDPA_DeletePtr)(const HDPA,INT); -static BOOL (WINAPI *pDPA_Destroy)(const HDPA); +static PVOID (WINAPI *pDPA_DeleteAllPtrs)(HDPA); +static PVOID (WINAPI *pDPA_DeletePtr)(HDPA,INT); +static BOOL (WINAPI *pDPA_Destroy)(HDPA); static VOID (WINAPI *pDPA_DestroyCallback)(HDPA,PFNDPAENUMCALLBACK,PVOID); static VOID (WINAPI *pDPA_EnumCallback)(HDPA,PFNDPAENUMCALLBACK,PVOID); -static INT (WINAPI *pDPA_GetPtr)(const HDPA,INT); -static INT (WINAPI *pDPA_GetPtrIndex)(const HDPA,PVOID); +static INT (WINAPI *pDPA_GetPtr)(HDPA,INT); +static INT (WINAPI *pDPA_GetPtrIndex)(HDPA,PVOID); static BOOL (WINAPI *pDPA_Grow)(HDPA,INT); -static INT (WINAPI *pDPA_InsertPtr)(const HDPA,INT,PVOID); +static INT (WINAPI *pDPA_InsertPtr)(HDPA,INT,PVOID); static HRESULT (WINAPI *pDPA_LoadStream)(HDPA*,PFNDPASTREAM,IStream*,LPVOID); -static BOOL (WINAPI *pDPA_Merge)(const HDPA,const HDPA,DWORD,PFNDPACOMPARE,PFNDPAMERGE,LPARAM); +static BOOL (WINAPI *pDPA_Merge)(HDPA,HDPA,DWORD,PFNDPACOMPARE,PFNDPAMERGE,LPARAM); static HRESULT (WINAPI *pDPA_SaveStream)(HDPA,PFNDPASTREAM,IStream*,LPVOID); static INT (WINAPI *pDPA_Search)(HDPA,PVOID,INT,PFNDPACOMPARE,LPARAM,UINT); -static BOOL (WINAPI *pDPA_SetPtr)(const HDPA,INT,PVOID); -static BOOL (WINAPI *pDPA_Sort)(const HDPA,PFNDPACOMPARE,LPARAM); +static BOOL (WINAPI *pDPA_SetPtr)(HDPA,INT,PVOID); +static BOOL (WINAPI *pDPA_Sort)(HDPA,PFNDPACOMPARE,LPARAM); #define COMCTL32_GET_PROC(func, ord) \ ((p ## func = (PVOID)GetProcAddress(hcomctl32,(LPCSTR)ord)) ? 1 \ diff --git a/rostests/winetests/comctl32/header.c b/rostests/winetests/comctl32/header.c index 1502970ad9b..90d4ea15547 100644 --- a/rostests/winetests/comctl32/header.c +++ b/rostests/winetests/comctl32/header.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -106,16 +107,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 } }; @@ -137,8 +138,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 } }; @@ -225,17 +226,21 @@ static const struct message bitmapmarginMessages_seq[] = { static void expect_notify(INT iCode, BOOL fUnicode, HDITEMA *lpItem) { - assert(nExpectedNotify < 10); - expectedNotify[nExpectedNotify].iCode = iCode; - expectedNotify[nExpectedNotify].fUnicode = fUnicode; - expectedNotify[nExpectedNotify].hdItem = *lpItem; - nExpectedNotify++; + ok(nExpectedNotify < 10, "notification count %d\n", nExpectedNotify); + if (nExpectedNotify < 10) + { + expectedNotify[nExpectedNotify].iCode = iCode; + expectedNotify[nExpectedNotify].fUnicode = fUnicode; + expectedNotify[nExpectedNotify].hdItem = *lpItem; + nExpectedNotify++; + } } static void dont_expect_notify(INT iCode) { - assert(nUnexpectedNotify < 10); - unexpectedNotify[nUnexpectedNotify++] = iCode; + ok(nExpectedNotify < 10, "notification count %d\n", nExpectedNotify); + if (nExpectedNotify < 10) + unexpectedNotify[nUnexpectedNotify++] = iCode; } static BOOL notifies_received(void) @@ -253,7 +258,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) @@ -268,7 +273,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; @@ -288,19 +293,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) @@ -309,16 +314,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) @@ -328,11 +333,11 @@ 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); - assert(handle); + handle = CreateWindowExA(0, WC_HEADERA, NULL, + WS_CHILD|WS_BORDER|WS_VISIBLE|HDS_BUTTONS|HDS_HORZ, + 0, 0, 0, 0, + hHeaderParentWnd, NULL, NULL, NULL); + ok(handle != NULL, "failed to create header window\n"); if (winetest_interactive) ShowWindow (hHeaderParentWnd, SW_SHOW); @@ -340,7 +345,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); @@ -448,6 +453,7 @@ static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LP if (defwndproc_counter) msg.flags |= defwinproc; msg.wParam = wParam; msg.lParam = lParam; + msg.id = 0; add_message(sequences, PARENT_SEQ_INDEX, &msg); } @@ -468,7 +474,7 @@ static BOOL register_parent_wnd_class(void) cls.cbWndExtra = 0; cls.hInstance = GetModuleHandleA(NULL); cls.hIcon = 0; - cls.hCursor = LoadCursorA(0, IDC_ARROW); + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); cls.hbrBackground = GetStockObject(WHITE_BRUSH); cls.lpszMenuName = NULL; cls.lpszClassName = "Header test parent class"; @@ -499,26 +505,25 @@ 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); - assert(childHandle); + ok(childHandle != NULL, "failed to create child window\n"); if (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); } } @@ -661,24 +666,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) @@ -686,18 +691,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); } } @@ -813,7 +818,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); @@ -821,7 +826,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 */ @@ -831,7 +836,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); @@ -854,7 +859,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); @@ -873,7 +878,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); @@ -901,7 +906,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); @@ -909,7 +914,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); @@ -917,7 +922,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); @@ -941,12 +946,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, @@ -972,13 +977,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); @@ -997,12 +1002,11 @@ static void test_hdm_filterMessages(HWND hParent) flush_sequences(sequences, NUM_MSG_SEQUENCES); hChild = create_custom_header_control(hParent, TRUE); - assert(hChild); 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); @@ -1012,18 +1016,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 @@ -1050,9 +1054,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, @@ -1071,7 +1075,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 @@ -1097,7 +1101,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; @@ -1115,26 +1119,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, @@ -1142,10 +1146,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); @@ -1155,23 +1159,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); @@ -1186,10 +1190,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); @@ -1199,7 +1203,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; @@ -1210,20 +1214,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) { @@ -1236,29 +1240,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); @@ -1267,7 +1271,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; @@ -1278,24 +1282,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) { @@ -1306,7 +1310,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"); @@ -1314,26 +1318,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); @@ -1364,7 +1368,7 @@ static LRESULT customdraw_1(int n, NMCUSTOMDRAW *nm) return 0; } - ok(FALSE, "To many custom draw messages (n=%d, nm->dwDrawStage=%d)\n", n, nm->dwDrawStage); + ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%d)\n", n, nm->dwDrawStage); return -1; } @@ -1391,7 +1395,7 @@ static LRESULT customdraw_2(int n, NMCUSTOMDRAW *nm) return 0; } - ok(FALSE, "To many custom draw messages (n=%d, nm->dwDrawStage=%d)\n", n, nm->dwDrawStage); + ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%d)\n", n, nm->dwDrawStage); return 0; } @@ -1421,7 +1425,7 @@ static LRESULT customdraw_3(int n, NMCUSTOMDRAW *nm) return 0; } - ok(FALSE, "To many custom draw messages (n=%d, nm->dwDrawStage=%d)\n", n, nm->dwDrawStage); + ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%d)\n", n, nm->dwDrawStage); return 0; } @@ -1449,7 +1453,7 @@ static LRESULT customdraw_4(int n, NMCUSTOMDRAW *nm) return 0; } - ok(FALSE, "To many custom draw messages (n=%d, nm->dwDrawStage=%d)\n", n, nm->dwDrawStage); + ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%d)\n", n, nm->dwDrawStage); return 0; } @@ -1466,7 +1470,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(); @@ -1482,7 +1486,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); @@ -1492,13 +1496,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); @@ -1517,7 +1521,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], @@ -1556,7 +1560,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"); @@ -1566,7 +1570,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"); @@ -1575,13 +1579,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); @@ -1594,7 +1598,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; @@ -1644,7 +1648,7 @@ static LRESULT CALLBACK HeaderTestWndProc(HWND hWnd, UINT msg, WPARAM wParam, LP return 0L; } -static int init(void) +static BOOL init(void) { HMODULE hComctl32; BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*); @@ -1659,7 +1663,7 @@ static int init(void) if (!pInitCommonControlsEx) { skip("InitCommonControlsEx() is missing. Skipping the tests\n"); - return 0; + return FALSE; } iccex.dwSize = sizeof(iccex); @@ -1671,7 +1675,7 @@ static int init(void) wc.cbWndExtra = 0; wc.hInstance = GetModuleHandleA(NULL); wc.hIcon = NULL; - wc.hCursor = LoadCursorA(NULL, IDC_ARROW); + wc.hCursor = LoadCursorA(NULL, (LPCSTR)IDC_ARROW); wc.hbrBackground = GetSysColorBrush(COLOR_WINDOW); wc.lpszMenuName = NULL; wc.lpszClassName = "HeaderTestClass"; @@ -1693,36 +1697,37 @@ static int init(void) CW_USEDEFAULT, CW_USEDEFAULT, 672+2*GetSystemMetrics(SM_CXSIZEFRAME), 226+GetSystemMetrics(SM_CYCAPTION)+2*GetSystemMetrics(SM_CYSIZEFRAME), NULL, NULL, GetModuleHandleA(NULL), 0); - assert(hHeaderParentWnd != NULL); + ok(hHeaderParentWnd != NULL, "failed to create parent wnd\n"); + ShowWindow(hHeaderParentWnd, SW_SHOW); - return 1; + return hHeaderParentWnd != NULL; } /* maximum 8 items allowed */ static void check_orderarray(HWND hwnd, DWORD start, DWORD set, DWORD expected, - int todo, int line) + BOOL todo, int line) { int count, i; 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)); @@ -1748,7 +1753,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"); @@ -1763,14 +1768,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 */ @@ -1823,7 +1828,6 @@ START_TEST(header) HWND parent_hwnd; ULONG_PTR ctx_cookie; HANDLE hCtx; - HWND hwnd; if (!init()) return; @@ -1856,22 +1860,6 @@ START_TEST(header) return; } - /* this is a XP SP3 failure workaround */ - hwnd = CreateWindowExA(0, WC_HEADER, NULL, - WS_CHILD|WS_BORDER|WS_VISIBLE|HDS_BUTTONS|HDS_HORZ, - 0, 0, 100, 100, - parent_hwnd, NULL, GetModuleHandleA(NULL), NULL); - - if (!IsWindow(hwnd)) - { - win_skip("FIXME: failed to create Header window.\n"); - unload_v6_module(ctx_cookie, hCtx); - DestroyWindow(parent_hwnd); - return; - } - else - DestroyWindow(hwnd); - /* comctl32 version 6 tests start here */ test_hdf_fixedwidth(parent_hwnd); test_hds_nosizing(parent_hwnd); diff --git a/rostests/winetests/comctl32/imagelist.c b/rostests/winetests/comctl32/imagelist.c index 53b4fac7f17..d6ee25f9c45 100644 --- a/rostests/winetests/comctl32/imagelist.c +++ b/rostests/winetests/comctl32/imagelist.c @@ -34,7 +34,7 @@ #include #include #include -//#include "winuser.h" +#include #include #include /* must be included after objbase.h to get ImageList_Write */ #include @@ -138,7 +138,7 @@ static HWND create_a_window(void) char className[] = "bmwnd"; char winName[] = "Test Bitmap"; HWND hWnd; - static int registered = 0; + static BOOL registered = FALSE; if (!registered) { @@ -149,14 +149,14 @@ static HWND create_a_window(void) cls.cbClsExtra = 0; cls.cbWndExtra = 0; cls.hInstance = 0; - cls.hIcon = LoadIconA (0, IDI_APPLICATION); - cls.hCursor = LoadCursorA (0, IDC_ARROW); + cls.hIcon = LoadIconA(0, (LPCSTR)IDI_APPLICATION); + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); cls.hbrBackground = GetStockObject (WHITE_BRUSH); cls.lpszMenuName = 0; cls.lpszClassName = className; RegisterClassA (&cls); - registered = 1; + registered = TRUE; } /* Setup window */ @@ -813,7 +813,8 @@ static ULONG check_bitmap_data(const char *bm_data, ULONG bm_data_size, image_size = DIB_GetWidthBytes(bmih->biWidth, bmih->biBitCount) * bmih->biHeight; ok(bmih->biSizeImage == image_size, "wrong biSizeImage %u\n", bmih->biSizeImage); -#if 0 + +if (0) { char fname[256]; FILE *f; @@ -822,7 +823,7 @@ static ULONG check_bitmap_data(const char *bm_data, ULONG bm_data_size, fwrite(bm_data, 1, bm_data_size, f); fclose(f); } -#endif + return hdr_size + image_size; } @@ -871,7 +872,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); @@ -1221,7 +1222,7 @@ static void test_shell_imagelist(void) int cx, cy; /* Try to load function from shell32 */ - hShell32 = LoadLibrary("shell32.dll"); + hShell32 = LoadLibraryA("shell32.dll"); pSHGetImageList = (void*)GetProcAddress(hShell32, (LPCSTR) 727); if (!pSHGetImageList) @@ -2068,7 +2069,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"); diff --git a/rostests/winetests/comctl32/ipaddress.c b/rostests/winetests/comctl32/ipaddress.c index 4acdd83cb06..22bd1d05556 100644 --- a/rostests/winetests/comctl32/ipaddress.c +++ b/rostests/winetests/comctl32/ipaddress.c @@ -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,19 +49,19 @@ 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); DestroyWindow(hwnd); } -static int init(void) +static BOOL init(void) { HMODULE hComctl32; BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*); @@ -72,7 +72,7 @@ static int init(void) if (!pInitCommonControlsEx) { win_skip("InitCommonControlsEx() is missing.\n"); - return 0; + return FALSE; } iccex.dwSize = sizeof(iccex); @@ -80,7 +80,7 @@ static int init(void) iccex.dwICC = ICC_INTERNET_CLASSES; pInitCommonControlsEx(&iccex); - return 1; + return TRUE; } START_TEST(ipaddress) diff --git a/rostests/winetests/comctl32/listview.c b/rostests/winetests/comctl32/listview.c index 014997ed0bd..9acc5053fcc 100644 --- a/rostests/winetests/comctl32/listview.c +++ b/rostests/winetests/comctl32/listview.c @@ -67,7 +67,7 @@ static LVITEMA g_itema; /* alter notification code A->W */ static BOOL g_disp_A_to_W; /* dispinfo data sent with LVN_LVN_ENDLABELEDIT */ -static NMLVDISPINFO g_editbox_disp_info; +static NMLVDISPINFOA g_editbox_disp_info; /* when this is set focus will be tested on LVN_DELETEITEM */ static BOOL g_focus_test_LVN_DELETEITEM; @@ -134,9 +134,9 @@ static const struct message listview_color_seq[] = { static const struct message listview_item_count_seq[] = { { LVM_GETITEMCOUNT, sent }, - { LVM_INSERTITEM, sent }, - { LVM_INSERTITEM, sent }, - { LVM_INSERTITEM, sent }, + { LVM_INSERTITEMA, sent }, + { LVM_INSERTITEMA, sent }, + { LVM_INSERTITEMA, sent }, { LVM_GETITEMCOUNT, sent }, { LVM_DELETEITEM, sent|wparam, 2 }, { WM_NCPAINT, sent|optional }, @@ -144,18 +144,18 @@ static const struct message listview_item_count_seq[] = { { LVM_GETITEMCOUNT, sent }, { LVM_DELETEALLITEMS, sent }, { LVM_GETITEMCOUNT, sent }, - { LVM_INSERTITEM, sent }, - { LVM_INSERTITEM, sent }, + { LVM_INSERTITEMA, sent }, + { LVM_INSERTITEMA, sent }, { LVM_GETITEMCOUNT, sent }, - { LVM_INSERTITEM, sent }, + { LVM_INSERTITEMA, sent }, { LVM_GETITEMCOUNT, sent }, { 0 } }; static const struct message listview_itempos_seq[] = { - { LVM_INSERTITEM, sent }, - { LVM_INSERTITEM, sent }, - { LVM_INSERTITEM, sent }, + { LVM_INSERTITEMA, sent }, + { LVM_INSERTITEMA, sent }, + { LVM_INSERTITEMA, sent }, { LVM_SETITEMPOSITION, sent|wparam|lparam, 1, MAKELPARAM(10,5) }, { WM_NCPAINT, sent|optional }, { WM_ERASEBKGND, sent|optional }, @@ -333,6 +333,23 @@ static const struct message listview_destroy[] = { { 0 } }; +static const struct message listview_ownerdata_destroy[] = { + { 0x0090, sent|optional }, /* Vista */ + { WM_PARENTNOTIFY, sent }, + { WM_SHOWWINDOW, sent }, + { WM_WINDOWPOSCHANGING, sent }, + { WM_WINDOWPOSCHANGED, sent|optional }, + { WM_DESTROY, sent }, + { WM_NCDESTROY, sent }, + { 0 } +}; + +static const struct message listview_ownerdata_deleteall[] = { + { LVM_DELETEALLITEMS, sent }, + { WM_NOTIFY, sent|id, 0, 0, LVN_DELETEALLITEMS }, + { 0 } +}; + static const struct message listview_header_changed_seq[] = { { LVM_SETCOLUMNA, sent }, { WM_NOTIFY, sent|id|defwinproc, 0, 0, LISTVIEW_ID }, @@ -409,7 +426,7 @@ static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LP { switch (((NMHDR*)lParam)->code) { - case LVN_BEGINLABELEDIT: + case LVN_BEGINLABELEDITA: { HWND edit = NULL; @@ -426,12 +443,12 @@ static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LP return blockEdit; } - case LVN_ENDLABELEDIT: + case LVN_ENDLABELEDITA: { HWND edit; /* always accept new item text */ - NMLVDISPINFO *di = (NMLVDISPINFO*)lParam; + NMLVDISPINFOA *di = (NMLVDISPINFOA*)lParam; g_editbox_disp_info = *di; trace("LVN_ENDLABELEDIT: text=%s\n", di->item.pszText ? di->item.pszText : "(null)"); @@ -527,7 +544,7 @@ static BOOL register_parent_wnd_class(BOOL Unicode) clsW.cbWndExtra = 0; clsW.hInstance = GetModuleHandleW(NULL); clsW.hIcon = 0; - clsW.hCursor = LoadCursorA(0, IDC_ARROW); + clsW.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); clsW.hbrBackground = GetStockObject(WHITE_BRUSH); clsW.lpszMenuName = NULL; clsW.lpszClassName = testparentclassW; @@ -540,7 +557,7 @@ static BOOL register_parent_wnd_class(BOOL Unicode) clsA.cbWndExtra = 0; clsA.hInstance = GetModuleHandleA(NULL); clsA.hIcon = 0; - clsA.hCursor = LoadCursorA(0, IDC_ARROW); + clsA.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); clsA.hbrBackground = GetStockObject(WHITE_BRUSH); clsA.lpszMenuName = NULL; clsA.lpszClassName = "Listview test parent class"; @@ -614,7 +631,7 @@ static HWND create_listview_control(DWORD style) RECT rect; GetClientRect(hwndparent, &rect); - hwnd = CreateWindowExA(0, WC_LISTVIEW, "foo", + hwnd = CreateWindowExA(0, WC_LISTVIEWA, "foo", WS_CHILD | WS_BORDER | WS_VISIBLE | style, 0, 0, rect.right, rect.bottom, hwndparent, NULL, GetModuleHandleA(NULL), NULL); @@ -679,7 +696,7 @@ static HWND subclass_header(HWND hwndListview) WNDPROC oldproc; HWND hwnd; - hwnd = ListView_GetHeader(hwndListview); + hwnd = (HWND)SendMessageA(hwndListview, LVM_GETHEADER, 0, 0); oldproc = (WNDPROC)SetWindowLongPtrA(hwnd, GWLP_WNDPROC, (LONG_PTR)header_subclass_proc); SetWindowLongPtrA(hwnd, GWLP_USERDATA, (LONG_PTR)oldproc); @@ -722,7 +739,7 @@ static HWND subclass_editbox(HWND hwndListview) WNDPROC oldproc; HWND hwnd; - hwnd = (HWND)SendMessage(hwndListview, LVM_GETEDITCONTROL, 0, 0); + hwnd = (HWND)SendMessageA(hwndListview, LVM_GETEDITCONTROL, 0, 0); oldproc = (WNDPROC)SetWindowLongPtrA(hwnd, GWLP_WNDPROC, (LONG_PTR)editbox_subclass_proc); SetWindowLongPtrA(hwnd, GWLP_USERDATA, (LONG_PTR)oldproc); @@ -741,7 +758,7 @@ static void test_lvm_hittest_(HWND hwnd, INT x, INT y, INT item, UINT flags, UIN lpht.pt.y = y; lpht.iSubItem = 10; - ret = SendMessage(hwnd, LVM_HITTEST, 0, (LPARAM)&lpht); + ret = SendMessageA(hwnd, LVM_HITTEST, 0, (LPARAM)&lpht); if (todo_item) { @@ -783,7 +800,7 @@ static void test_lvm_subitemhittest_(HWND hwnd, INT x, INT y, INT item, INT subi lpht.pt.x = x; lpht.pt.y = y; - ret = SendMessage(hwnd, LVM_SUBITEMHITTEST, 0, (LPARAM)&lpht); + ret = SendMessageA(hwnd, LVM_SUBITEMHITTEST, 0, (LPARAM)&lpht); if (todo_item) { @@ -822,7 +839,7 @@ static void test_images(void) { HWND hwnd; INT r; - LVITEM item; + LVITEMA item; HIMAGELIST himl; HBITMAP hbmp; RECT r1, r2; @@ -837,24 +854,24 @@ static void test_images(void) r = ImageList_Add(himl, hbmp, 0); ok(r == 0, "should be zero\n"); - hwnd = CreateWindowEx(0, "SysListView32", "foo", LVS_OWNERDRAWFIXED, + hwnd = CreateWindowExA(0, "SysListView32", "foo", LVS_OWNERDRAWFIXED, 10, 10, 100, 200, hwndparent, NULL, NULL, NULL); ok(hwnd != NULL, "failed to create listview window\n"); - r = SendMessage(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, + r = SendMessageA(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_UNDERLINEHOT | LVS_EX_FLATSB | LVS_EX_ONECLICKACTIVATE); ok(r == 0, "should return zero\n"); - r = SendMessage(hwnd, LVM_SETIMAGELIST, 0, (LPARAM)himl); + r = SendMessageA(hwnd, LVM_SETIMAGELIST, 0, (LPARAM)himl); ok(r == 0, "should return zero\n"); - r = SendMessage(hwnd, LVM_SETICONSPACING, 0, MAKELONG(100,50)); + r = SendMessageA(hwnd, LVM_SETICONSPACING, 0, MAKELONG(100,50)); ok(r != 0, "got 0\n"); /* returns dimensions */ - r = SendMessage(hwnd, LVM_GETITEMCOUNT, 0, 0); + r = SendMessageA(hwnd, LVM_GETITEMCOUNT, 0, 0); ok(r == 0, "should be zero items\n"); item.mask = LVIF_IMAGE | LVIF_TEXT; @@ -862,30 +879,30 @@ static void test_images(void) item.iSubItem = 1; item.iImage = 0; item.pszText = 0; - r = SendMessage(hwnd, LVM_INSERTITEM, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item); ok(r == -1, "should fail\n"); item.iSubItem = 0; item.pszText = hello; - r = SendMessage(hwnd, LVM_INSERTITEM, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item); ok(r == 0, "should not fail\n"); memset(&r1, 0, sizeof r1); r1.left = LVIR_ICON; - r = SendMessage(hwnd, LVM_GETITEMRECT, 0, (LPARAM) &r1); + r = SendMessageA(hwnd, LVM_GETITEMRECT, 0, (LPARAM) &r1); expect(1, r); - r = SendMessage(hwnd, LVM_DELETEALLITEMS, 0, 0); + r = SendMessageA(hwnd, LVM_DELETEALLITEMS, 0, 0); ok(r == TRUE, "should not fail\n"); item.iSubItem = 0; item.pszText = hello; - r = SendMessage(hwnd, LVM_INSERTITEM, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item); ok(r == 0, "should not fail\n"); memset(&r2, 0, sizeof r2); r2.left = LVIR_ICON; - r = SendMessage(hwnd, LVM_GETITEMRECT, 0, (LPARAM) &r2); + r = SendMessageA(hwnd, LVM_GETITEMRECT, 0, (LPARAM) &r2); expect(1, r); ok(!memcmp(&r1, &r2, sizeof r1), "rectangle should be the same\n"); @@ -902,7 +919,7 @@ static void test_checkboxes(void) text2[] = "Text2", text3[] = "Text3"; - hwnd = CreateWindowEx(0, "SysListView32", "foo", LVS_REPORT, + hwnd = CreateWindowExA(0, "SysListView32", "foo", LVS_REPORT, 10, 10, 100, 200, hwndparent, NULL, NULL, NULL); ok(hwnd != NULL, "failed to create listview window\n"); @@ -913,13 +930,13 @@ static void test_checkboxes(void) item.iItem = 0; item.iSubItem = 0; item.pszText = text; - r = SendMessage(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item); expect(0, r); item.iItem = 0; item.mask = LVIF_STATE; item.stateMask = 0xffff; - r = SendMessage(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(1, r); ok(item.state == 0xfccc, "state %x\n", item.state); @@ -930,24 +947,24 @@ static void test_checkboxes(void) item.iItem = 1; item.iSubItem = 0; item.pszText = text; - r = SendMessage(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item); expect(1, r); item.iItem = 1; item.mask = LVIF_STATE; item.stateMask = 0xffff; - r = SendMessage(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(1, r); ok(item.state == 0, "state %x\n", item.state); - r = SendMessage(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_CHECKBOXES, LVS_EX_CHECKBOXES); + r = SendMessageA(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_CHECKBOXES, LVS_EX_CHECKBOXES); expect(0, r); /* Having turned on checkboxes, check that all existing items are set to 0x1000 (unchecked) */ item.iItem = 0; item.mask = LVIF_STATE; item.stateMask = 0xffff; - r = SendMessage(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(1, r); if (item.state != 0x1ccc) { @@ -961,13 +978,13 @@ static void test_checkboxes(void) item.mask = LVIF_TEXT; item.state = 0; item.pszText = text2; - r = SendMessage(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item); expect(2, r); item.iItem = 2; item.mask = LVIF_STATE; item.stateMask = 0xffff; - r = SendMessage(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(1, r); ok(item.state == 0x1000, "state %x\n", item.state); @@ -977,13 +994,13 @@ static void test_checkboxes(void) item.stateMask = 0xffff; item.state = 0x2aaa; item.pszText = text3; - r = SendMessage(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item); expect(3, r); item.iItem = 3; item.mask = LVIF_STATE; item.stateMask = 0xffff; - r = SendMessage(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(1, r); ok(item.state == 0x1aaa, "state %x\n", item.state); @@ -992,13 +1009,13 @@ static void test_checkboxes(void) item.mask = LVIF_STATE; item.stateMask = 0xf000; item.state = 0x2000; - r = SendMessage(hwnd, LVM_SETITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_SETITEMA, 0, (LPARAM) &item); expect(1, r); item.iItem = 3; item.mask = LVIF_STATE; item.stateMask = 0xffff; - r = SendMessage(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(1, r); ok(item.state == 0x2aaa, "state %x\n", item.state); @@ -1009,40 +1026,40 @@ static void test_checkboxes(void) item.mask = LVIF_STATE; item.stateMask = 0xf000; item.state = 0xffff; - r = SendMessage(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(1, r); ok(item.state == 0x2000, "state %x\n", item.state); /* Set the style again and check that doesn't change an item's state */ - r = SendMessage(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_CHECKBOXES, LVS_EX_CHECKBOXES); + r = SendMessageA(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_CHECKBOXES, LVS_EX_CHECKBOXES); ok(r == LVS_EX_CHECKBOXES, "ret %x\n", r); item.iItem = 3; item.mask = LVIF_STATE; item.stateMask = 0xffff; - r = SendMessage(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(1, r); ok(item.state == 0x2aaa, "state %x\n", item.state); /* Unsetting the checkbox extended style doesn't change an item's state */ - r = SendMessage(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_CHECKBOXES, 0); + r = SendMessageA(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_CHECKBOXES, 0); ok(r == LVS_EX_CHECKBOXES, "ret %x\n", r); item.iItem = 3; item.mask = LVIF_STATE; item.stateMask = 0xffff; - r = SendMessage(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(1, r); ok(item.state == 0x2aaa, "state %x\n", item.state); /* Now setting the style again will change an item's state */ - r = SendMessage(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_CHECKBOXES, LVS_EX_CHECKBOXES); + r = SendMessageA(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_CHECKBOXES, LVS_EX_CHECKBOXES); expect(0, r); item.iItem = 3; item.mask = LVIF_STATE; item.stateMask = 0xffff; - r = SendMessage(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(1, r); ok(item.state == 0x1aaa, "state %x\n", item.state); @@ -1053,37 +1070,37 @@ static void test_checkboxes(void) item.iSubItem = 0; item.state = LVIS_FOCUSED; item.stateMask = LVIS_FOCUSED; - r = SendMessage(hwnd, LVM_SETITEM, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_SETITEMA, 0, (LPARAM) &item); expect(1, r); item.iItem = 3; item.mask = LVIF_STATE; item.stateMask = 0xffff; - r = SendMessage(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(1, r); ok(item.state == 0x1aab, "state %x\n", item.state); - r = SendMessage(hwnd, WM_KEYDOWN, VK_SPACE, 0); + r = SendMessageA(hwnd, WM_KEYDOWN, VK_SPACE, 0); expect(0, r); - r = SendMessage(hwnd, WM_KEYUP, VK_SPACE, 0); + r = SendMessageA(hwnd, WM_KEYUP, VK_SPACE, 0); expect(0, r); item.iItem = 3; item.mask = LVIF_STATE; item.stateMask = 0xffff; - r = SendMessage(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(1, r); ok(item.state == 0x2aab, "state %x\n", item.state); - r = SendMessage(hwnd, WM_KEYDOWN, VK_SPACE, 0); + r = SendMessageA(hwnd, WM_KEYDOWN, VK_SPACE, 0); expect(0, r); - r = SendMessage(hwnd, WM_KEYUP, VK_SPACE, 0); + r = SendMessageA(hwnd, WM_KEYUP, VK_SPACE, 0); expect(0, r); item.iItem = 3; item.mask = LVIF_STATE; item.stateMask = 0xffff; - r = SendMessage(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(1, r); ok(item.state == 0x1aab, "state %x\n", item.state); @@ -1092,14 +1109,14 @@ static void test_checkboxes(void) static void insert_column(HWND hwnd, int idx) { - LVCOLUMN column; + LVCOLUMNA column; INT rc; memset(&column, 0xcc, sizeof(column)); column.mask = LVCF_SUBITEM; column.iSubItem = idx; - rc = ListView_InsertColumn(hwnd, idx, &column); + rc = SendMessageA(hwnd, LVM_INSERTCOLUMNA, idx, (LPARAM)&column); expect(idx, rc); } @@ -1116,7 +1133,7 @@ static void insert_item(HWND hwnd, int idx) item.iSubItem = 0; item.pszText = text; - rc = ListView_InsertItem(hwnd, &item); + rc = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&item); expect(idx, rc); } @@ -1129,7 +1146,7 @@ static void test_items(void) LVITEMA item; DWORD r; - hwnd = CreateWindowEx(0, "SysListView32", "foo", LVS_REPORT, + hwnd = CreateWindowExA(0, "SysListView32", "foo", LVS_REPORT, 10, 10, 100, 200, hwndparent, NULL, NULL, NULL); ok(hwnd != NULL, "failed to create listview window\n"); @@ -1149,7 +1166,7 @@ static void test_items(void) item.stateMask = 0; item.iItem = 0; item.iSubItem = 0; - r = SendMessage(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item); expect(0, r); /* get */ memset (&item, 0xcc, sizeof (item)); @@ -1158,10 +1175,10 @@ static void test_items(void) item.state = 0; item.iItem = 0; item.iSubItem = 0; - r = SendMessage(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(1, r); ok(item.state & LVIS_SELECTED, "Expected LVIS_SELECTED\n"); - SendMessage(hwnd, LVM_DELETEITEM, 0, 0); + SendMessageA(hwnd, LVM_DELETEITEM, 0, 0); /* LVIS_SELECTED with zero stateMask */ /* set */ @@ -1171,7 +1188,7 @@ static void test_items(void) item.stateMask = 0; item.iItem = 0; item.iSubItem = 0; - r = SendMessage(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item); expect(0, r); /* get */ memset (&item, 0xcc, sizeof (item)); @@ -1180,10 +1197,10 @@ static void test_items(void) item.state = 0; item.iItem = 0; item.iSubItem = 0; - r = SendMessage(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(1, r); ok(item.state & LVIS_FOCUSED, "Expected LVIS_FOCUSED\n"); - SendMessage(hwnd, LVM_DELETEITEM, 0, 0); + SendMessageA(hwnd, LVM_DELETEITEM, 0, 0); /* LVIS_CUT with LVIS_FOCUSED stateMask */ /* set */ @@ -1193,7 +1210,7 @@ static void test_items(void) item.stateMask = LVIS_FOCUSED; item.iItem = 0; item.iSubItem = 0; - r = SendMessage(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item); expect(0, r); /* get */ memset (&item, 0xcc, sizeof (item)); @@ -1202,10 +1219,10 @@ static void test_items(void) item.state = 0; item.iItem = 0; item.iSubItem = 0; - r = SendMessage(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(1, r); ok(item.state & LVIS_CUT, "Expected LVIS_CUT\n"); - SendMessage(hwnd, LVM_DELETEITEM, 0, 0); + SendMessageA(hwnd, LVM_DELETEITEM, 0, 0); /* Insert an item with just a param */ memset (&item, 0xcc, sizeof (item)); @@ -1213,7 +1230,7 @@ static void test_items(void) item.iItem = 0; item.iSubItem = 0; item.lParam = lparamTest; - r = SendMessage(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item); expect(0, r); /* Test getting of the param */ @@ -1221,7 +1238,7 @@ static void test_items(void) item.mask = LVIF_PARAM; item.iItem = 0; item.iSubItem = 0; - r = SendMessage(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(1, r); ok(item.lParam == lparamTest, "got lParam %lx, expected %lx\n", item.lParam, lparamTest); @@ -1231,7 +1248,7 @@ static void test_items(void) item.iItem = 0; item.iSubItem = 1; item.pszText = text; - r = SendMessage(hwnd, LVM_SETITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_SETITEMA, 0, (LPARAM) &item); expect(1, r); item.mask = LVIF_TEXT; @@ -1239,7 +1256,7 @@ static void test_items(void) item.iSubItem = 1; item.pszText = buffA; item.cchTextMax = sizeof(buffA); - r = SendMessage(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(1, r); ok(!memcmp(item.pszText, text, sizeof(text)), "got text %s, expected %s\n", item.pszText, text); @@ -1249,7 +1266,7 @@ static void test_items(void) item.iItem = 0; item.iSubItem = 1; item.pszText = NULL; - r = SendMessage(hwnd, LVM_SETITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_SETITEMA, 0, (LPARAM) &item); expect(1, r); item.mask = LVIF_TEXT; @@ -1258,7 +1275,7 @@ static void test_items(void) item.pszText = buffA; buffA[0] = 'a'; item.cchTextMax = sizeof(buffA); - r = SendMessage(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(1, r); ok(item.pszText[0] == 0, "got %p\n", item.pszText); @@ -1267,7 +1284,7 @@ static void test_items(void) item.iItem = 0; item.iSubItem = 1; item.pszText = text; - r = SendMessage(hwnd, LVM_SETITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_SETITEMA, 0, (LPARAM) &item); ok(r == 1 || broken(r == 0) /* NT4 */, "ret %d\n", r); if (r == 1) @@ -1278,7 +1295,7 @@ static void test_items(void) item.pszText = buffA; buffA[0] = 'a'; item.cchTextMax = sizeof(buffA); - r = SendMessage(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(1, r); ok(!memcmp(item.pszText, text, sizeof(text)), "got %s, expected %s\n", item.pszText, text); } @@ -1288,7 +1305,7 @@ static void test_items(void) item.mask = LVIF_PARAM; item.iItem = 0; item.iSubItem = 1; - r = SendMessage(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(1, r); ok(item.lParam == lparamTest, "got lParam %lx, expected %lx\n", item.lParam, lparamTest); @@ -1298,7 +1315,7 @@ static void test_items(void) item.iItem = 0; item.iSubItem = 1; item.lParam = lparamTest+1; - r = SendMessage(hwnd, LVM_SETITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_SETITEMA, 0, (LPARAM) &item); expect(0, r); /* Query param from subitem again: should still return main item param */ @@ -1306,7 +1323,7 @@ static void test_items(void) item.mask = LVIF_PARAM; item.iItem = 0; item.iSubItem = 1; - r = SendMessage(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(1, r); ok(item.lParam == lparamTest, "got lParam %lx, expected %lx\n", item.lParam, lparamTest); @@ -1317,11 +1334,11 @@ static void test_items(void) item.iSubItem = 0; item.state = LVIS_SELECTED; item.stateMask = LVIS_SELECTED | LVIS_DROPHILITED; - r = SendMessage(hwnd, LVM_SETITEM, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_SETITEMA, 0, (LPARAM) &item); expect(1, r); item.iSubItem = 1; item.state = LVIS_DROPHILITED; - r = SendMessage(hwnd, LVM_SETITEM, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_SETITEMA, 0, (LPARAM) &item); expect(1, r); memset (&item, 0xcc, sizeof (item)); @@ -1329,11 +1346,11 @@ static void test_items(void) item.iItem = 0; item.iSubItem = 0; item.stateMask = -1; - r = SendMessage(hwnd, LVM_GETITEM, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(1, r); ok(item.state == LVIS_SELECTED, "got state %x, expected %x\n", item.state, LVIS_SELECTED); item.iSubItem = 1; - r = SendMessage(hwnd, LVM_GETITEM, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(1, r); todo_wine ok(item.state == LVIS_DROPHILITED, "got state %x, expected %x\n", item.state, LVIS_DROPHILITED); @@ -1342,30 +1359,30 @@ static void test_items(void) item.mask = LVIF_NORECOMPUTE; item.iItem = 0; item.iSubItem = 0; - r = SendMessage(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(1, r); memset (&item, 0, sizeof(item)); item.mask = LVIF_DI_SETITEM; item.iItem = 0; item.iSubItem = 0; - r = SendMessage(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(1, r); /* set text to callback value already having it */ - r = SendMessage(hwnd, LVM_DELETEALLITEMS, 0, 0); + r = SendMessageA(hwnd, LVM_DELETEALLITEMS, 0, 0); expect(TRUE, r); memset (&item, 0, sizeof (item)); item.mask = LVIF_TEXT; - item.pszText = LPSTR_TEXTCALLBACK; + item.pszText = LPSTR_TEXTCALLBACKA; item.iItem = 0; - r = SendMessage(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item); expect(0, r); memset (&item, 0, sizeof (item)); flush_sequences(sequences, NUM_MSG_SEQUENCES); - item.pszText = LPSTR_TEXTCALLBACK; - r = SendMessage(hwnd, LVM_SETITEMTEXT, 0 , (LPARAM) &item); + item.pszText = LPSTR_TEXTCALLBACKA; + r = SendMessageA(hwnd, LVM_SETITEMTEXTA, 0 , (LPARAM) &item); expect(TRUE, r); ok_sequence(sequences, PARENT_SEQ_INDEX, textcallback_set_again_parent_seq, @@ -1453,11 +1470,11 @@ static LRESULT CALLBACK create_test_wndproc(HWND hwnd, UINT uMsg, WPARAM wParam, if (uMsg == WM_CREATE) { - LPCREATESTRUCT lpcs = (LPCREATESTRUCT)lParam; + CREATESTRUCTA *lpcs = (CREATESTRUCTA*)lParam; lpcs->style |= LVS_REPORT; } - ret = CallWindowProc(listviewWndProc, hwnd, uMsg, wParam, lParam); - if (uMsg == WM_CREATE) SendMessage(hwnd, LVM_SETIMAGELIST, 0, (LPARAM)test_create_imagelist); + ret = CallWindowProcA(listviewWndProc, hwnd, uMsg, wParam, lParam); + if (uMsg == WM_CREATE) SendMessageA(hwnd, LVM_SETIMAGELIST, 0, (LPARAM)test_create_imagelist); return ret; } @@ -1469,20 +1486,20 @@ static void test_create(void) LONG r; LVCOLUMNA col; RECT rect; - WNDCLASSEX cls; + WNDCLASSEXA cls; DWORD style; - cls.cbSize = sizeof(WNDCLASSEX); - ok(GetClassInfoEx(GetModuleHandle(NULL), "SysListView32", &cls), "GetClassInfoEx failed\n"); + cls.cbSize = sizeof(WNDCLASSEXA); + ok(GetClassInfoExA(GetModuleHandleA(NULL), "SysListView32", &cls), "GetClassInfoEx failed\n"); listviewWndProc = cls.lpfnWndProc; cls.lpfnWndProc = create_test_wndproc; cls.lpszClassName = "MyListView32"; - ok(RegisterClassEx(&cls), "RegisterClassEx failed\n"); + ok(RegisterClassExA(&cls), "RegisterClassEx failed\n"); test_create_imagelist = ImageList_Create(16, 16, 0, 5, 10); - hList = CreateWindow("MyListView32", "Test", WS_VISIBLE, 0, 0, 100, 100, NULL, NULL, GetModuleHandle(NULL), 0); - ok((HIMAGELIST)SendMessage(hList, LVM_GETIMAGELIST, 0, 0) == test_create_imagelist, "Image list not obtained\n"); - hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0); + hList = CreateWindowA("MyListView32", "Test", WS_VISIBLE, 0, 0, 100, 100, NULL, NULL, GetModuleHandleA(NULL), 0); + ok((HIMAGELIST)SendMessageA(hList, LVM_GETIMAGELIST, 0, 0) == test_create_imagelist, "Image list not obtained\n"); + hHeader = (HWND)SendMessageA(hList, LVM_GETHEADER, 0, 0); if (!IsWindow(hHeader)) { @@ -1497,118 +1514,118 @@ static void test_create(void) DestroyWindow(hList); /* header isn't created on LVS_ICON and LVS_LIST styles */ - hList = CreateWindow("SysListView32", "Test", WS_VISIBLE, 0, 0, 100, 100, NULL, NULL, - GetModuleHandle(NULL), 0); - hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0); + hList = CreateWindowA("SysListView32", "Test", WS_VISIBLE, 0, 0, 100, 100, NULL, NULL, + GetModuleHandleA(NULL), 0); + hHeader = (HWND)SendMessageA(hList, LVM_GETHEADER, 0, 0); ok(!IsWindow(hHeader), "Header shouldn't be created\n"); ok(NULL == GetDlgItem(hList, 0), "NULL dialog item expected\n"); /* insert column */ memset(&col, 0, sizeof(LVCOLUMNA)); col.mask = LVCF_WIDTH; col.cx = 100; - r = SendMessage(hList, LVM_INSERTCOLUMN, 0, (LPARAM)&col); + r = SendMessageA(hList, LVM_INSERTCOLUMNA, 0, (LPARAM)&col); expect(0, r); - hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0); + hHeader = (HWND)SendMessageA(hList, LVM_GETHEADER, 0, 0); ok(IsWindow(hHeader), "Header should be created\n"); ok(hHeader == GetDlgItem(hList, 0), "Expected header as dialog item\n"); - style = GetWindowLong(hHeader, GWL_STYLE); + style = GetWindowLongA(hHeader, GWL_STYLE); ok(!(style & HDS_HIDDEN), "Not expected HDS_HIDDEN\n"); DestroyWindow(hList); - hList = CreateWindow("SysListView32", "Test", WS_VISIBLE|LVS_LIST, 0, 0, 100, 100, NULL, NULL, - GetModuleHandle(NULL), 0); - hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0); + hList = CreateWindowA("SysListView32", "Test", WS_VISIBLE|LVS_LIST, 0, 0, 100, 100, NULL, NULL, + GetModuleHandleA(NULL), 0); + hHeader = (HWND)SendMessageA(hList, LVM_GETHEADER, 0, 0); ok(!IsWindow(hHeader), "Header shouldn't be created\n"); ok(NULL == GetDlgItem(hList, 0), "NULL dialog item expected\n"); /* insert column */ memset(&col, 0, sizeof(LVCOLUMNA)); col.mask = LVCF_WIDTH; col.cx = 100; - r = SendMessage(hList, LVM_INSERTCOLUMN, 0, (LPARAM)&col); + r = SendMessageA(hList, LVM_INSERTCOLUMNA, 0, (LPARAM)&col); expect(0, r); - hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0); + hHeader = (HWND)SendMessageA(hList, LVM_GETHEADER, 0, 0); ok(IsWindow(hHeader), "Header should be created\n"); ok(hHeader == GetDlgItem(hList, 0), "Expected header as dialog item\n"); DestroyWindow(hList); /* try to switch LVS_ICON -> LVS_REPORT and back LVS_ICON -> LVS_REPORT */ - hList = CreateWindow("SysListView32", "Test", WS_VISIBLE, 0, 0, 100, 100, NULL, NULL, - GetModuleHandle(NULL), 0); - ret = SetWindowLongPtr(hList, GWL_STYLE, GetWindowLongPtr(hList, GWL_STYLE) | LVS_REPORT); + hList = CreateWindowA("SysListView32", "Test", WS_VISIBLE, 0, 0, 100, 100, NULL, NULL, + GetModuleHandleA(NULL), 0); + ret = SetWindowLongPtrA(hList, GWL_STYLE, GetWindowLongPtrA(hList, GWL_STYLE) | LVS_REPORT); ok(ret & WS_VISIBLE, "Style wrong, should have WS_VISIBLE\n"); - hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0); + hHeader = (HWND)SendMessageA(hList, LVM_GETHEADER, 0, 0); ok(IsWindow(hHeader), "Header should be created\n"); - ret = SetWindowLongPtr(hList, GWL_STYLE, GetWindowLong(hList, GWL_STYLE) & ~LVS_REPORT); + ret = SetWindowLongPtrA(hList, GWL_STYLE, GetWindowLongA(hList, GWL_STYLE) & ~LVS_REPORT); ok((ret & WS_VISIBLE) && (ret & LVS_REPORT), "Style wrong, should have WS_VISIBLE|LVS_REPORT\n"); - hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0); + hHeader = (HWND)SendMessageA(hList, LVM_GETHEADER, 0, 0); ok(IsWindow(hHeader), "Header should be created\n"); ok(hHeader == GetDlgItem(hList, 0), "Expected header as dialog item\n"); DestroyWindow(hList); /* try to switch LVS_LIST -> LVS_REPORT and back LVS_LIST -> LVS_REPORT */ - hList = CreateWindow("SysListView32", "Test", WS_VISIBLE|LVS_LIST, 0, 0, 100, 100, NULL, NULL, - GetModuleHandle(NULL), 0); - ret = SetWindowLongPtr(hList, GWL_STYLE, - (GetWindowLongPtr(hList, GWL_STYLE) & ~LVS_LIST) | LVS_REPORT); + hList = CreateWindowA("SysListView32", "Test", WS_VISIBLE|LVS_LIST, 0, 0, 100, 100, NULL, NULL, + GetModuleHandleA(NULL), 0); + ret = SetWindowLongPtrA(hList, GWL_STYLE, + (GetWindowLongPtrA(hList, GWL_STYLE) & ~LVS_LIST) | LVS_REPORT); ok(((ret & WS_VISIBLE) && (ret & LVS_LIST)), "Style wrong, should have WS_VISIBLE|LVS_LIST\n"); - hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0); + hHeader = (HWND)SendMessageA(hList, LVM_GETHEADER, 0, 0); ok(IsWindow(hHeader), "Header should be created\n"); ok(hHeader == GetDlgItem(hList, 0), "Expected header as dialog item\n"); - ret = SetWindowLongPtr(hList, GWL_STYLE, - (GetWindowLongPtr(hList, GWL_STYLE) & ~LVS_REPORT) | LVS_LIST); + ret = SetWindowLongPtrA(hList, GWL_STYLE, + (GetWindowLongPtrA(hList, GWL_STYLE) & ~LVS_REPORT) | LVS_LIST); ok(((ret & WS_VISIBLE) && (ret & LVS_REPORT)), "Style wrong, should have WS_VISIBLE|LVS_REPORT\n"); - hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0); + hHeader = (HWND)SendMessageA(hList, LVM_GETHEADER, 0, 0); ok(IsWindow(hHeader), "Header should be created\n"); ok(hHeader == GetDlgItem(hList, 0), "Expected header as dialog item\n"); DestroyWindow(hList); /* LVS_REPORT without WS_VISIBLE */ - hList = CreateWindow("SysListView32", "Test", LVS_REPORT, 0, 0, 100, 100, NULL, NULL, - GetModuleHandle(NULL), 0); - hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0); + hList = CreateWindowA("SysListView32", "Test", LVS_REPORT, 0, 0, 100, 100, NULL, NULL, + GetModuleHandleA(NULL), 0); + hHeader = (HWND)SendMessageA(hList, LVM_GETHEADER, 0, 0); ok(!IsWindow(hHeader), "Header shouldn't be created\n"); ok(NULL == GetDlgItem(hList, 0), "NULL dialog item expected\n"); /* insert column */ memset(&col, 0, sizeof(LVCOLUMNA)); col.mask = LVCF_WIDTH; col.cx = 100; - r = SendMessage(hList, LVM_INSERTCOLUMN, 0, (LPARAM)&col); + r = SendMessageA(hList, LVM_INSERTCOLUMNA, 0, (LPARAM)&col); expect(0, r); - hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0); + hHeader = (HWND)SendMessageA(hList, LVM_GETHEADER, 0, 0); ok(IsWindow(hHeader), "Header should be created\n"); ok(hHeader == GetDlgItem(hList, 0), "Expected header as dialog item\n"); DestroyWindow(hList); /* LVS_REPORT without WS_VISIBLE, try to show it */ - hList = CreateWindow("SysListView32", "Test", LVS_REPORT, 0, 0, 100, 100, NULL, NULL, - GetModuleHandle(NULL), 0); - hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0); + hList = CreateWindowA("SysListView32", "Test", LVS_REPORT, 0, 0, 100, 100, NULL, NULL, + GetModuleHandleA(NULL), 0); + hHeader = (HWND)SendMessageA(hList, LVM_GETHEADER, 0, 0); ok(!IsWindow(hHeader), "Header shouldn't be created\n"); ok(NULL == GetDlgItem(hList, 0), "NULL dialog item expected\n"); ShowWindow(hList, SW_SHOW); - hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0); + hHeader = (HWND)SendMessageA(hList, LVM_GETHEADER, 0, 0); ok(IsWindow(hHeader), "Header should be created\n"); ok(hHeader == GetDlgItem(hList, 0), "Expected header as dialog item\n"); DestroyWindow(hList); /* LVS_REPORT with LVS_NOCOLUMNHEADER */ - hList = CreateWindow("SysListView32", "Test", LVS_REPORT|LVS_NOCOLUMNHEADER|WS_VISIBLE, - 0, 0, 100, 100, NULL, NULL, GetModuleHandle(NULL), 0); - hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0); + hList = CreateWindowA("SysListView32", "Test", LVS_REPORT|LVS_NOCOLUMNHEADER|WS_VISIBLE, + 0, 0, 100, 100, NULL, NULL, GetModuleHandleA(NULL), 0); + hHeader = (HWND)SendMessageA(hList, LVM_GETHEADER, 0, 0); ok(IsWindow(hHeader), "Header should be created\n"); ok(hHeader == GetDlgItem(hList, 0), "Expected header as dialog item\n"); /* HDS_DRAGDROP set by default */ - ok(GetWindowLongPtr(hHeader, GWL_STYLE) & HDS_DRAGDROP, "Expected header to have HDS_DRAGDROP\n"); + ok(GetWindowLongPtrA(hHeader, GWL_STYLE) & HDS_DRAGDROP, "Expected header to have HDS_DRAGDROP\n"); DestroyWindow(hList); /* setting LVS_EX_HEADERDRAGDROP creates header */ - hList = CreateWindow("SysListView32", "Test", LVS_REPORT, 0, 0, 100, 100, NULL, NULL, - GetModuleHandle(NULL), 0); - hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0); + hList = CreateWindowA("SysListView32", "Test", LVS_REPORT, 0, 0, 100, 100, NULL, NULL, + GetModuleHandleA(NULL), 0); + hHeader = (HWND)SendMessageA(hList, LVM_GETHEADER, 0, 0); ok(!IsWindow(hHeader), "Header shouldn't be created\n"); ok(NULL == GetDlgItem(hList, 0), "NULL dialog item expected\n"); - SendMessage(hList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_HEADERDRAGDROP); - hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0); + SendMessageA(hList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_HEADERDRAGDROP); + hHeader = (HWND)SendMessageA(hList, LVM_GETHEADER, 0, 0); ok(IsWindow(hHeader) || broken(!IsWindow(hHeader)), /* 4.7x common controls */ "Header should be created\n"); @@ -1616,13 +1633,13 @@ static void test_create(void) DestroyWindow(hList); /* setting LVS_EX_GRIDLINES creates header */ - hList = CreateWindow("SysListView32", "Test", LVS_REPORT, 0, 0, 100, 100, NULL, NULL, - GetModuleHandle(NULL), 0); - hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0); + hList = CreateWindowA("SysListView32", "Test", LVS_REPORT, 0, 0, 100, 100, NULL, NULL, + GetModuleHandleA(NULL), 0); + hHeader = (HWND)SendMessageA(hList, LVM_GETHEADER, 0, 0); ok(!IsWindow(hHeader), "Header shouldn't be created\n"); ok(NULL == GetDlgItem(hList, 0), "NULL dialog item expected\n"); - SendMessage(hList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_GRIDLINES); - hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0); + SendMessageA(hList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_GRIDLINES); + hHeader = (HWND)SendMessageA(hList, LVM_GETHEADER, 0, 0); ok(IsWindow(hHeader) || broken(!IsWindow(hHeader)), /* 4.7x common controls */ "Header should be created\n"); @@ -1630,13 +1647,13 @@ static void test_create(void) DestroyWindow(hList); /* setting LVS_EX_FULLROWSELECT creates header */ - hList = CreateWindow("SysListView32", "Test", LVS_REPORT, 0, 0, 100, 100, NULL, NULL, - GetModuleHandle(NULL), 0); - hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0); + hList = CreateWindowA("SysListView32", "Test", LVS_REPORT, 0, 0, 100, 100, NULL, NULL, + GetModuleHandleA(NULL), 0); + hHeader = (HWND)SendMessageA(hList, LVM_GETHEADER, 0, 0); ok(!IsWindow(hHeader), "Header shouldn't be created\n"); ok(NULL == GetDlgItem(hList, 0), "NULL dialog item expected\n"); - SendMessage(hList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT); - hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0); + SendMessageA(hList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT); + hHeader = (HWND)SendMessageA(hList, LVM_GETHEADER, 0, 0); ok(IsWindow(hHeader) || broken(!IsWindow(hHeader)), /* 4.7x common controls */ "Header should be created\n"); @@ -1645,26 +1662,26 @@ static void test_create(void) /* not report style accepts LVS_EX_HEADERDRAGDROP too */ hList = create_listview_control(LVS_ICON); - SendMessage(hList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_HEADERDRAGDROP); - r = SendMessage(hList, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0); + SendMessageA(hList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_HEADERDRAGDROP); + r = SendMessageA(hList, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0); ok(r & LVS_EX_HEADERDRAGDROP, "Expected LVS_EX_HEADERDRAGDROP to be set\n"); DestroyWindow(hList); /* requesting header info with LVM_GETSUBITEMRECT doesn't create it */ - hList = CreateWindow("SysListView32", "Test", LVS_REPORT, 0, 0, 100, 100, NULL, NULL, - GetModuleHandle(NULL), 0); + hList = CreateWindowA("SysListView32", "Test", LVS_REPORT, 0, 0, 100, 100, NULL, NULL, + GetModuleHandleA(NULL), 0); ok(!IsWindow(hHeader), "Header shouldn't be created\n"); ok(NULL == GetDlgItem(hList, 0), "NULL dialog item expected\n"); rect.left = LVIR_BOUNDS; rect.top = 1; rect.right = rect.bottom = -10; - r = SendMessage(hList, LVM_GETSUBITEMRECT, -1, (LPARAM)&rect); + r = SendMessageA(hList, LVM_GETSUBITEMRECT, -1, (LPARAM)&rect); /* right value contains garbage, probably because header columns are not set up */ expect(0, rect.bottom); expect(1, r); - hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0); + hHeader = (HWND)SendMessageA(hList, LVM_GETHEADER, 0, 0); ok(!IsWindow(hHeader), "Header shouldn't be created\n"); ok(GetDlgItem(hList, 0) == NULL, "NULL dialog item expected\n"); @@ -1698,7 +1715,7 @@ static void test_redraw(void) /* forward WM_ERASEBKGND to parent on CLR_NONE background color */ /* 1. Without backbuffer */ - res = ListView_SetBkColor(hwnd, CLR_NONE); + res = SendMessageA(hwnd, LVM_SETBKCOLOR, 0, CLR_NONE); expect(TRUE, res); hdc = GetWindowDC(hwndparent); @@ -1709,7 +1726,7 @@ static void test_redraw(void) ok_sequence(sequences, PARENT_FULL_SEQ_INDEX, forward_erasebkgnd_parent_seq, "forward WM_ERASEBKGND on CLR_NONE", FALSE); - res = ListView_SetBkColor(hwnd, CLR_DEFAULT); + res = SendMessageA(hwnd, LVM_SETBKCOLOR, 0, CLR_DEFAULT); expect(TRUE, res); flush_sequences(sequences, NUM_MSG_SEQUENCES); @@ -1721,7 +1738,7 @@ static void test_redraw(void) /* 2. With backbuffer */ SendMessageA(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_DOUBLEBUFFER, LVS_EX_DOUBLEBUFFER); - res = ListView_SetBkColor(hwnd, CLR_NONE); + res = SendMessageA(hwnd, LVM_SETBKCOLOR, 0, CLR_NONE); expect(TRUE, res); flush_sequences(sequences, NUM_MSG_SEQUENCES); @@ -1730,7 +1747,7 @@ static void test_redraw(void) ok_sequence(sequences, PARENT_FULL_SEQ_INDEX, forward_erasebkgnd_parent_seq, "forward WM_ERASEBKGND on CLR_NONE", FALSE); - res = ListView_SetBkColor(hwnd, CLR_DEFAULT); + res = SendMessageA(hwnd, LVM_SETBKCOLOR, 0, CLR_DEFAULT); expect(TRUE, res); flush_sequences(sequences, NUM_MSG_SEQUENCES); @@ -1790,13 +1807,13 @@ static void test_customdraw(void) insert_column(hwnd, 1); insert_item(hwnd, 0); - oldwndproc = (WNDPROC)SetWindowLongPtr(hwndparent, GWLP_WNDPROC, + oldwndproc = (WNDPROC)SetWindowLongPtrA(hwndparent, GWLP_WNDPROC, (LONG_PTR)cd_wndproc); InvalidateRect(hwnd, NULL, TRUE); UpdateWindow(hwnd); - SetWindowLongPtr(hwndparent, GWLP_WNDPROC, (LONG_PTR)oldwndproc); + SetWindowLongPtrA(hwndparent, GWLP_WNDPROC, (LONG_PTR)oldwndproc); DestroyWindow(hwnd); } @@ -1813,25 +1830,25 @@ static void test_icon_spacing(void) hwnd = create_listview_control(LVS_ICON); ok(hwnd != NULL, "failed to create a listview window\n"); - r = SendMessage(hwnd, WM_NOTIFYFORMAT, (WPARAM)hwndparent, NF_REQUERY); + r = SendMessageA(hwnd, WM_NOTIFYFORMAT, (WPARAM)hwndparent, NF_REQUERY); expect(NFR_ANSI, r); /* reset the icon spacing to defaults */ - SendMessage(hwnd, LVM_SETICONSPACING, 0, MAKELPARAM(-1, -1)); + SendMessageA(hwnd, LVM_SETICONSPACING, 0, MAKELPARAM(-1, -1)); /* now we can request what the defaults are */ - r = SendMessage(hwnd, LVM_SETICONSPACING, 0, MAKELPARAM(-1, -1)); + r = SendMessageA(hwnd, LVM_SETICONSPACING, 0, MAKELPARAM(-1, -1)); w = LOWORD(r); h = HIWORD(r); flush_sequences(sequences, NUM_MSG_SEQUENCES); - r = SendMessage(hwnd, LVM_SETICONSPACING, 0, MAKELPARAM(20, 30)); + r = SendMessageA(hwnd, LVM_SETICONSPACING, 0, MAKELPARAM(20, 30)); ok(r == MAKELONG(w, h) || broken(r == MAKELONG(w, w)), /* win98 */ "Expected %d, got %d\n", MAKELONG(w, h), r); - r = SendMessage(hwnd, LVM_SETICONSPACING, 0, MAKELPARAM(25, 35)); + r = SendMessageA(hwnd, LVM_SETICONSPACING, 0, MAKELPARAM(25, 35)); if (r == 0) { /* version 4.0 */ @@ -1841,7 +1858,7 @@ static void test_icon_spacing(void) } expect(MAKELONG(20,30), r); - r = SendMessage(hwnd, LVM_SETICONSPACING, 0, MAKELPARAM(-1,-1)); + r = SendMessageA(hwnd, LVM_SETICONSPACING, 0, MAKELPARAM(-1,-1)); expect(MAKELONG(25,35), r); ok_sequence(sequences, LISTVIEW_SEQ_INDEX, listview_icon_spacing_seq, "test icon spacing seq", FALSE); @@ -1869,19 +1886,19 @@ static void test_color(void) { color = colors[i]; - r = SendMessage(hwnd, LVM_SETBKCOLOR, 0, color); + r = SendMessageA(hwnd, LVM_SETBKCOLOR, 0, color); expect(TRUE, r); - r = SendMessage(hwnd, LVM_GETBKCOLOR, 0, 0); + r = SendMessageA(hwnd, LVM_GETBKCOLOR, 0, 0); expect(color, r); - r = SendMessage(hwnd, LVM_SETTEXTCOLOR, 0, color); + r = SendMessageA(hwnd, LVM_SETTEXTCOLOR, 0, color); expect (TRUE, r); - r = SendMessage(hwnd, LVM_GETTEXTCOLOR, 0, 0); + r = SendMessageA(hwnd, LVM_GETTEXTCOLOR, 0, 0); expect(color, r); - r = SendMessage(hwnd, LVM_SETTEXTBKCOLOR, 0, color); + r = SendMessageA(hwnd, LVM_SETTEXTBKCOLOR, 0, color); expect(TRUE, r); - r = SendMessage(hwnd, LVM_GETTEXTBKCOLOR, 0, 0); + r = SendMessageA(hwnd, LVM_GETTEXTBKCOLOR, 0, 0); expect(color, r); } @@ -1891,7 +1908,7 @@ static void test_color(void) /* invalidation test done separately to avoid a message chain mess */ r = ValidateRect(hwnd, NULL); expect(TRUE, r); - r = SendMessage(hwnd, LVM_SETBKCOLOR, 0, colors[0]); + r = SendMessageA(hwnd, LVM_SETBKCOLOR, 0, colors[0]); expect(TRUE, r); rect.right = rect.bottom = 1; @@ -1901,7 +1918,7 @@ static void test_color(void) r = ValidateRect(hwnd, NULL); expect(TRUE, r); - r = SendMessage(hwnd, LVM_SETTEXTCOLOR, 0, colors[0]); + r = SendMessageA(hwnd, LVM_SETTEXTCOLOR, 0, colors[0]); expect(TRUE, r); rect.right = rect.bottom = 1; @@ -1911,7 +1928,7 @@ static void test_color(void) r = ValidateRect(hwnd, NULL); expect(TRUE, r); - r = SendMessage(hwnd, LVM_SETTEXTBKCOLOR, 0, colors[0]); + r = SendMessageA(hwnd, LVM_SETTEXTBKCOLOR, 0, colors[0]); expect(TRUE, r); rect.right = rect.bottom = 1; @@ -1934,9 +1951,9 @@ static void test_item_count(void) RECT rect; INT height; - LVITEM item0; - LVITEM item1; - LVITEM item2; + LVITEMA item0; + LVITEMA item1; + LVITEMA item2; static CHAR item0text[] = "item0"; static CHAR item1text[] = "item1"; static CHAR item2text[] = "item2"; @@ -1959,7 +1976,7 @@ static void test_item_count(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); - r = SendMessage(hwnd, LVM_GETITEMCOUNT, 0, 0); + r = SendMessageA(hwnd, LVM_GETITEMCOUNT, 0, 0); expect(0, r); /* [item0] */ @@ -1967,7 +1984,7 @@ static void test_item_count(void) item0.iItem = 0; item0.iSubItem = 0; item0.pszText = item0text; - r = SendMessage(hwnd, LVM_INSERTITEM, 0, (LPARAM) &item0); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item0); expect(0, r); /* [item0, item1] */ @@ -1975,7 +1992,7 @@ static void test_item_count(void) item1.iItem = 1; item1.iSubItem = 0; item1.pszText = item1text; - r = SendMessage(hwnd, LVM_INSERTITEM, 0, (LPARAM) &item1); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item1); expect(1, r); /* [item0, item1, item2] */ @@ -1983,42 +2000,42 @@ static void test_item_count(void) item2.iItem = 2; item2.iSubItem = 0; item2.pszText = item2text; - r = SendMessage(hwnd, LVM_INSERTITEM, 0, (LPARAM) &item2); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item2); expect(2, r); - r = SendMessage(hwnd, LVM_GETITEMCOUNT, 0, 0); + r = SendMessageA(hwnd, LVM_GETITEMCOUNT, 0, 0); expect(3, r); /* [item0, item1] */ - r = SendMessage(hwnd, LVM_DELETEITEM, 2, 0); + r = SendMessageA(hwnd, LVM_DELETEITEM, 2, 0); expect(TRUE, r); - r = SendMessage(hwnd, LVM_GETITEMCOUNT, 0, 0); + r = SendMessageA(hwnd, LVM_GETITEMCOUNT, 0, 0); expect(2, r); /* [] */ - r = SendMessage(hwnd, LVM_DELETEALLITEMS, 0, 0); + r = SendMessageA(hwnd, LVM_DELETEALLITEMS, 0, 0); expect(TRUE, r); - r = SendMessage(hwnd, LVM_GETITEMCOUNT, 0, 0); + r = SendMessageA(hwnd, LVM_GETITEMCOUNT, 0, 0); expect(0, r); /* [item0] */ - r = SendMessage(hwnd, LVM_INSERTITEM, 0, (LPARAM) &item1); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item1); expect(0, r); /* [item0, item1] */ - r = SendMessage(hwnd, LVM_INSERTITEM, 0, (LPARAM) &item1); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item1); expect(1, r); - r = SendMessage(hwnd, LVM_GETITEMCOUNT, 0, 0); + r = SendMessageA(hwnd, LVM_GETITEMCOUNT, 0, 0); expect(2, r); /* [item0, item1, item2] */ - r = SendMessage(hwnd, LVM_INSERTITEM, 0, (LPARAM) &item2); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item2); expect(2, r); - r = SendMessage(hwnd, LVM_GETITEMCOUNT, 0, 0); + r = SendMessageA(hwnd, LVM_GETITEMCOUNT, 0, 0); expect(3, r); ok_sequence(sequences, LISTVIEW_SEQ_INDEX, listview_item_count_seq, "test item count seq", FALSE); @@ -2035,9 +2052,9 @@ static void test_item_position(void) DWORD r; POINT position; - LVITEM item0; - LVITEM item1; - LVITEM item2; + LVITEMA item0; + LVITEMA item1; + LVITEMA item2; static CHAR item0text[] = "item0"; static CHAR item1text[] = "item1"; static CHAR item2text[] = "item2"; @@ -2052,7 +2069,7 @@ static void test_item_position(void) item0.iItem = 0; item0.iSubItem = 0; item0.pszText = item0text; - r = SendMessage(hwnd, LVM_INSERTITEM, 0, (LPARAM) &item0); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item0); expect(0, r); /* [item0, item1] */ @@ -2060,7 +2077,7 @@ static void test_item_position(void) item1.iItem = 1; item1.iSubItem = 0; item1.pszText = item1text; - r = SendMessage(hwnd, LVM_INSERTITEM, 0, (LPARAM) &item1); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item1); expect(1, r); /* [item0, item1, item2] */ @@ -2068,24 +2085,24 @@ static void test_item_position(void) item2.iItem = 2; item2.iSubItem = 0; item2.pszText = item2text; - r = SendMessage(hwnd, LVM_INSERTITEM, 0, (LPARAM) &item2); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item2); expect(2, r); - r = SendMessage(hwnd, LVM_SETITEMPOSITION, 1, MAKELPARAM(10,5)); + r = SendMessageA(hwnd, LVM_SETITEMPOSITION, 1, MAKELPARAM(10,5)); expect(TRUE, r); - r = SendMessage(hwnd, LVM_GETITEMPOSITION, 1, (LPARAM) &position); + r = SendMessageA(hwnd, LVM_GETITEMPOSITION, 1, (LPARAM) &position); expect(TRUE, r); expect2(10, 5, position.x, position.y); - r = SendMessage(hwnd, LVM_SETITEMPOSITION, 2, MAKELPARAM(0,0)); + r = SendMessageA(hwnd, LVM_SETITEMPOSITION, 2, MAKELPARAM(0,0)); expect(TRUE, r); - r = SendMessage(hwnd, LVM_GETITEMPOSITION, 2, (LPARAM) &position); + r = SendMessageA(hwnd, LVM_GETITEMPOSITION, 2, (LPARAM) &position); expect(TRUE, r); expect2(0, 0, position.x, position.y); - r = SendMessage(hwnd, LVM_SETITEMPOSITION, 0, MAKELPARAM(20,20)); + r = SendMessageA(hwnd, LVM_SETITEMPOSITION, 0, MAKELPARAM(20,20)); expect(TRUE, r); - r = SendMessage(hwnd, LVM_GETITEMPOSITION, 0, (LPARAM) &position); + r = SendMessageA(hwnd, LVM_GETITEMPOSITION, 0, (LPARAM) &position); expect(TRUE, r); expect2(20, 20, position.x, position.y); @@ -2109,7 +2126,7 @@ static void test_getorigin(void) ok(hwnd != NULL, "failed to create a listview window\n"); flush_sequences(sequences, NUM_MSG_SEQUENCES); - r = SendMessage(hwnd, LVM_GETORIGIN, 0, (LPARAM)&position); + r = SendMessageA(hwnd, LVM_GETORIGIN, 0, (LPARAM)&position); expect(TRUE, r); flush_sequences(sequences, NUM_MSG_SEQUENCES); DestroyWindow(hwnd); @@ -2118,7 +2135,7 @@ static void test_getorigin(void) ok(hwnd != NULL, "failed to create a listview window\n"); flush_sequences(sequences, NUM_MSG_SEQUENCES); - r = SendMessage(hwnd, LVM_GETORIGIN, 0, (LPARAM)&position); + r = SendMessageA(hwnd, LVM_GETORIGIN, 0, (LPARAM)&position); expect(TRUE, r); flush_sequences(sequences, NUM_MSG_SEQUENCES); DestroyWindow(hwnd); @@ -2127,7 +2144,7 @@ static void test_getorigin(void) ok(hwnd != NULL, "failed to create a listview window\n"); flush_sequences(sequences, NUM_MSG_SEQUENCES); - r = SendMessage(hwnd, LVM_GETORIGIN, 0, (LPARAM)&position); + r = SendMessageA(hwnd, LVM_GETORIGIN, 0, (LPARAM)&position); expect(FALSE, r); flush_sequences(sequences, NUM_MSG_SEQUENCES); DestroyWindow(hwnd); @@ -2136,7 +2153,7 @@ static void test_getorigin(void) ok(hwnd != NULL, "failed to create a listview window\n"); flush_sequences(sequences, NUM_MSG_SEQUENCES); - r = SendMessage(hwnd, LVM_GETORIGIN, 0, (LPARAM)&position); + r = SendMessageA(hwnd, LVM_GETORIGIN, 0, (LPARAM)&position); expect(FALSE, r); flush_sequences(sequences, NUM_MSG_SEQUENCES); DestroyWindow(hwnd); @@ -2174,7 +2191,7 @@ static void test_multiselect(void) for (i = 0; i < items; i++) insert_item(hwnd, 0); - item_count = (int)SendMessage(hwnd, LVM_GETITEMCOUNT, 0, 0); + item_count = (int)SendMessageA(hwnd, LVM_GETITEMCOUNT, 0, 0); expect(items, item_count); for (i = 0; i < 4; i++) { @@ -2186,10 +2203,10 @@ static void test_multiselect(void) item.state = 0; item.stateMask = LVIS_SELECTED; SendMessageA(hwnd, LVM_SETITEMSTATE, -1, (LPARAM)&item); - SendMessage(hwnd, LVM_SETSELECTIONMARK, 0, -1); + SendMessageA(hwnd, LVM_SETSELECTIONMARK, 0, -1); /* set initial position */ - SendMessage(hwnd, LVM_SETSELECTIONMARK, 0, (task.initPos == -1 ? item_count -1 : task.initPos)); + SendMessageA(hwnd, LVM_SETSELECTIONMARK, 0, (task.initPos == -1 ? item_count -1 : task.initPos)); item.state = LVIS_SELECTED; item.stateMask = LVIS_SELECTED; @@ -2204,13 +2221,13 @@ static void test_multiselect(void) SetKeyboardState(kstate); for (j=1;j<=(task.count == -1 ? item_count : task.count);j++) { - r = SendMessage(hwnd, WM_KEYDOWN, task.loopVK, 0); + r = SendMessageA(hwnd, WM_KEYDOWN, task.loopVK, 0); expect(0,r); - r = SendMessage(hwnd, WM_KEYUP, task.loopVK, 0); + r = SendMessageA(hwnd, WM_KEYUP, task.loopVK, 0); expect(0,r); } - selected_count = (int)SendMessage(hwnd, LVM_GETSELECTEDCOUNT, 0, 0); + selected_count = (int)SendMessageA(hwnd, LVM_GETSELECTEDCOUNT, 0, 0); ok((task.result == -1 ? item_count : task.result) == selected_count, "Failed multiple selection %s. There should be %d selected items (is %d)\n", task.descr, item_count, selected_count); @@ -2226,7 +2243,7 @@ static void test_multiselect(void) for (i=0;i rect2.top, "expected not zero height\n"); arr[0] = 1; arr[1] = 0; arr[2] = 2; - r = SendMessage(hwnd, LVM_SETCOLUMNORDERARRAY, 3, (LPARAM)arr); + r = SendMessageA(hwnd, LVM_SETCOLUMNORDERARRAY, 3, (LPARAM)arr); expect(TRUE, r); rect.left = LVIR_BOUNDS; rect.top = 0; rect.right = rect.bottom = -1; - r = SendMessage(hwnd, LVM_GETSUBITEMRECT, 0, (LPARAM)&rect); + r = SendMessageA(hwnd, LVM_GETSUBITEMRECT, 0, (LPARAM)&rect); expect(TRUE, r); expect(0, rect.left); expect(600, rect.right); @@ -2685,7 +2703,7 @@ static void test_subitem_rect(void) rect.left = LVIR_BOUNDS; rect.top = 1; rect.right = rect.bottom = -1; - r = SendMessage(hwnd, LVM_GETSUBITEMRECT, 0, (LPARAM)&rect); + r = SendMessageA(hwnd, LVM_GETSUBITEMRECT, 0, (LPARAM)&rect); expect(TRUE, r); expect(0, rect.left); expect(200, rect.right); @@ -2693,7 +2711,7 @@ static void test_subitem_rect(void) rect2.left = LVIR_BOUNDS; rect2.top = 1; rect2.right = rect2.bottom = -1; - r = SendMessage(hwnd, LVM_GETSUBITEMRECT, 1, (LPARAM)&rect2); + r = SendMessageA(hwnd, LVM_GETSUBITEMRECT, 1, (LPARAM)&rect2); expect(TRUE, r); expect(0, rect2.left); expect(200, rect2.right); @@ -2705,7 +2723,7 @@ static void test_subitem_rect(void) rect.left = LVIR_BOUNDS; rect.top = 2; rect.right = rect.bottom = -1; - r = SendMessage(hwnd, LVM_GETSUBITEMRECT, 0, (LPARAM)&rect); + r = SendMessageA(hwnd, LVM_GETSUBITEMRECT, 0, (LPARAM)&rect); expect(TRUE, r); expect(300, rect.left); expect(600, rect.right); @@ -2713,12 +2731,12 @@ static void test_subitem_rect(void) DestroyWindow(hwnd); /* try it for non LVS_REPORT style */ - hwnd = CreateWindow("SysListView32", "Test", LVS_ICON, 0, 0, 100, 100, NULL, NULL, - GetModuleHandle(NULL), 0); + hwnd = CreateWindowA("SysListView32", "Test", LVS_ICON, 0, 0, 100, 100, NULL, NULL, + GetModuleHandleA(NULL), 0); rect.left = LVIR_BOUNDS; rect.top = 1; rect.right = rect.bottom = -10; - r = SendMessage(hwnd, LVM_GETSUBITEMRECT, -1, (LPARAM)&rect); + r = SendMessageA(hwnd, LVM_GETSUBITEMRECT, -1, (LPARAM)&rect); expect(0, r); /* rect is unchanged */ expect(0, rect.left); @@ -2753,14 +2771,14 @@ static void test_sorting(void) item.iItem = 0; item.iSubItem = 0; item.lParam = 3; - r = SendMessage(hwnd, LVM_INSERTITEM, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item); expect(0, r); item.mask = LVIF_PARAM; item.iItem = 1; item.iSubItem = 0; item.lParam = 2; - r = SendMessage(hwnd, LVM_INSERTITEM, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item); expect(1, r); item.mask = LVIF_STATE | LVIF_PARAM; @@ -2768,27 +2786,27 @@ static void test_sorting(void) item.iItem = 2; item.iSubItem = 0; item.lParam = 4; - r = SendMessage(hwnd, LVM_INSERTITEM, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item); expect(2, r); - r = SendMessage(hwnd, LVM_GETSELECTIONMARK, 0, 0); + r = SendMessageA(hwnd, LVM_GETSELECTIONMARK, 0, 0); expect(-1, r); - r = SendMessage(hwnd, LVM_GETSELECTEDCOUNT, 0, 0); + r = SendMessageA(hwnd, LVM_GETSELECTEDCOUNT, 0, 0); expect(2, r); - r = SendMessage(hwnd, LVM_SORTITEMS, 0, (LPARAM)test_CallBackCompare); + r = SendMessageA(hwnd, LVM_SORTITEMS, 0, (LPARAM)test_CallBackCompare); expect(TRUE, r); - r = SendMessage(hwnd, LVM_GETSELECTEDCOUNT, 0, 0); + r = SendMessageA(hwnd, LVM_GETSELECTEDCOUNT, 0, 0); expect(2, r); - r = SendMessage(hwnd, LVM_GETSELECTIONMARK, 0, 0); + r = SendMessageA(hwnd, LVM_GETSELECTIONMARK, 0, 0); expect(-1, r); - r = SendMessage(hwnd, LVM_GETITEMSTATE, 0, LVIS_SELECTED); + r = SendMessageA(hwnd, LVM_GETITEMSTATE, 0, LVIS_SELECTED); expect(0, r); - r = SendMessage(hwnd, LVM_GETITEMSTATE, 1, LVIS_SELECTED); + r = SendMessageA(hwnd, LVM_GETITEMSTATE, 1, LVIS_SELECTED); expect(LVIS_SELECTED, r); - r = SendMessage(hwnd, LVM_GETITEMSTATE, 2, LVIS_SELECTED); + r = SendMessageA(hwnd, LVM_GETITEMSTATE, 2, LVIS_SELECTED); expect(LVIS_SELECTED, r); DestroyWindow(hwnd); @@ -2801,21 +2819,21 @@ static void test_sorting(void) item.iItem = 0; item.iSubItem = 0; item.pszText = names[1]; - r = SendMessage(hwnd, LVM_INSERTITEM, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item); expect(0, r); item.mask = LVIF_TEXT; item.iItem = 1; item.iSubItem = 0; item.pszText = names[2]; - r = SendMessage(hwnd, LVM_INSERTITEM, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item); expect(1, r); item.mask = LVIF_TEXT; item.iItem = 2; item.iSubItem = 0; item.pszText = names[0]; - r = SendMessage(hwnd, LVM_INSERTITEM, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item); expect(2, r); style = GetWindowLongPtrA(hwnd, GWL_STYLE); @@ -2828,87 +2846,87 @@ static void test_sorting(void) item.iItem = 0; item.pszText = buff; item.cchTextMax = sizeof(buff); - r = SendMessage(hwnd, LVM_GETITEM, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(TRUE, r); - ok(lstrcmp(buff, names[1]) == 0, "Expected '%s', got '%s'\n", names[1], buff); + ok(lstrcmpA(buff, names[1]) == 0, "Expected '%s', got '%s'\n", names[1], buff); item.iItem = 1; - r = SendMessage(hwnd, LVM_GETITEM, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(TRUE, r); - ok(lstrcmp(buff, names[2]) == 0, "Expected '%s', got '%s'\n", names[2], buff); + ok(lstrcmpA(buff, names[2]) == 0, "Expected '%s', got '%s'\n", names[2], buff); item.iItem = 2; - r = SendMessage(hwnd, LVM_GETITEM, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(TRUE, r); - ok(lstrcmp(buff, names[0]) == 0, "Expected '%s', got '%s'\n", names[0], buff); + ok(lstrcmpA(buff, names[0]) == 0, "Expected '%s', got '%s'\n", names[0], buff); /* adding new item doesn't resort list */ item.mask = LVIF_TEXT; item.iItem = 3; item.iSubItem = 0; item.pszText = names[3]; - r = SendMessage(hwnd, LVM_INSERTITEM, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item); expect(3, r); item.mask = LVIF_TEXT; item.iItem = 0; item.pszText = buff; item.cchTextMax = sizeof(buff); - r = SendMessage(hwnd, LVM_GETITEM, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(TRUE, r); - ok(lstrcmp(buff, names[1]) == 0, "Expected '%s', got '%s'\n", names[1], buff); + ok(lstrcmpA(buff, names[1]) == 0, "Expected '%s', got '%s'\n", names[1], buff); item.iItem = 1; - r = SendMessage(hwnd, LVM_GETITEM, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(TRUE, r); - ok(lstrcmp(buff, names[2]) == 0, "Expected '%s', got '%s'\n", names[2], buff); + ok(lstrcmpA(buff, names[2]) == 0, "Expected '%s', got '%s'\n", names[2], buff); item.iItem = 2; - r = SendMessage(hwnd, LVM_GETITEM, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(TRUE, r); - ok(lstrcmp(buff, names[0]) == 0, "Expected '%s', got '%s'\n", names[0], buff); + ok(lstrcmpA(buff, names[0]) == 0, "Expected '%s', got '%s'\n", names[0], buff); item.iItem = 3; - r = SendMessage(hwnd, LVM_GETITEM, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(TRUE, r); - ok(lstrcmp(buff, names[3]) == 0, "Expected '%s', got '%s'\n", names[3], buff); + ok(lstrcmpA(buff, names[3]) == 0, "Expected '%s', got '%s'\n", names[3], buff); /* corner case - item should be placed at first position */ item.mask = LVIF_TEXT; item.iItem = 4; item.iSubItem = 0; item.pszText = names[4]; - r = SendMessage(hwnd, LVM_INSERTITEM, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item); expect(0, r); item.iItem = 0; item.pszText = buff; item.cchTextMax = sizeof(buff); - r = SendMessage(hwnd, LVM_GETITEM, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(TRUE, r); - ok(lstrcmp(buff, names[4]) == 0, "Expected '%s', got '%s'\n", names[4], buff); + ok(lstrcmpA(buff, names[4]) == 0, "Expected '%s', got '%s'\n", names[4], buff); item.iItem = 1; item.pszText = buff; item.cchTextMax = sizeof(buff); - r = SendMessage(hwnd, LVM_GETITEM, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(TRUE, r); - ok(lstrcmp(buff, names[1]) == 0, "Expected '%s', got '%s'\n", names[1], buff); + ok(lstrcmpA(buff, names[1]) == 0, "Expected '%s', got '%s'\n", names[1], buff); item.iItem = 2; - r = SendMessage(hwnd, LVM_GETITEM, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(TRUE, r); - ok(lstrcmp(buff, names[2]) == 0, "Expected '%s', got '%s'\n", names[2], buff); + ok(lstrcmpA(buff, names[2]) == 0, "Expected '%s', got '%s'\n", names[2], buff); item.iItem = 3; - r = SendMessage(hwnd, LVM_GETITEM, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(TRUE, r); - ok(lstrcmp(buff, names[0]) == 0, "Expected '%s', got '%s'\n", names[0], buff); + ok(lstrcmpA(buff, names[0]) == 0, "Expected '%s', got '%s'\n", names[0], buff); item.iItem = 4; - r = SendMessage(hwnd, LVM_GETITEM, 0, (LPARAM) &item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(TRUE, r); - ok(lstrcmp(buff, names[3]) == 0, "Expected '%s', got '%s'\n", names[3], buff); + ok(lstrcmpA(buff, names[3]) == 0, "Expected '%s', got '%s'\n", names[3], buff); DestroyWindow(hwnd); } @@ -3013,11 +3031,11 @@ static void test_ownerdata(void) item.iItem = 0; item.stateMask = LVIS_SELECTED; item.state = LVIS_SELECTED; - res = SendMessageA(hwnd, LVM_SETITEM, 0, (LPARAM)&item); + res = SendMessageA(hwnd, LVM_SETITEMA, 0, (LPARAM)&item); expect(FALSE, res); memset(&item, 0, sizeof(item)); item.pszText = test_str; - res = SendMessageA(hwnd, LVM_SETITEMTEXT, 0, (LPARAM)&item); + res = SendMessageA(hwnd, LVM_SETITEMTEXTA, 0, (LPARAM)&item); expect(FALSE, res); DestroyWindow(hwnd); @@ -3172,7 +3190,7 @@ static void test_ownerdata(void) /* focus single item, remove all */ item.stateMask = LVIS_FOCUSED; item.state = LVIS_FOCUSED; - res = SendMessage(hwnd, LVM_SETITEMSTATE, 0, (LPARAM)&item); + res = SendMessageA(hwnd, LVM_SETITEMSTATE, 0, (LPARAM)&item); expect(TRUE, res); flush_sequences(sequences, NUM_MSG_SEQUENCES); item.stateMask = LVIS_FOCUSED; @@ -3326,21 +3344,21 @@ static void test_norecompute(void) item.stateMask = LVIS_SELECTED; item.state = LVIS_SELECTED; item.pszText = testA; - res = SendMessageA(hwnd, LVM_INSERTITEM, 0, (LPARAM)&item); + res = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&item); expect(0, res); /* retrieve with LVIF_NORECOMPUTE */ item.mask = LVIF_TEXT | LVIF_NORECOMPUTE; item.iItem = 0; item.pszText = buff; item.cchTextMax = sizeof(buff)/sizeof(CHAR); - res = SendMessageA(hwnd, LVM_GETITEM, 0, (LPARAM)&item); + res = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM)&item); expect(TRUE, res); - ok(lstrcmp(buff, testA) == 0, "Expected (%s), got (%s)\n", testA, buff); + ok(lstrcmpA(buff, testA) == 0, "Expected (%s), got (%s)\n", testA, buff); item.mask = LVIF_TEXT; item.iItem = 1; - item.pszText = LPSTR_TEXTCALLBACK; - res = SendMessageA(hwnd, LVM_INSERTITEM, 0, (LPARAM)&item); + item.pszText = LPSTR_TEXTCALLBACKA; + res = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&item); expect(1, res); item.mask = LVIF_TEXT | LVIF_NORECOMPUTE; @@ -3349,10 +3367,10 @@ static void test_norecompute(void) item.cchTextMax = sizeof(buff)/sizeof(CHAR); flush_sequences(sequences, NUM_MSG_SEQUENCES); - res = SendMessageA(hwnd, LVM_GETITEM, 0, (LPARAM)&item); + res = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM)&item); expect(TRUE, res); - ok(item.pszText == LPSTR_TEXTCALLBACK, "Expected (%p), got (%p)\n", - LPSTR_TEXTCALLBACK, (VOID*)item.pszText); + ok(item.pszText == LPSTR_TEXTCALLBACKA, "Expected (%p), got (%p)\n", + LPSTR_TEXTCALLBACKA, (VOID*)item.pszText); ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "retrieve with LVIF_NORECOMPUTE seq", FALSE); DestroyWindow(hwnd); @@ -3365,7 +3383,7 @@ static void test_norecompute(void) item.stateMask = LVIS_SELECTED; item.state = LVIS_SELECTED; item.iItem = 0; - res = SendMessageA(hwnd, LVM_INSERTITEM, 0, (LPARAM)&item); + res = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&item); expect(0, res); item.mask = LVIF_TEXT | LVIF_NORECOMPUTE; @@ -3373,10 +3391,10 @@ static void test_norecompute(void) item.pszText = buff; item.cchTextMax = sizeof(buff)/sizeof(CHAR); flush_sequences(sequences, NUM_MSG_SEQUENCES); - res = SendMessageA(hwnd, LVM_GETITEM, 0, (LPARAM)&item); + res = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM)&item); expect(TRUE, res); - ok(item.pszText == LPSTR_TEXTCALLBACK, "Expected (%p), got (%p)\n", - LPSTR_TEXTCALLBACK, (VOID*)item.pszText); + ok(item.pszText == LPSTR_TEXTCALLBACKA, "Expected (%p), got (%p)\n", + LPSTR_TEXTCALLBACKA, (VOID*)item.pszText); ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "retrieve with LVIF_NORECOMPUTE seq 2", FALSE); DestroyWindow(hwnd); @@ -3393,13 +3411,13 @@ static void test_nosortheader(void) header = (HWND)SendMessageA(hwnd, LVM_GETHEADER, 0, 0); ok(IsWindow(header), "header expected\n"); - style = GetWindowLongPtr(header, GWL_STYLE); + style = GetWindowLongPtrA(header, GWL_STYLE); ok(style & HDS_BUTTONS, "expected header to have HDS_BUTTONS\n"); - style = GetWindowLongPtr(hwnd, GWL_STYLE); - SetWindowLongPtr(hwnd, GWL_STYLE, style | LVS_NOSORTHEADER); + style = GetWindowLongPtrA(hwnd, GWL_STYLE); + SetWindowLongPtrA(hwnd, GWL_STYLE, style | LVS_NOSORTHEADER); /* HDS_BUTTONS retained */ - style = GetWindowLongPtr(header, GWL_STYLE); + style = GetWindowLongPtrA(header, GWL_STYLE); ok(style & HDS_BUTTONS, "expected header to retain HDS_BUTTONS\n"); DestroyWindow(hwnd); @@ -3411,13 +3429,13 @@ static void test_nosortheader(void) header = (HWND)SendMessageA(hwnd, LVM_GETHEADER, 0, 0); ok(IsWindow(header), "header expected\n"); - style = GetWindowLongPtr(header, GWL_STYLE); + style = GetWindowLongPtrA(header, GWL_STYLE); ok(!(style & HDS_BUTTONS), "expected header to have no HDS_BUTTONS\n"); - style = GetWindowLongPtr(hwnd, GWL_STYLE); - SetWindowLongPtr(hwnd, GWL_STYLE, style & ~LVS_NOSORTHEADER); + style = GetWindowLongPtrA(hwnd, GWL_STYLE); + SetWindowLongPtrA(hwnd, GWL_STYLE, style & ~LVS_NOSORTHEADER); /* not changed here */ - style = GetWindowLongPtr(header, GWL_STYLE); + style = GetWindowLongPtrA(header, GWL_STYLE); ok(!(style & HDS_BUTTONS), "expected header to have no HDS_BUTTONS\n"); DestroyWindow(hwnd); @@ -3438,20 +3456,20 @@ static void test_setredraw(void) ListView seems to handle it internally without DefWinProc */ /* default value first */ - ret = SendMessage(hwnd, WM_SETREDRAW, TRUE, 0); + ret = SendMessageA(hwnd, WM_SETREDRAW, TRUE, 0); expect(0, ret); /* disable */ - style = GetWindowLongPtr(hwnd, GWL_STYLE); + style = GetWindowLongPtrA(hwnd, GWL_STYLE); ok(style & WS_VISIBLE, "Expected WS_VISIBLE to be set\n"); - ret = SendMessage(hwnd, WM_SETREDRAW, FALSE, 0); + ret = SendMessageA(hwnd, WM_SETREDRAW, FALSE, 0); expect(0, ret); - style = GetWindowLongPtr(hwnd, GWL_STYLE); + style = GetWindowLongPtrA(hwnd, GWL_STYLE); ok(style & WS_VISIBLE, "Expected WS_VISIBLE to be set\n"); - ret = SendMessage(hwnd, WM_SETREDRAW, TRUE, 0); + ret = SendMessageA(hwnd, WM_SETREDRAW, TRUE, 0); expect(0, ret); /* check update rect after redrawing */ - ret = SendMessage(hwnd, WM_SETREDRAW, FALSE, 0); + ret = SendMessageA(hwnd, WM_SETREDRAW, FALSE, 0); expect(0, ret); InvalidateRect(hwnd, NULL, FALSE); RedrawWindow(hwnd, NULL, NULL, RDW_UPDATENOW); @@ -3462,20 +3480,20 @@ static void test_setredraw(void) /* WM_ERASEBKGND */ hdc = GetWindowDC(hwndparent); - ret = SendMessage(hwnd, WM_ERASEBKGND, (WPARAM)hdc, 0); + ret = SendMessageA(hwnd, WM_ERASEBKGND, (WPARAM)hdc, 0); expect(TRUE, ret); - ret = SendMessage(hwnd, WM_SETREDRAW, FALSE, 0); + ret = SendMessageA(hwnd, WM_SETREDRAW, FALSE, 0); expect(0, ret); - ret = SendMessage(hwnd, WM_ERASEBKGND, (WPARAM)hdc, 0); + ret = SendMessageA(hwnd, WM_ERASEBKGND, (WPARAM)hdc, 0); expect(TRUE, ret); - ret = SendMessage(hwnd, WM_SETREDRAW, TRUE, 0); + ret = SendMessageA(hwnd, WM_SETREDRAW, TRUE, 0); expect(0, ret); ReleaseDC(hwndparent, hdc); /* check notification messages to show that repainting is disabled */ - ret = SendMessage(hwnd, LVM_SETITEMCOUNT, 1, 0); + ret = SendMessageA(hwnd, LVM_SETITEMCOUNT, 1, 0); expect(TRUE, ret); - ret = SendMessage(hwnd, WM_SETREDRAW, FALSE, 0); + ret = SendMessageA(hwnd, WM_SETREDRAW, FALSE, 0); expect(0, ret); flush_sequences(sequences, NUM_MSG_SEQUENCES); @@ -3484,7 +3502,7 @@ static void test_setredraw(void) ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "redraw after WM_SETREDRAW (FALSE)", FALSE); - ret = SendMessage(hwnd, LVM_SETBKCOLOR, 0, CLR_NONE); + ret = SendMessageA(hwnd, LVM_SETBKCOLOR, 0, CLR_NONE); expect(TRUE, ret); flush_sequences(sequences, NUM_MSG_SEQUENCES); InvalidateRect(hwnd, NULL, TRUE); @@ -3495,7 +3513,7 @@ static void test_setredraw(void) /* message isn't forwarded to header */ subclass_header(hwnd); flush_sequences(sequences, NUM_MSG_SEQUENCES); - ret = SendMessage(hwnd, WM_SETREDRAW, FALSE, 0); + ret = SendMessageA(hwnd, WM_SETREDRAW, FALSE, 0); expect(0, ret); ok_sequence(sequences, LISTVIEW_SEQ_INDEX, setredraw_seq, "WM_SETREDRAW: not forwarded to header", FALSE); @@ -3527,25 +3545,25 @@ static void test_hittest(void) item.iSubItem = 0; /* the only purpose of that line is to be as long as a half item rect */ item.pszText = text; - r = SendMessage(hwnd, LVM_SETITEMTEXT, 0, (LPARAM)&item); + r = SendMessageA(hwnd, LVM_SETITEMTEXTA, 0, (LPARAM)&item); expect(TRUE, r); - r = SendMessage(hwnd, LVM_SETCOLUMNWIDTH, 0, MAKELPARAM(100, 0)); + r = SendMessageA(hwnd, LVM_SETCOLUMNWIDTH, 0, MAKELPARAM(100, 0)); expect(TRUE, r); - r = SendMessage(hwnd, LVM_SETCOLUMNWIDTH, 1, MAKELPARAM(100, 0)); + r = SendMessageA(hwnd, LVM_SETCOLUMNWIDTH, 1, MAKELPARAM(100, 0)); expect(TRUE, r); memset(&bounds, 0, sizeof(bounds)); bounds.left = LVIR_BOUNDS; - r = SendMessage(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&bounds); + r = SendMessageA(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&bounds); expect(1, r); ok(bounds.bottom - bounds.top > 0, "Expected non zero item height\n"); ok(bounds.right - bounds.left > 0, "Expected non zero item width\n"); - r = SendMessage(hwnd, LVM_GETITEMSPACING, TRUE, 0); + r = SendMessageA(hwnd, LVM_GETITEMSPACING, TRUE, 0); vert = HIWORD(r); ok(bounds.bottom - bounds.top == vert, "Vertical spacing inconsistent (%d != %d)\n", bounds.bottom - bounds.top, vert); - r = SendMessage(hwnd, LVM_GETITEMPOSITION, 0, (LPARAM)&pos); + r = SendMessageA(hwnd, LVM_GETITEMPOSITION, 0, (LPARAM)&pos); expect(TRUE, r); /* LVS_EX_FULLROWSELECT not set, no icons attached */ @@ -3599,7 +3617,7 @@ static void test_hittest(void) test_lvm_hittest(hwnd, x, y, -1, LVHT_NOWHERE, 0, FALSE, TRUE); test_lvm_subitemhittest(hwnd, x, y, 0, 1, LVHT_ONITEMLABEL, FALSE, FALSE, FALSE); /* the same with LVS_EX_FULLROWSELECT */ - SendMessage(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT); + SendMessageA(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT); x = pos.x + 150; /* outside column */ y = pos.y + (bounds.bottom - bounds.top) / 2; test_lvm_hittest(hwnd, x, y, 0, LVHT_ONITEM, LVHT_ONITEMLABEL, FALSE, FALSE); @@ -3634,14 +3652,14 @@ static void test_hittest(void) r = ImageList_Add(himl, hbmp, 0); ok(r == 1, "should be one\n"); - r = SendMessage(hwnd, LVM_SETIMAGELIST, LVSIL_STATE, (LPARAM)himl); + r = SendMessageA(hwnd, LVM_SETIMAGELIST, LVSIL_STATE, (LPARAM)himl); expect(0, r); item.mask = LVIF_IMAGE; item.iImage = 0; item.iItem = 0; item.iSubItem = 0; - r = SendMessage(hwnd, LVM_SETITEM, 0, (LPARAM)&item); + r = SendMessageA(hwnd, LVM_SETITEMA, 0, (LPARAM)&item); expect(TRUE, r); /* on state icon */ x = pos.x + 8; @@ -3657,7 +3675,7 @@ static void test_hittest(void) item.stateMask = LVIS_STATEIMAGEMASK; item.iItem = 0; item.iSubItem = 0; - r = SendMessage(hwnd, LVM_SETITEM, 0, (LPARAM)&item); + r = SendMessageA(hwnd, LVM_SETITEMA, 0, (LPARAM)&item); expect(TRUE, r); /* on state icon */ x = pos.x + 8; @@ -3667,10 +3685,10 @@ static void test_hittest(void) y = (bounds.bottom - bounds.top) / 2; test_lvm_subitemhittest(hwnd, x, y, 0, 0, LVHT_ONITEMSTATEICON, FALSE, FALSE, FALSE); - himl2 = (HIMAGELIST)SendMessage(hwnd, LVM_SETIMAGELIST, LVSIL_STATE, 0); + himl2 = (HIMAGELIST)SendMessageA(hwnd, LVM_SETIMAGELIST, LVSIL_STATE, 0); ok(himl2 == himl, "should return handle\n"); - r = SendMessage(hwnd, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)himl); + r = SendMessageA(hwnd, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)himl); expect(0, r); /* on item icon */ x = pos.x + 8; @@ -3694,7 +3712,7 @@ static void test_getviewrect(void) ok(hwnd != NULL, "failed to create a listview window\n"); /* empty */ - r = SendMessage(hwnd, LVM_GETVIEWRECT, 0, (LPARAM)&rect); + r = SendMessageA(hwnd, LVM_GETVIEWRECT, 0, (LPARAM)&rect); expect(TRUE, r); insert_column(hwnd, 0); @@ -3703,15 +3721,15 @@ static void test_getviewrect(void) memset(&item, 0, sizeof(item)); item.iItem = 0; item.iSubItem = 0; - SendMessage(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&item); + SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&item); - r = SendMessage(hwnd, LVM_SETCOLUMNWIDTH, 0, MAKELPARAM(100, 0)); + r = SendMessageA(hwnd, LVM_SETCOLUMNWIDTH, 0, MAKELPARAM(100, 0)); expect(TRUE, r); - r = SendMessage(hwnd, LVM_SETCOLUMNWIDTH, 1, MAKELPARAM(120, 0)); + r = SendMessageA(hwnd, LVM_SETCOLUMNWIDTH, 1, MAKELPARAM(120, 0)); expect(TRUE, r); rect.left = rect.right = rect.top = rect.bottom = -1; - r = SendMessage(hwnd, LVM_GETVIEWRECT, 0, (LPARAM)&rect); + r = SendMessageA(hwnd, LVM_GETVIEWRECT, 0, (LPARAM)&rect); expect(TRUE, r); /* left is set to (2e31-1) - XP SP2 */ expect(0, rect.right); @@ -3719,10 +3737,10 @@ static void test_getviewrect(void) expect(0, rect.bottom); /* switch to LVS_ICON */ - SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) & ~LVS_REPORT); + SetWindowLongA(hwnd, GWL_STYLE, GetWindowLongA(hwnd, GWL_STYLE) & ~LVS_REPORT); rect.left = rect.right = rect.top = rect.bottom = -1; - r = SendMessage(hwnd, LVM_GETVIEWRECT, 0, (LPARAM)&rect); + r = SendMessageA(hwnd, LVM_GETVIEWRECT, 0, (LPARAM)&rect); expect(TRUE, r); expect(0, rect.left); expect(0, rect.top); @@ -3750,7 +3768,7 @@ static void test_getitemposition(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); pt.x = pt.y = -1; - r = SendMessage(hwnd, LVM_GETITEMPOSITION, 0, (LPARAM)&pt); + r = SendMessageA(hwnd, LVM_GETITEMPOSITION, 0, (LPARAM)&pt); expect(TRUE, r); ok_sequence(sequences, LISTVIEW_SEQ_INDEX, getitemposition_seq1, "get item position 1", FALSE); @@ -3760,12 +3778,12 @@ static void test_getitemposition(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); pt.x = pt.y = -1; - r = SendMessage(hwnd, LVM_GETITEMPOSITION, 0, (LPARAM)&pt); + r = SendMessageA(hwnd, LVM_GETITEMPOSITION, 0, (LPARAM)&pt); expect(TRUE, r); ok_sequence(sequences, LISTVIEW_SEQ_INDEX, getitemposition_seq2, "get item position 2", TRUE); memset(&rect, 0, sizeof(rect)); - SendMessage(header, HDM_GETITEMRECT, 0, (LPARAM)&rect); + SendMessageA(header, HDM_GETITEMRECT, 0, (LPARAM)&rect); /* some padding? */ expect(2, pt.x); /* offset by header height */ @@ -3785,9 +3803,9 @@ static void test_columnscreation(void) insert_item(hwnd, 0); /* headers columns aren't created automatically */ - header = (HWND)SendMessage(hwnd, LVM_GETHEADER, 0, 0); + header = (HWND)SendMessageA(hwnd, LVM_GETHEADER, 0, 0); ok(IsWindow(header), "Expected header handle\n"); - r = SendMessage(header, HDM_GETITEMCOUNT, 0, 0); + r = SendMessageA(header, HDM_GETITEMCOUNT, 0, 0); expect(0, r); DestroyWindow(hwnd); @@ -3811,10 +3829,10 @@ static void test_getitemrect(void) memset(&item, 0, sizeof(item)); item.mask = 0; item.iItem = 0; - r = SendMessage(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&item); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&item); expect(0, r); rect.left = LVIR_LABEL; - r = SendMessage(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); + r = SendMessageA(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); expect(TRUE, r); expect(0, rect.left); expect(0, rect.top); @@ -3830,12 +3848,12 @@ static void test_getitemrect(void) memset(&item, 0, sizeof(item)); item.iItem = 0; item.iSubItem = 0; - r = SendMessage(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&item); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&item); expect(0, r); rect.left = LVIR_BOUNDS; rect.right = rect.top = rect.bottom = -1; - r = SendMessage(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); + r = SendMessageA(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); expect(TRUE, r); /* zero width rectangle with no padding */ @@ -3847,17 +3865,17 @@ static void test_getitemrect(void) col.mask = LVCF_WIDTH; col.cx = 50; - r = SendMessage(hwnd, LVM_SETCOLUMN, 0, (LPARAM)&col); + r = SendMessageA(hwnd, LVM_SETCOLUMNA, 0, (LPARAM)&col); expect(TRUE, r); col.mask = LVCF_WIDTH; col.cx = 100; - r = SendMessage(hwnd, LVM_SETCOLUMN, 1, (LPARAM)&col); + r = SendMessageA(hwnd, LVM_SETCOLUMNA, 1, (LPARAM)&col); expect(TRUE, r); rect.left = LVIR_BOUNDS; rect.right = rect.top = rect.bottom = -1; - r = SendMessage(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); + r = SendMessageA(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); expect(TRUE, r); /* still no left padding */ @@ -3866,14 +3884,14 @@ static void test_getitemrect(void) rect.left = LVIR_SELECTBOUNDS; rect.right = rect.top = rect.bottom = -1; - r = SendMessage(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); + r = SendMessageA(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); expect(TRUE, r); /* padding */ expect(2, rect.left); rect.left = LVIR_LABEL; rect.right = rect.top = rect.bottom = -1; - r = SendMessage(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); + r = SendMessageA(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); expect(TRUE, r); /* padding, column width */ expect(2, rect.left); @@ -3882,7 +3900,7 @@ static void test_getitemrect(void) /* no icons attached */ rect.left = LVIR_ICON; rect.right = rect.top = rect.bottom = -1; - r = SendMessage(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); + r = SendMessageA(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); expect(TRUE, r); /* padding */ expect(2, rect.left); @@ -3890,17 +3908,17 @@ static void test_getitemrect(void) /* change order */ order[0] = 1; order[1] = 0; - r = SendMessage(hwnd, LVM_SETCOLUMNORDERARRAY, 2, (LPARAM)&order); + r = SendMessageA(hwnd, LVM_SETCOLUMNORDERARRAY, 2, (LPARAM)&order); expect(TRUE, r); pt.x = -1; - r = SendMessage(hwnd, LVM_GETITEMPOSITION, 0, (LPARAM)&pt); + r = SendMessageA(hwnd, LVM_GETITEMPOSITION, 0, (LPARAM)&pt); expect(TRUE, r); /* 1 indexed column width + padding */ expect(102, pt.x); /* rect is at zero too */ rect.left = LVIR_BOUNDS; rect.right = rect.top = rect.bottom = -1; - r = SendMessage(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); + r = SendMessageA(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); expect(TRUE, r); expect(0, rect.left); /* just width sum */ @@ -3908,14 +3926,14 @@ static void test_getitemrect(void) rect.left = LVIR_SELECTBOUNDS; rect.right = rect.top = rect.bottom = -1; - r = SendMessage(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); + r = SendMessageA(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); expect(TRUE, r); /* column width + padding */ expect(102, rect.left); /* back to initial order */ order[0] = 0; order[1] = 1; - r = SendMessage(hwnd, LVM_SETCOLUMNORDERARRAY, 2, (LPARAM)&order); + r = SendMessageA(hwnd, LVM_SETCOLUMNORDERARRAY, 2, (LPARAM)&order); expect(TRUE, r); /* state icons */ @@ -3930,7 +3948,7 @@ static void test_getitemrect(void) r = ImageList_Add(himl, hbm, 0); expect(1, r); - r = SendMessage(hwnd, LVM_SETIMAGELIST, LVSIL_STATE, (LPARAM)himl); + r = SendMessageA(hwnd, LVM_SETIMAGELIST, LVSIL_STATE, (LPARAM)himl); expect(0, r); item.mask = LVIF_STATE; @@ -3938,13 +3956,13 @@ static void test_getitemrect(void) item.stateMask = LVIS_STATEIMAGEMASK; item.iItem = 0; item.iSubItem = 0; - r = SendMessage(hwnd, LVM_SETITEM, 0, (LPARAM)&item); + r = SendMessageA(hwnd, LVM_SETITEMA, 0, (LPARAM)&item); expect(TRUE, r); /* icon bounds */ rect.left = LVIR_ICON; rect.right = rect.top = rect.bottom = -1; - r = SendMessage(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); + r = SendMessageA(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); expect(TRUE, r); /* padding + stateicon width */ expect(18, rect.left); @@ -3952,16 +3970,16 @@ static void test_getitemrect(void) /* label bounds */ rect.left = LVIR_LABEL; rect.right = rect.top = rect.bottom = -1; - r = SendMessage(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); + r = SendMessageA(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); expect(TRUE, r); /* padding + stateicon width -> column width */ expect(18, rect.left); expect(50, rect.right); - himl_ret = (HIMAGELIST)SendMessage(hwnd, LVM_SETIMAGELIST, LVSIL_STATE, 0); + himl_ret = (HIMAGELIST)SendMessageA(hwnd, LVM_SETIMAGELIST, LVSIL_STATE, 0); ok(himl_ret == himl, "got %p, expected %p\n", himl_ret, himl); - r = SendMessage(hwnd, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)himl); + r = SendMessageA(hwnd, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)himl); expect(0, r); item.mask = LVIF_STATE | LVIF_IMAGE; @@ -3970,13 +3988,13 @@ static void test_getitemrect(void) item.stateMask = ~0; item.iItem = 0; item.iSubItem = 0; - r = SendMessage(hwnd, LVM_SETITEM, 0, (LPARAM)&item); + r = SendMessageA(hwnd, LVM_SETITEMA, 0, (LPARAM)&item); expect(TRUE, r); /* icon bounds */ rect.left = LVIR_ICON; rect.right = rect.top = rect.bottom = -1; - r = SendMessage(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); + r = SendMessageA(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); expect(TRUE, r); /* padding, icon width */ expect(2, rect.left); @@ -3984,7 +4002,7 @@ static void test_getitemrect(void) /* label bounds */ rect.left = LVIR_LABEL; rect.right = rect.top = rect.bottom = -1; - r = SendMessage(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); + r = SendMessageA(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); expect(TRUE, r); /* padding + icon width -> column width */ expect(18, rect.left); @@ -3993,7 +4011,7 @@ static void test_getitemrect(void) /* select bounds */ rect.left = LVIR_SELECTBOUNDS; rect.right = rect.top = rect.bottom = -1; - r = SendMessage(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); + r = SendMessageA(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); expect(TRUE, r); /* padding, column width */ expect(2, rect.left); @@ -4004,13 +4022,13 @@ static void test_getitemrect(void) item.iIndent = 1; item.iItem = 0; item.iSubItem = 0; - r = SendMessage(hwnd, LVM_SETITEM, 0, (LPARAM)&item); + r = SendMessageA(hwnd, LVM_SETITEMA, 0, (LPARAM)&item); expect(TRUE, r); /* bounds */ rect.left = LVIR_BOUNDS; rect.right = rect.top = rect.bottom = -1; - r = SendMessage(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); + r = SendMessageA(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); expect(TRUE, r); /* padding + 1 icon width, column width */ expect(0, rect.left); @@ -4019,7 +4037,7 @@ static void test_getitemrect(void) /* select bounds */ rect.left = LVIR_SELECTBOUNDS; rect.right = rect.top = rect.bottom = -1; - r = SendMessage(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); + r = SendMessageA(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); expect(TRUE, r); /* padding + 1 icon width, column width */ expect(2 + 16, rect.left); @@ -4028,7 +4046,7 @@ static void test_getitemrect(void) /* label bounds */ rect.left = LVIR_LABEL; rect.right = rect.top = rect.bottom = -1; - r = SendMessage(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); + r = SendMessageA(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); expect(TRUE, r); /* padding + 2 icon widths, column width */ expect(2 + 16*2, rect.left); @@ -4037,7 +4055,7 @@ static void test_getitemrect(void) /* icon bounds */ rect.left = LVIR_ICON; rect.right = rect.top = rect.bottom = -1; - r = SendMessage(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); + r = SendMessageA(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect); expect(TRUE, r); /* padding + 1 icon width indentation, icon width */ expect(2 + 16, rect.left); @@ -4066,12 +4084,12 @@ static void test_editbox(void) item.pszText = testitemA; item.iItem = 0; item.iSubItem = 0; - r = SendMessage(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&item); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&item); expect(0, r); /* test notifications without edit created */ flush_sequences(sequences, NUM_MSG_SEQUENCES); - r = SendMessage(hwnd, WM_COMMAND, MAKEWPARAM(0, EN_SETFOCUS), (LPARAM)0xdeadbeef); + r = SendMessageA(hwnd, WM_COMMAND, MAKEWPARAM(0, EN_SETFOCUS), (LPARAM)0xdeadbeef); expect(0, r); ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "edit box WM_COMMAND (EN_SETFOCUS), no edit created", FALSE); @@ -4079,7 +4097,7 @@ static void test_editbox(void) hwndedit = CreateWindowA("Edit", "Test edit", WS_VISIBLE | WS_CHILD, 0, 0, 20, 10, hwnd, (HMENU)1, (HINSTANCE)GetWindowLongPtrA(hwnd, GWLP_HINSTANCE), 0); flush_sequences(sequences, NUM_MSG_SEQUENCES); - r = SendMessage(hwnd, WM_COMMAND, MAKEWPARAM(0, EN_SETFOCUS), (LPARAM)hwndedit); + r = SendMessageA(hwnd, WM_COMMAND, MAKEWPARAM(0, EN_SETFOCUS), (LPARAM)hwndedit); expect(0, r); ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "edit box WM_COMMAND (EN_SETFOCUS), no edit created #2", FALSE); @@ -4087,7 +4105,7 @@ static void test_editbox(void) /* setting focus is necessary */ SetFocus(hwnd); - hwndedit = (HWND)SendMessage(hwnd, LVM_EDITLABEL, 0, 0); + hwndedit = (HWND)SendMessageA(hwnd, LVM_EDITLABELA, 0, 0); ok(IsWindow(hwndedit), "Expected Edit window to be created\n"); /* test children Z-order after Edit box created */ @@ -4097,7 +4115,7 @@ static void test_editbox(void) ok(GetNextWindow(header, GW_HWNDNEXT) == hwndedit, "got %p\n", GetNextWindow(header, GW_HWNDNEXT)); /* modify initial string */ - r = SendMessage(hwndedit, WM_SETTEXT, 0, (LPARAM)testitem1A); + r = SendMessageA(hwndedit, WM_SETTEXT, 0, (LPARAM)testitem1A); expect(TRUE, r); /* edit window is resized and repositioned, @@ -4114,23 +4132,23 @@ static void test_editbox(void) item.cchTextMax = sizeof(buffer); item.iItem = 0; item.iSubItem = 0; - r = SendMessage(hwnd, LVM_GETITEMA, 0, (LPARAM)&item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM)&item); expect(TRUE, r); ok(strcmp(buffer, testitem1A) == 0, "Expected item text to change\n"); /* send LVM_EDITLABEL on already created edit */ SetFocus(hwnd); - hwndedit = (HWND)SendMessage(hwnd, LVM_EDITLABEL, 0, 0); + hwndedit = (HWND)SendMessageA(hwnd, LVM_EDITLABELA, 0, 0); ok(IsWindow(hwndedit), "Expected Edit window to be created\n"); /* focus will be set to edit */ ok(GetFocus() == hwndedit, "Expected Edit window to be focused\n"); - hwndedit2 = (HWND)SendMessage(hwnd, LVM_EDITLABEL, 0, 0); + hwndedit2 = (HWND)SendMessageA(hwnd, LVM_EDITLABELA, 0, 0); ok(IsWindow(hwndedit2), "Expected Edit window to be created\n"); /* creating label disabled when control isn't focused */ SetFocus(0); - hwndedit = (HWND)SendMessage(hwnd, LVM_EDITLABEL, 0, 0); + hwndedit = (HWND)SendMessageA(hwnd, LVM_EDITLABELA, 0, 0); todo_wine ok(hwndedit == NULL, "Expected Edit window not to be created\n"); /* check EN_KILLFOCUS handling */ @@ -4138,17 +4156,17 @@ static void test_editbox(void) item.pszText = testitemA; item.iItem = 0; item.iSubItem = 0; - r = SendMessage(hwnd, LVM_SETITEMTEXTA, 0, (LPARAM)&item); + r = SendMessageA(hwnd, LVM_SETITEMTEXTA, 0, (LPARAM)&item); expect(TRUE, r); SetFocus(hwnd); - hwndedit = (HWND)SendMessage(hwnd, LVM_EDITLABEL, 0, 0); + hwndedit = (HWND)SendMessageA(hwnd, LVM_EDITLABELA, 0, 0); ok(IsWindow(hwndedit), "Expected Edit window to be created\n"); /* modify edit and notify control that it lost focus */ - r = SendMessage(hwndedit, WM_SETTEXT, 0, (LPARAM)testitem1A); + r = SendMessageA(hwndedit, WM_SETTEXT, 0, (LPARAM)testitem1A); expect(TRUE, r); g_editbox_disp_info.item.pszText = NULL; - r = SendMessage(hwnd, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), (LPARAM)hwndedit); + r = SendMessageA(hwnd, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), (LPARAM)hwndedit); expect(0, r); ok(g_editbox_disp_info.item.pszText != NULL, "expected notification with not null text\n"); @@ -4157,20 +4175,20 @@ static void test_editbox(void) item.cchTextMax = sizeof(buffer); item.iItem = 0; item.iSubItem = 0; - r = SendMessage(hwnd, LVM_GETITEMTEXTA, 0, (LPARAM)&item); - expect(lstrlen(item.pszText), r); + r = SendMessageA(hwnd, LVM_GETITEMTEXTA, 0, (LPARAM)&item); + expect(lstrlenA(item.pszText), r); ok(strcmp(buffer, testitem1A) == 0, "Expected item text to change\n"); ok(!IsWindow(hwndedit), "Expected Edit window to be freed\n"); /* change item name to differ in casing only */ SetFocus(hwnd); - hwndedit = (HWND)SendMessage(hwnd, LVM_EDITLABEL, 0, 0); + hwndedit = (HWND)SendMessageA(hwnd, LVM_EDITLABELA, 0, 0); ok(IsWindow(hwndedit), "Expected Edit window to be created\n"); /* modify edit and notify control that it lost focus */ - r = SendMessage(hwndedit, WM_SETTEXT, 0, (LPARAM)testitem2A); + r = SendMessageA(hwndedit, WM_SETTEXT, 0, (LPARAM)testitem2A); expect(TRUE, r); g_editbox_disp_info.item.pszText = NULL; - r = SendMessage(hwnd, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), (LPARAM)hwndedit); + r = SendMessageA(hwnd, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), (LPARAM)hwndedit); expect(0, r); ok(g_editbox_disp_info.item.pszText != NULL, "got %p\n", g_editbox_disp_info.item.pszText); @@ -4179,24 +4197,24 @@ static void test_editbox(void) item.cchTextMax = sizeof(buffer); item.iItem = 0; item.iSubItem = 0; - r = SendMessage(hwnd, LVM_GETITEMTEXTA, 0, (LPARAM)&item); - expect(lstrlen(item.pszText), r); + r = SendMessageA(hwnd, LVM_GETITEMTEXTA, 0, (LPARAM)&item); + expect(lstrlenA(item.pszText), r); ok(strcmp(buffer, testitem2A) == 0, "got %s, expected %s\n", buffer, testitem2A); ok(!IsWindow(hwndedit), "Expected Edit window to be freed\n"); /* end edit without saving */ SetFocus(hwnd); - hwndedit = (HWND)SendMessage(hwnd, LVM_EDITLABEL, 0, 0); + hwndedit = (HWND)SendMessageA(hwnd, LVM_EDITLABELA, 0, 0); flush_sequences(sequences, NUM_MSG_SEQUENCES); - r = SendMessage(hwndedit, WM_KEYDOWN, VK_ESCAPE, 0); + r = SendMessageA(hwndedit, WM_KEYDOWN, VK_ESCAPE, 0); expect(0, r); ok_sequence(sequences, PARENT_SEQ_INDEX, edit_end_nochange, "edit box - end edit, no change, escape", TRUE); /* end edit with saving */ SetFocus(hwnd); - hwndedit = (HWND)SendMessage(hwnd, LVM_EDITLABEL, 0, 0); + hwndedit = (HWND)SendMessageA(hwnd, LVM_EDITLABELA, 0, 0); flush_sequences(sequences, NUM_MSG_SEQUENCES); - r = SendMessage(hwndedit, WM_KEYDOWN, VK_RETURN, 0); + r = SendMessageA(hwndedit, WM_KEYDOWN, VK_RETURN, 0); expect(0, r); ok_sequence(sequences, PARENT_SEQ_INDEX, edit_end_nochange, "edit box - end edit, no change, return", TRUE); @@ -4206,38 +4224,38 @@ static void test_editbox(void) item.cchTextMax = sizeof(buffer); item.iItem = 0; item.iSubItem = 0; - r = SendMessage(hwnd, LVM_GETITEMTEXTA, 0, (LPARAM)&item); - expect(lstrlen(item.pszText), r); + r = SendMessageA(hwnd, LVM_GETITEMTEXTA, 0, (LPARAM)&item); + expect(lstrlenA(item.pszText), r); ok(strcmp(buffer, testitem2A) == 0, "Expected item text to change\n"); /* LVM_EDITLABEL with -1 destroys current edit */ - hwndedit = (HWND)SendMessage(hwnd, LVM_GETEDITCONTROL, 0, 0); + hwndedit = (HWND)SendMessageA(hwnd, LVM_GETEDITCONTROL, 0, 0); ok(hwndedit == NULL, "Expected Edit window not to be created\n"); /* no edit present */ - hwndedit = (HWND)SendMessage(hwnd, LVM_EDITLABEL, -1, 0); + hwndedit = (HWND)SendMessageA(hwnd, LVM_EDITLABELA, -1, 0); ok(hwndedit == NULL, "Expected Edit window not to be created\n"); - hwndedit = (HWND)SendMessage(hwnd, LVM_EDITLABEL, 0, 0); + hwndedit = (HWND)SendMessageA(hwnd, LVM_EDITLABELA, 0, 0); ok(IsWindow(hwndedit), "Expected Edit window to be created\n"); /* edit present */ ok(GetFocus() == hwndedit, "Expected Edit to be focused\n"); - hwndedit2 = (HWND)SendMessage(hwnd, LVM_EDITLABEL, -1, 0); + hwndedit2 = (HWND)SendMessageA(hwnd, LVM_EDITLABELA, -1, 0); ok(hwndedit2 == NULL, "Expected Edit window not to be created\n"); ok(!IsWindow(hwndedit), "Expected Edit window to be destroyed\n"); ok(GetFocus() == hwnd, "Expected List to be focused\n"); /* check another negative value */ - hwndedit = (HWND)SendMessage(hwnd, LVM_EDITLABEL, 0, 0); + hwndedit = (HWND)SendMessageA(hwnd, LVM_EDITLABELA, 0, 0); ok(IsWindow(hwndedit), "Expected Edit window to be created\n"); ok(GetFocus() == hwndedit, "Expected Edit to be focused\n"); - hwndedit2 = (HWND)SendMessage(hwnd, LVM_EDITLABEL, -2, 0); + hwndedit2 = (HWND)SendMessageA(hwnd, LVM_EDITLABELA, -2, 0); ok(hwndedit2 == NULL, "Expected Edit window not to be created\n"); ok(!IsWindow(hwndedit), "Expected Edit window to be destroyed\n"); ok(GetFocus() == hwnd, "Expected List to be focused\n"); /* and value greater than max item index */ - hwndedit = (HWND)SendMessage(hwnd, LVM_EDITLABEL, 0, 0); + hwndedit = (HWND)SendMessageA(hwnd, LVM_EDITLABELA, 0, 0); ok(IsWindow(hwndedit), "Expected Edit window to be created\n"); ok(GetFocus() == hwndedit, "Expected Edit to be focused\n"); - r = SendMessage(hwnd, LVM_GETITEMCOUNT, 0, 0); - hwndedit2 = (HWND)SendMessage(hwnd, LVM_EDITLABEL, r, 0); + r = SendMessageA(hwnd, LVM_GETITEMCOUNT, 0, 0); + hwndedit2 = (HWND)SendMessageA(hwnd, LVM_EDITLABELA, r, 0); ok(hwndedit2 == NULL, "Expected Edit window not to be created\n"); ok(!IsWindow(hwndedit), "Expected Edit window to be destroyed\n"); ok(GetFocus() == hwnd, "Expected List to be focused\n"); @@ -4246,7 +4264,7 @@ static void test_editbox(void) SetFocus(hwnd); flush_sequences(sequences, NUM_MSG_SEQUENCES); blockEdit = FALSE; - hwndedit = (HWND)SendMessage(hwnd, LVM_EDITLABEL, 0, 0); + hwndedit = (HWND)SendMessageA(hwnd, LVM_EDITLABELA, 0, 0); ok(IsWindow(hwndedit), "Expected Edit window to be created\n"); /* testing only sizing messages */ ok_sequence(sequences, EDITBOX_SEQ_INDEX, editbox_create_pos, @@ -4254,10 +4272,10 @@ static void test_editbox(void) /* WM_COMMAND with EN_KILLFOCUS isn't forwarded to parent */ SetFocus(hwnd); - hwndedit = (HWND)SendMessage(hwnd, LVM_EDITLABEL, 0, 0); + hwndedit = (HWND)SendMessageA(hwnd, LVM_EDITLABELA, 0, 0); ok(IsWindow(hwndedit), "Expected Edit window to be created\n"); flush_sequences(sequences, NUM_MSG_SEQUENCES); - r = SendMessage(hwnd, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), (LPARAM)hwndedit); + r = SendMessageA(hwnd, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), (LPARAM)hwndedit); expect(0, r); ok_sequence(sequences, PARENT_SEQ_INDEX, edit_end_nochange, "edit box WM_COMMAND (EN_KILLFOCUS)", TRUE); @@ -4275,18 +4293,18 @@ static void test_notifyformat(void) /* CCM_GETUNICODEFORMAT == LVM_GETUNICODEFORMAT, CCM_SETUNICODEFORMAT == LVM_SETUNICODEFORMAT */ - r = SendMessage(hwnd, LVM_GETUNICODEFORMAT, 0, 0); + r = SendMessageA(hwnd, LVM_GETUNICODEFORMAT, 0, 0); expect(0, r); - SendMessage(hwnd, WM_NOTIFYFORMAT, 0, NF_QUERY); + SendMessageA(hwnd, WM_NOTIFYFORMAT, 0, NF_QUERY); /* set */ - r = SendMessage(hwnd, LVM_SETUNICODEFORMAT, 1, 0); + r = SendMessageA(hwnd, LVM_SETUNICODEFORMAT, 1, 0); expect(0, r); - r = SendMessage(hwnd, LVM_GETUNICODEFORMAT, 0, 0); + r = SendMessageA(hwnd, LVM_GETUNICODEFORMAT, 0, 0); if (r == 1) { - r = SendMessage(hwnd, LVM_SETUNICODEFORMAT, 0, 0); + r = SendMessageA(hwnd, LVM_SETUNICODEFORMAT, 0, 0); expect(1, r); - r = SendMessage(hwnd, LVM_GETUNICODEFORMAT, 0, 0); + r = SendMessageA(hwnd, LVM_GETUNICODEFORMAT, 0, 0); expect(0, r); } else @@ -4302,29 +4320,29 @@ static void test_notifyformat(void) notifyFormat = 0; hwnd = create_listview_control(LVS_REPORT); ok(hwnd != NULL, "failed to create a listview window\n"); - header = (HWND)SendMessage(hwnd, LVM_GETHEADER, 0, 0); + header = (HWND)SendMessageA(hwnd, LVM_GETHEADER, 0, 0); ok(IsWindow(header), "expected header to be created\n"); - r = SendMessage(hwnd, LVM_GETUNICODEFORMAT, 0, 0); + r = SendMessageA(hwnd, LVM_GETUNICODEFORMAT, 0, 0); expect(0, r); - r = SendMessage(header, HDM_GETUNICODEFORMAT, 0, 0); + r = SendMessageA(header, HDM_GETUNICODEFORMAT, 0, 0); ok( r == 1, "Expected 1, got %d\n", r ); - r = SendMessage(hwnd, WM_NOTIFYFORMAT, 0, NF_QUERY); + r = SendMessageA(hwnd, WM_NOTIFYFORMAT, 0, NF_QUERY); ok(r != 0, "Expected valid format\n"); notifyFormat = NFR_UNICODE; - r = SendMessage(hwnd, WM_NOTIFYFORMAT, 0, NF_REQUERY); + r = SendMessageA(hwnd, WM_NOTIFYFORMAT, 0, NF_REQUERY); expect(NFR_UNICODE, r); - r = SendMessage(hwnd, LVM_GETUNICODEFORMAT, 0, 0); + r = SendMessageA(hwnd, LVM_GETUNICODEFORMAT, 0, 0); expect(1, r); - r = SendMessage(header, HDM_GETUNICODEFORMAT, 0, 0); + r = SendMessageA(header, HDM_GETUNICODEFORMAT, 0, 0); ok( r == 1, "Expected 1, got %d\n", r ); notifyFormat = NFR_ANSI; - r = SendMessage(hwnd, WM_NOTIFYFORMAT, 0, NF_REQUERY); + r = SendMessageA(hwnd, WM_NOTIFYFORMAT, 0, NF_REQUERY); expect(NFR_ANSI, r); - r = SendMessage(hwnd, LVM_GETUNICODEFORMAT, 0, 0); + r = SendMessageA(hwnd, LVM_GETUNICODEFORMAT, 0, 0); expect(0, r); - r = SendMessage(header, HDM_GETUNICODEFORMAT, 0, 0); + r = SendMessageA(header, HDM_GETUNICODEFORMAT, 0, 0); ok( r == 1, "Expected 1, got %d\n", r ); DestroyWindow(hwnd); @@ -4336,55 +4354,55 @@ static void test_notifyformat(void) notifyFormat = -1; hwnd = create_listview_controlW(LVS_REPORT, hwndparentW); ok(hwnd != NULL, "failed to create a listview window\n"); - header = (HWND)SendMessage(hwnd, LVM_GETHEADER, 0, 0); + header = (HWND)SendMessageA(hwnd, LVM_GETHEADER, 0, 0); ok(IsWindow(header), "expected header to be created\n"); r = SendMessageW(hwnd, LVM_GETUNICODEFORMAT, 0, 0); expect(1, r); - r = SendMessage(header, HDM_GETUNICODEFORMAT, 0, 0); + r = SendMessageA(header, HDM_GETUNICODEFORMAT, 0, 0); expect(1, r); DestroyWindow(hwnd); /* receiving error code defaulting to ansi */ notifyFormat = 0; hwnd = create_listview_controlW(LVS_REPORT, hwndparentW); ok(hwnd != NULL, "failed to create a listview window\n"); - header = (HWND)SendMessage(hwnd, LVM_GETHEADER, 0, 0); + header = (HWND)SendMessageA(hwnd, LVM_GETHEADER, 0, 0); ok(IsWindow(header), "expected header to be created\n"); r = SendMessageW(hwnd, LVM_GETUNICODEFORMAT, 0, 0); expect(0, r); - r = SendMessage(header, HDM_GETUNICODEFORMAT, 0, 0); + r = SendMessageA(header, HDM_GETUNICODEFORMAT, 0, 0); expect(1, r); DestroyWindow(hwnd); /* receiving ansi code from unicode window, use it */ notifyFormat = NFR_ANSI; hwnd = create_listview_controlW(LVS_REPORT, hwndparentW); ok(hwnd != NULL, "failed to create a listview window\n"); - header = (HWND)SendMessage(hwnd, LVM_GETHEADER, 0, 0); + header = (HWND)SendMessageA(hwnd, LVM_GETHEADER, 0, 0); ok(IsWindow(header), "expected header to be created\n"); r = SendMessageW(hwnd, LVM_GETUNICODEFORMAT, 0, 0); expect(0, r); - r = SendMessage(header, HDM_GETUNICODEFORMAT, 0, 0); + r = SendMessageA(header, HDM_GETUNICODEFORMAT, 0, 0); expect(1, r); DestroyWindow(hwnd); /* unicode listview with ansi parent window */ notifyFormat = -1; hwnd = create_listview_controlW(LVS_REPORT, hwndparent); ok(hwnd != NULL, "failed to create a listview window\n"); - header = (HWND)SendMessage(hwnd, LVM_GETHEADER, 0, 0); + header = (HWND)SendMessageA(hwnd, LVM_GETHEADER, 0, 0); ok(IsWindow(header), "expected header to be created\n"); r = SendMessageW(hwnd, LVM_GETUNICODEFORMAT, 0, 0); expect(0, r); - r = SendMessage(header, HDM_GETUNICODEFORMAT, 0, 0); + r = SendMessageA(header, HDM_GETUNICODEFORMAT, 0, 0); expect(1, r); DestroyWindow(hwnd); /* unicode listview with ansi parent window, return error code */ notifyFormat = 0; hwnd = create_listview_controlW(LVS_REPORT, hwndparent); ok(hwnd != NULL, "failed to create a listview window\n"); - header = (HWND)SendMessage(hwnd, LVM_GETHEADER, 0, 0); + header = (HWND)SendMessageA(hwnd, LVM_GETHEADER, 0, 0); ok(IsWindow(header), "expected header to be created\n"); r = SendMessageW(hwnd, LVM_GETUNICODEFORMAT, 0, 0); expect(0, r); - r = SendMessage(header, HDM_GETUNICODEFORMAT, 0, 0); + r = SendMessageA(header, HDM_GETUNICODEFORMAT, 0, 0); expect(1, r); DestroyWindow(hwnd); @@ -4404,14 +4422,14 @@ static void test_indentation(void) item.mask = LVIF_INDENT; item.iItem = 0; item.iIndent = I_INDENTCALLBACK; - r = SendMessage(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&item); + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&item); expect(0, r); flush_sequences(sequences, NUM_MSG_SEQUENCES); item.iItem = 0; item.mask = LVIF_INDENT; - r = SendMessage(hwnd, LVM_GETITEM, 0, (LPARAM)&item); + r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM)&item); expect(TRUE, r); ok_sequence(sequences, PARENT_SEQ_INDEX, single_getdispinfo_parent_seq, @@ -4434,7 +4452,7 @@ static BOOL is_below_comctl_5(void) ok(hwnd != NULL, "failed to create a listview window\n"); insert_item(hwnd, 0); - ret = SendMessage(hwnd, LVM_SORTITEMSEX, 0, (LPARAM)&DummyCompareEx); + ret = SendMessageA(hwnd, LVM_SORTITEMSEX, 0, (LPARAM)&DummyCompareEx); DestroyWindow(hwnd); @@ -4451,37 +4469,37 @@ static void test_get_set_view(void) hwnd = create_listview_control(LVS_REPORT); ok(hwnd != NULL, "failed to create a listview window\n"); - ret = SendMessage(hwnd, LVM_GETVIEW, 0, 0); + ret = SendMessageA(hwnd, LVM_GETVIEW, 0, 0); expect(LV_VIEW_DETAILS, ret); - style = GetWindowLongPtr(hwnd, GWL_STYLE); + style = GetWindowLongPtrA(hwnd, GWL_STYLE); /* LVS_ICON == 0 */ - SetWindowLongPtr(hwnd, GWL_STYLE, style & ~LVS_REPORT); - ret = SendMessage(hwnd, LVM_GETVIEW, 0, 0); + SetWindowLongPtrA(hwnd, GWL_STYLE, style & ~LVS_REPORT); + ret = SendMessageA(hwnd, LVM_GETVIEW, 0, 0); expect(LV_VIEW_ICON, ret); - style = GetWindowLongPtr(hwnd, GWL_STYLE); - SetWindowLongPtr(hwnd, GWL_STYLE, style | LVS_SMALLICON); - ret = SendMessage(hwnd, LVM_GETVIEW, 0, 0); + style = GetWindowLongPtrA(hwnd, GWL_STYLE); + SetWindowLongPtrA(hwnd, GWL_STYLE, style | LVS_SMALLICON); + ret = SendMessageA(hwnd, LVM_GETVIEW, 0, 0); expect(LV_VIEW_SMALLICON, ret); - style = GetWindowLongPtr(hwnd, GWL_STYLE); - SetWindowLongPtr(hwnd, GWL_STYLE, (style & ~LVS_SMALLICON) | LVS_LIST); - ret = SendMessage(hwnd, LVM_GETVIEW, 0, 0); + style = GetWindowLongPtrA(hwnd, GWL_STYLE); + SetWindowLongPtrA(hwnd, GWL_STYLE, (style & ~LVS_SMALLICON) | LVS_LIST); + ret = SendMessageA(hwnd, LVM_GETVIEW, 0, 0); expect(LV_VIEW_LIST, ret); /* switching view doesn't touch window style */ - ret = SendMessage(hwnd, LVM_SETVIEW, LV_VIEW_DETAILS, 0); + ret = SendMessageA(hwnd, LVM_SETVIEW, LV_VIEW_DETAILS, 0); expect(1, ret); - style = GetWindowLongPtr(hwnd, GWL_STYLE); + style = GetWindowLongPtrA(hwnd, GWL_STYLE); ok(style & LVS_LIST, "Expected style to be preserved\n"); - ret = SendMessage(hwnd, LVM_SETVIEW, LV_VIEW_ICON, 0); + ret = SendMessageA(hwnd, LVM_SETVIEW, LV_VIEW_ICON, 0); expect(1, ret); - style = GetWindowLongPtr(hwnd, GWL_STYLE); + style = GetWindowLongPtrA(hwnd, GWL_STYLE); ok(style & LVS_LIST, "Expected style to be preserved\n"); - ret = SendMessage(hwnd, LVM_SETVIEW, LV_VIEW_SMALLICON, 0); + ret = SendMessageA(hwnd, LVM_SETVIEW, LV_VIEW_SMALLICON, 0); expect(1, ret); - style = GetWindowLongPtr(hwnd, GWL_STYLE); + style = GetWindowLongPtrA(hwnd, GWL_STYLE); ok(style & LVS_LIST, "Expected style to be preserved\n"); DestroyWindow(hwnd); @@ -4503,36 +4521,36 @@ static void test_canceleditlabel(void) /* try without edit created */ flush_sequences(sequences, NUM_MSG_SEQUENCES); - ret = SendMessage(hwnd, LVM_CANCELEDITLABEL, 0, 0); + ret = SendMessageA(hwnd, LVM_CANCELEDITLABEL, 0, 0); expect(TRUE, ret); ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "cancel edit label without edit", FALSE); /* cancel without data change */ SetFocus(hwnd); - hwndedit = (HWND)SendMessage(hwnd, LVM_EDITLABEL, 0, 0); + hwndedit = (HWND)SendMessageA(hwnd, LVM_EDITLABELA, 0, 0); ok(IsWindow(hwndedit), "Expected edit control to be created\n"); - ret = SendMessage(hwnd, LVM_CANCELEDITLABEL, 0, 0); + ret = SendMessageA(hwnd, LVM_CANCELEDITLABEL, 0, 0); expect(TRUE, ret); ok(!IsWindow(hwndedit), "Expected edit control to be destroyed\n"); /* cancel after data change */ memset(&itema, 0, sizeof(itema)); itema.pszText = test; - ret = SendMessage(hwnd, LVM_SETITEMTEXT, 0, (LPARAM)&itema); + ret = SendMessageA(hwnd, LVM_SETITEMTEXTA, 0, (LPARAM)&itema); expect(TRUE, ret); SetFocus(hwnd); - hwndedit = (HWND)SendMessage(hwnd, LVM_EDITLABEL, 0, 0); + hwndedit = (HWND)SendMessageA(hwnd, LVM_EDITLABELA, 0, 0); ok(IsWindow(hwndedit), "Expected edit control to be created\n"); - ret = SetWindowText(hwndedit, test1); + ret = SetWindowTextA(hwndedit, test1); expect(1, ret); - ret = SendMessage(hwnd, LVM_CANCELEDITLABEL, 0, 0); + ret = SendMessageA(hwnd, LVM_CANCELEDITLABEL, 0, 0); expect(TRUE, ret); ok(!IsWindow(hwndedit), "Expected edit control to be destroyed\n"); memset(&itema, 0, sizeof(itema)); itema.pszText = buff; itema.cchTextMax = sizeof(buff)/sizeof(CHAR); - ret = SendMessage(hwnd, LVM_GETITEMTEXT, 0, (LPARAM)&itema); + ret = SendMessageA(hwnd, LVM_GETITEMTEXTA, 0, (LPARAM)&itema); expect(5, ret); ok(strcmp(buff, test1) == 0, "Expected label text not to change\n"); @@ -4548,7 +4566,7 @@ static void test_mapidindex(void) hwnd = create_listview_control(LVS_OWNERDATA | LVS_REPORT); ok(hwnd != NULL, "failed to create a listview window\n"); insert_item(hwnd, 0); - ret = SendMessage(hwnd, LVM_MAPINDEXTOID, 0, 0); + ret = SendMessageA(hwnd, LVM_MAPINDEXTOID, 0, 0); expect(-1, ret); DestroyWindow(hwnd); @@ -4556,38 +4574,38 @@ static void test_mapidindex(void) ok(hwnd != NULL, "failed to create a listview window\n"); /* LVM_MAPINDEXTOID with invalid index */ - ret = SendMessage(hwnd, LVM_MAPINDEXTOID, 0, 0); + ret = SendMessageA(hwnd, LVM_MAPINDEXTOID, 0, 0); expect(-1, ret); insert_item(hwnd, 0); insert_item(hwnd, 1); - ret = SendMessage(hwnd, LVM_MAPINDEXTOID, -1, 0); + ret = SendMessageA(hwnd, LVM_MAPINDEXTOID, -1, 0); expect(-1, ret); - ret = SendMessage(hwnd, LVM_MAPINDEXTOID, 2, 0); + ret = SendMessageA(hwnd, LVM_MAPINDEXTOID, 2, 0); expect(-1, ret); - ret = SendMessage(hwnd, LVM_MAPINDEXTOID, 0, 0); + ret = SendMessageA(hwnd, LVM_MAPINDEXTOID, 0, 0); expect(0, ret); - ret = SendMessage(hwnd, LVM_MAPINDEXTOID, 1, 0); + ret = SendMessageA(hwnd, LVM_MAPINDEXTOID, 1, 0); expect(1, ret); /* remove 0 indexed item, id retained */ - SendMessage(hwnd, LVM_DELETEITEM, 0, 0); - ret = SendMessage(hwnd, LVM_MAPINDEXTOID, 0, 0); + SendMessageA(hwnd, LVM_DELETEITEM, 0, 0); + ret = SendMessageA(hwnd, LVM_MAPINDEXTOID, 0, 0); expect(1, ret); /* new id starts from previous value */ insert_item(hwnd, 1); - ret = SendMessage(hwnd, LVM_MAPINDEXTOID, 1, 0); + ret = SendMessageA(hwnd, LVM_MAPINDEXTOID, 1, 0); expect(2, ret); /* get index by id */ - ret = SendMessage(hwnd, LVM_MAPIDTOINDEX, -1, 0); + ret = SendMessageA(hwnd, LVM_MAPIDTOINDEX, -1, 0); expect(-1, ret); - ret = SendMessage(hwnd, LVM_MAPIDTOINDEX, 0, 0); + ret = SendMessageA(hwnd, LVM_MAPIDTOINDEX, 0, 0); expect(-1, ret); - ret = SendMessage(hwnd, LVM_MAPIDTOINDEX, 1, 0); + ret = SendMessageA(hwnd, LVM_MAPIDTOINDEX, 1, 0); expect(0, ret); - ret = SendMessage(hwnd, LVM_MAPIDTOINDEX, 2, 0); + ret = SendMessageA(hwnd, LVM_MAPIDTOINDEX, 2, 0); expect(1, ret); DestroyWindow(hwnd); @@ -4605,7 +4623,7 @@ static void test_getitemspacing(void) /* LVS_ICON */ hwnd = create_listview_control(LVS_ICON); - ret = SendMessage(hwnd, LVM_GETITEMSPACING, FALSE, 0); + ret = SendMessageA(hwnd, LVM_GETITEMSPACING, FALSE, 0); expect(cx, LOWORD(ret)); expect(cy, HIWORD(ret)); @@ -4614,45 +4632,45 @@ static void test_getitemspacing(void) ok(himl40 != NULL, "failed to create imagelist\n"); himl80 = ImageList_Create(80, 80, 0, 4, 4); ok(himl80 != NULL, "failed to create imagelist\n"); - ret = SendMessage(hwnd, LVM_SETIMAGELIST, LVSIL_NORMAL, (LPARAM)himl40); + ret = SendMessageA(hwnd, LVM_SETIMAGELIST, LVSIL_NORMAL, (LPARAM)himl40); expect(0, ret); - ret = SendMessage(hwnd, LVM_GETITEMSPACING, FALSE, 0); + ret = SendMessageA(hwnd, LVM_GETITEMSPACING, FALSE, 0); /* spacing + icon size returned */ expect(cx + 40, LOWORD(ret)); expect(cy + 40, HIWORD(ret)); /* try changing icon size */ - SendMessage(hwnd, LVM_SETIMAGELIST, LVSIL_NORMAL, (LPARAM)himl80); + SendMessageA(hwnd, LVM_SETIMAGELIST, LVSIL_NORMAL, (LPARAM)himl80); - ret = SendMessage(hwnd, LVM_GETITEMSPACING, FALSE, 0); + ret = SendMessageA(hwnd, LVM_GETITEMSPACING, FALSE, 0); /* spacing + icon size returned */ expect(cx + 80, LOWORD(ret)); expect(cy + 80, HIWORD(ret)); /* set own icon spacing */ - ret = SendMessage(hwnd, LVM_SETICONSPACING, 0, MAKELPARAM(100, 100)); + ret = SendMessageA(hwnd, LVM_SETICONSPACING, 0, MAKELPARAM(100, 100)); expect(cx + 80, LOWORD(ret)); expect(cy + 80, HIWORD(ret)); - ret = SendMessage(hwnd, LVM_GETITEMSPACING, FALSE, 0); + ret = SendMessageA(hwnd, LVM_GETITEMSPACING, FALSE, 0); /* set size returned */ expect(100, LOWORD(ret)); expect(100, HIWORD(ret)); /* now change image list - icon spacing should be unaffected */ - SendMessage(hwnd, LVM_SETIMAGELIST, LVSIL_NORMAL, (LPARAM)himl40); + SendMessageA(hwnd, LVM_SETIMAGELIST, LVSIL_NORMAL, (LPARAM)himl40); - ret = SendMessage(hwnd, LVM_GETITEMSPACING, FALSE, 0); + ret = SendMessageA(hwnd, LVM_GETITEMSPACING, FALSE, 0); /* set size returned */ expect(100, LOWORD(ret)); expect(100, HIWORD(ret)); /* spacing = 0 - keep previous value */ - ret = SendMessage(hwnd, LVM_SETICONSPACING, 0, MAKELPARAM(0, -1)); + ret = SendMessageA(hwnd, LVM_SETICONSPACING, 0, MAKELPARAM(0, -1)); expect(100, LOWORD(ret)); expect(100, HIWORD(ret)); - ret = SendMessage(hwnd, LVM_GETITEMSPACING, FALSE, 0); + ret = SendMessageA(hwnd, LVM_GETITEMSPACING, FALSE, 0); expect(100, LOWORD(ret)); expect(0xFFFF, HIWORD(ret)); @@ -4660,56 +4678,56 @@ static void test_getitemspacing(void) if (sizeof(void*) == 8) { /* NOTE: -1 is not treated the same as (DWORD)-1 by 64bit listview */ - ret = SendMessage(hwnd, LVM_SETICONSPACING, 0, (DWORD)-1); + ret = SendMessageA(hwnd, LVM_SETICONSPACING, 0, (DWORD)-1); expect(100, LOWORD(ret)); expect(0xFFFF, HIWORD(ret)); - ret = SendMessage(hwnd, LVM_SETICONSPACING, 0, -1); + ret = SendMessageA(hwnd, LVM_SETICONSPACING, 0, -1); expect(0xFFFF, LOWORD(ret)); expect(0xFFFF, HIWORD(ret)); } else { - ret = SendMessage(hwnd, LVM_SETICONSPACING, 0, -1); + ret = SendMessageA(hwnd, LVM_SETICONSPACING, 0, -1); expect(100, LOWORD(ret)); expect(0xFFFF, HIWORD(ret)); } - ret = SendMessage(hwnd, LVM_GETITEMSPACING, FALSE, 0); + ret = SendMessageA(hwnd, LVM_GETITEMSPACING, FALSE, 0); /* spacing + icon size returned */ expect(cx + 40, LOWORD(ret)); expect(cy + 40, HIWORD(ret)); - SendMessage(hwnd, LVM_SETIMAGELIST, LVSIL_NORMAL, 0); + SendMessageA(hwnd, LVM_SETIMAGELIST, LVSIL_NORMAL, 0); ImageList_Destroy(himl80); DestroyWindow(hwnd); /* LVS_SMALLICON */ hwnd = create_listview_control(LVS_SMALLICON); - ret = SendMessage(hwnd, LVM_GETITEMSPACING, FALSE, 0); + ret = SendMessageA(hwnd, LVM_GETITEMSPACING, FALSE, 0); expect(cx, LOWORD(ret)); expect(cy, HIWORD(ret)); /* spacing does not depend on selected view type */ - ret = SendMessage(hwnd, LVM_SETIMAGELIST, LVSIL_NORMAL, (LPARAM)himl40); + ret = SendMessageA(hwnd, LVM_SETIMAGELIST, LVSIL_NORMAL, (LPARAM)himl40); expect(0, ret); - ret = SendMessage(hwnd, LVM_GETITEMSPACING, FALSE, 0); + ret = SendMessageA(hwnd, LVM_GETITEMSPACING, FALSE, 0); /* spacing + icon size returned */ expect(cx + 40, LOWORD(ret)); expect(cy + 40, HIWORD(ret)); - SendMessage(hwnd, LVM_SETIMAGELIST, LVSIL_NORMAL, 0); + SendMessageA(hwnd, LVM_SETIMAGELIST, LVSIL_NORMAL, 0); ImageList_Destroy(himl40); DestroyWindow(hwnd); /* LVS_REPORT */ hwnd = create_listview_control(LVS_REPORT); - ret = SendMessage(hwnd, LVM_GETITEMSPACING, FALSE, 0); + ret = SendMessageA(hwnd, LVM_GETITEMSPACING, FALSE, 0); expect(cx, LOWORD(ret)); expect(cy, HIWORD(ret)); DestroyWindow(hwnd); /* LVS_LIST */ hwnd = create_listview_control(LVS_LIST); - ret = SendMessage(hwnd, LVM_GETITEMSPACING, FALSE, 0); + ret = SendMessageA(hwnd, LVM_GETITEMSPACING, FALSE, 0); expect(cx, LOWORD(ret)); expect(cy, HIWORD(ret)); @@ -4727,26 +4745,26 @@ static void test_getcolumnwidth(void) /* default column width */ hwnd = create_listview_control(LVS_ICON); - ret = SendMessage(hwnd, LVM_GETCOLUMNWIDTH, 0, 0); + ret = SendMessageA(hwnd, LVM_GETCOLUMNWIDTH, 0, 0); expect(0, ret); - style = GetWindowLong(hwnd, GWL_STYLE); - SetWindowLong(hwnd, GWL_STYLE, style | LVS_LIST); - ret = SendMessage(hwnd, LVM_GETCOLUMNWIDTH, 0, 0); + style = GetWindowLongA(hwnd, GWL_STYLE); + SetWindowLongA(hwnd, GWL_STYLE, style | LVS_LIST); + ret = SendMessageA(hwnd, LVM_GETCOLUMNWIDTH, 0, 0); todo_wine expect(8, ret); - style = GetWindowLong(hwnd, GWL_STYLE) & ~LVS_LIST; - SetWindowLong(hwnd, GWL_STYLE, style | LVS_REPORT); + style = GetWindowLongA(hwnd, GWL_STYLE) & ~LVS_LIST; + SetWindowLongA(hwnd, GWL_STYLE, style | LVS_REPORT); col.mask = 0; - ret = SendMessage(hwnd, LVM_INSERTCOLUMNA, 0, (LPARAM)&col); + ret = SendMessageA(hwnd, LVM_INSERTCOLUMNA, 0, (LPARAM)&col); expect(0, ret); - ret = SendMessage(hwnd, LVM_GETCOLUMNWIDTH, 0, 0); + ret = SendMessageA(hwnd, LVM_GETCOLUMNWIDTH, 0, 0); expect(10, ret); DestroyWindow(hwnd); /* default column width with item added */ hwnd = create_listview_control(LVS_LIST); memset(&itema, 0, sizeof(itema)); - SendMessage(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&itema); - ret = SendMessage(hwnd, LVM_GETCOLUMNWIDTH, 0, 0); + SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&itema); + ret = SendMessageA(hwnd, LVM_GETCOLUMNWIDTH, 0, 0); hdc = GetDC(hwnd); todo_wine expect(((GetDeviceCaps(hdc, LOGPIXELSX) + 15) / 16) * 16, ret); ReleaseDC(hwnd, hdc); @@ -4765,26 +4783,26 @@ static void test_scrollnotify(void) insert_item(hwnd, 0); /* make it scrollable - resize */ - ret = SendMessage(hwnd, LVM_SETCOLUMNWIDTH, 0, MAKELPARAM(100, 0)); + ret = SendMessageA(hwnd, LVM_SETCOLUMNWIDTH, 0, MAKELPARAM(100, 0)); expect(TRUE, ret); - ret = SendMessage(hwnd, LVM_SETCOLUMNWIDTH, 1, MAKELPARAM(100, 0)); + ret = SendMessageA(hwnd, LVM_SETCOLUMNWIDTH, 1, MAKELPARAM(100, 0)); expect(TRUE, ret); /* try with dummy call */ flush_sequences(sequences, NUM_MSG_SEQUENCES); - ret = SendMessage(hwnd, LVM_SCROLL, 0, 0); + ret = SendMessageA(hwnd, LVM_SCROLL, 0, 0); expect(TRUE, ret); ok_sequence(sequences, PARENT_SEQ_INDEX, scroll_parent_seq, "scroll notify 1", TRUE); flush_sequences(sequences, NUM_MSG_SEQUENCES); - ret = SendMessage(hwnd, LVM_SCROLL, 1, 0); + ret = SendMessageA(hwnd, LVM_SCROLL, 1, 0); expect(TRUE, ret); ok_sequence(sequences, PARENT_SEQ_INDEX, scroll_parent_seq, "scroll notify 2", TRUE); flush_sequences(sequences, NUM_MSG_SEQUENCES); - ret = SendMessage(hwnd, LVM_SCROLL, 1, 1); + ret = SendMessageA(hwnd, LVM_SCROLL, 1, 1); expect(TRUE, ret); ok_sequence(sequences, PARENT_SEQ_INDEX, scroll_parent_seq, "scroll notify 3", TRUE); @@ -4800,13 +4818,13 @@ static void test_LVS_EX_TRANSPARENTBKGND(void) hwnd = create_listview_control(LVS_REPORT); - ret = SendMessage(hwnd, LVM_SETBKCOLOR, 0, RGB(0, 0, 0)); + ret = SendMessageA(hwnd, LVM_SETBKCOLOR, 0, RGB(0, 0, 0)); expect(TRUE, ret); - SendMessage(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_TRANSPARENTBKGND, + SendMessageA(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_TRANSPARENTBKGND, LVS_EX_TRANSPARENTBKGND); - ret = SendMessage(hwnd, LVM_GETBKCOLOR, 0, 0); + ret = SendMessageA(hwnd, LVM_GETBKCOLOR, 0, 0); if (ret != CLR_NONE) { win_skip("LVS_EX_TRANSPARENTBKGND unsupported\n"); @@ -4815,13 +4833,13 @@ static void test_LVS_EX_TRANSPARENTBKGND(void) } /* try to set some back color and check this style bit */ - ret = SendMessage(hwnd, LVM_SETBKCOLOR, 0, RGB(0, 0, 0)); + ret = SendMessageA(hwnd, LVM_SETBKCOLOR, 0, RGB(0, 0, 0)); expect(TRUE, ret); - ret = SendMessage(hwnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0); + ret = SendMessageA(hwnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0); ok(!(ret & LVS_EX_TRANSPARENTBKGND), "Expected LVS_EX_TRANSPARENTBKGND to unset\n"); /* now test what this style actually does */ - SendMessage(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_TRANSPARENTBKGND, + SendMessageA(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_TRANSPARENTBKGND, LVS_EX_TRANSPARENTBKGND); hdc = GetWindowDC(hwndparent); @@ -4852,17 +4870,17 @@ static void test_approximate_viewrect(void) ok(hbmp != NULL, "failed to create bitmap\n"); ret = ImageList_Add(himl, hbmp, 0); expect(0, ret); - ret = SendMessage(hwnd, LVM_SETIMAGELIST, 0, (LPARAM)himl); + ret = SendMessageA(hwnd, LVM_SETIMAGELIST, 0, (LPARAM)himl); expect(0, ret); itema.mask = LVIF_IMAGE; itema.iImage = 0; itema.iItem = 0; itema.iSubItem = 0; - ret = SendMessage(hwnd, LVM_INSERTITEM, 0, (LPARAM)&itema); + ret = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&itema); expect(0, ret); - ret = SendMessage(hwnd, LVM_SETICONSPACING, 0, MAKELPARAM(75, 75)); + ret = SendMessageA(hwnd, LVM_SETICONSPACING, 0, MAKELPARAM(75, 75)); if (ret == 0) { /* version 4.0 */ @@ -4870,39 +4888,39 @@ static void test_approximate_viewrect(void) return; } - ret = SendMessage(hwnd, LVM_APPROXIMATEVIEWRECT, 11, MAKELPARAM(100,100)); + ret = SendMessageA(hwnd, LVM_APPROXIMATEVIEWRECT, 11, MAKELPARAM(100,100)); expect(MAKELONG(77,827), ret); - ret = SendMessage(hwnd, LVM_SETICONSPACING, 0, MAKELPARAM(50, 50)); + ret = SendMessageA(hwnd, LVM_SETICONSPACING, 0, MAKELPARAM(50, 50)); ok(ret != 0, "got 0\n"); - ret = SendMessage(hwnd, LVM_APPROXIMATEVIEWRECT, 11, MAKELPARAM(100,100)); + ret = SendMessageA(hwnd, LVM_APPROXIMATEVIEWRECT, 11, MAKELPARAM(100,100)); expect(MAKELONG(102,302), ret); - ret = SendMessage(hwnd, LVM_APPROXIMATEVIEWRECT, -1, MAKELPARAM(100,100)); + ret = SendMessageA(hwnd, LVM_APPROXIMATEVIEWRECT, -1, MAKELPARAM(100,100)); expect(MAKELONG(52,52), ret); itema.pszText = test; - ret = SendMessage(hwnd, LVM_SETITEMTEXT, 0, (LPARAM)&itema); + ret = SendMessageA(hwnd, LVM_SETITEMTEXTA, 0, (LPARAM)&itema); expect(TRUE, ret); - ret = SendMessage(hwnd, LVM_APPROXIMATEVIEWRECT, -1, MAKELPARAM(100,100)); + ret = SendMessageA(hwnd, LVM_APPROXIMATEVIEWRECT, -1, MAKELPARAM(100,100)); expect(MAKELONG(52,52), ret); - ret = SendMessage(hwnd, LVM_APPROXIMATEVIEWRECT, 0, MAKELPARAM(100,100)); + ret = SendMessageA(hwnd, LVM_APPROXIMATEVIEWRECT, 0, MAKELPARAM(100,100)); expect(MAKELONG(52,2), ret); - ret = SendMessage(hwnd, LVM_APPROXIMATEVIEWRECT, 1, MAKELPARAM(100,100)); + ret = SendMessageA(hwnd, LVM_APPROXIMATEVIEWRECT, 1, MAKELPARAM(100,100)); expect(MAKELONG(52,52), ret); - ret = SendMessage(hwnd, LVM_APPROXIMATEVIEWRECT, 2, MAKELPARAM(100,100)); + ret = SendMessageA(hwnd, LVM_APPROXIMATEVIEWRECT, 2, MAKELPARAM(100,100)); expect(MAKELONG(102,52), ret); - ret = SendMessage(hwnd, LVM_APPROXIMATEVIEWRECT, 3, MAKELPARAM(100,100)); + ret = SendMessageA(hwnd, LVM_APPROXIMATEVIEWRECT, 3, MAKELPARAM(100,100)); expect(MAKELONG(102,102), ret); - ret = SendMessage(hwnd, LVM_APPROXIMATEVIEWRECT, 4, MAKELPARAM(100,100)); + ret = SendMessageA(hwnd, LVM_APPROXIMATEVIEWRECT, 4, MAKELPARAM(100,100)); expect(MAKELONG(102,102), ret); - ret = SendMessage(hwnd, LVM_APPROXIMATEVIEWRECT, 5, MAKELPARAM(100,100)); + ret = SendMessageA(hwnd, LVM_APPROXIMATEVIEWRECT, 5, MAKELPARAM(100,100)); expect(MAKELONG(102,152), ret); - ret = SendMessage(hwnd, LVM_APPROXIMATEVIEWRECT, 6, MAKELPARAM(100,100)); + ret = SendMessageA(hwnd, LVM_APPROXIMATEVIEWRECT, 6, MAKELPARAM(100,100)); expect(MAKELONG(102,152), ret); - ret = SendMessage(hwnd, LVM_APPROXIMATEVIEWRECT, 7, MAKELPARAM(160,100)); + ret = SendMessageA(hwnd, LVM_APPROXIMATEVIEWRECT, 7, MAKELPARAM(160,100)); expect(MAKELONG(152,152), ret); DestroyWindow(hwnd); @@ -4924,26 +4942,26 @@ static void test_finditem(void) strcpy(f, "foo"); fi.flags = LVFI_STRING; fi.psz = f; - r = SendMessage(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi); + r = SendMessageA(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi); expect(0, r); /* partial string search, inserted text was "foo" */ strcpy(f, "fo"); fi.flags = LVFI_STRING | LVFI_PARTIAL; fi.psz = f; - r = SendMessage(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi); + r = SendMessageA(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi); expect(0, r); /* partial string search, part after start char */ strcpy(f, "oo"); fi.flags = LVFI_STRING | LVFI_PARTIAL; fi.psz = f; - r = SendMessage(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi); + r = SendMessageA(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi); expect(-1, r); /* try with LVFI_SUBSTRING */ strcpy(f, "fo"); fi.flags = LVFI_SUBSTRING; fi.psz = f; - r = SendMessage(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi); + r = SendMessageA(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi); if (r == -1) { win_skip("LVFI_SUBSTRING not supported\n"); @@ -4954,18 +4972,18 @@ static void test_finditem(void) strcpy(f, "f"); fi.flags = LVFI_SUBSTRING; fi.psz = f; - r = SendMessage(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi); + r = SendMessageA(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi); expect(0, r); strcpy(f, "o"); fi.flags = LVFI_SUBSTRING; fi.psz = f; - r = SendMessage(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi); + r = SendMessageA(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi); expect(-1, r); strcpy(f, "f"); fi.flags = LVFI_SUBSTRING | LVFI_STRING; fi.psz = f; - r = SendMessage(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi); + r = SendMessageA(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi); expect(0, r); DestroyWindow(hwnd); @@ -4978,10 +4996,10 @@ static void test_LVS_EX_HEADERINALLVIEWS(void) hwnd = create_listview_control(LVS_ICON); - SendMessage(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_HEADERINALLVIEWS, + SendMessageA(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_HEADERINALLVIEWS, LVS_EX_HEADERINALLVIEWS); - header = (HWND)SendMessage(hwnd, LVM_GETHEADER, 0, 0); + header = (HWND)SendMessageA(hwnd, LVM_GETHEADER, 0, 0); if (!IsWindow(header)) { win_skip("LVS_EX_HEADERINALLVIEWS unsupported\n"); @@ -5000,8 +5018,8 @@ static void test_LVS_EX_HEADERINALLVIEWS(void) ok(!(style & HDS_HIDDEN), "Expected HDS_HIDDEN to be unset\n"); /* try to remove style */ - SendMessage(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_HEADERINALLVIEWS, 0); - header = (HWND)SendMessage(hwnd, LVM_GETHEADER, 0, 0); + SendMessageA(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_HEADERINALLVIEWS, 0); + header = (HWND)SendMessageA(hwnd, LVM_GETHEADER, 0, 0); ok(IsWindow(header), "Expected header to be created\n"); style = GetWindowLongA(header, GWL_STYLE); ok(!(style & HDS_HIDDEN), "HDS_HIDDEN not expected\n"); @@ -5010,23 +5028,23 @@ static void test_LVS_EX_HEADERINALLVIEWS(void) /* check other styles */ hwnd = create_listview_control(LVS_LIST); - SendMessage(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_HEADERINALLVIEWS, + SendMessageA(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_HEADERINALLVIEWS, LVS_EX_HEADERINALLVIEWS); - header = (HWND)SendMessage(hwnd, LVM_GETHEADER, 0, 0); + header = (HWND)SendMessageA(hwnd, LVM_GETHEADER, 0, 0); ok(IsWindow(header), "Expected header to be created\n"); DestroyWindow(hwnd); hwnd = create_listview_control(LVS_SMALLICON); - SendMessage(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_HEADERINALLVIEWS, + SendMessageA(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_HEADERINALLVIEWS, LVS_EX_HEADERINALLVIEWS); - header = (HWND)SendMessage(hwnd, LVM_GETHEADER, 0, 0); + header = (HWND)SendMessageA(hwnd, LVM_GETHEADER, 0, 0); ok(IsWindow(header), "Expected header to be created\n"); DestroyWindow(hwnd); hwnd = create_listview_control(LVS_REPORT); - SendMessage(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_HEADERINALLVIEWS, + SendMessageA(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_HEADERINALLVIEWS, LVS_EX_HEADERINALLVIEWS); - header = (HWND)SendMessage(hwnd, LVM_GETHEADER, 0, 0); + header = (HWND)SendMessageA(hwnd, LVM_GETHEADER, 0, 0); ok(IsWindow(header), "Expected header to be created\n"); DestroyWindow(hwnd); } @@ -5040,19 +5058,19 @@ static void test_hover(void) /* test WM_MOUSEHOVER forwarding */ flush_sequences(sequences, NUM_MSG_SEQUENCES); - r = SendMessage(hwnd, WM_MOUSEHOVER, 0, 0); + r = SendMessageA(hwnd, WM_MOUSEHOVER, 0, 0); expect(0, r); ok_sequence(sequences, PARENT_SEQ_INDEX, hover_parent, "NM_HOVER allow test", TRUE); g_block_hover = TRUE; flush_sequences(sequences, NUM_MSG_SEQUENCES); - r = SendMessage(hwnd, WM_MOUSEHOVER, 0, 0); + r = SendMessageA(hwnd, WM_MOUSEHOVER, 0, 0); expect(0, r); ok_sequence(sequences, PARENT_SEQ_INDEX, hover_parent, "NM_HOVER block test", TRUE); g_block_hover = FALSE; - r = SendMessage(hwnd, LVM_SETHOVERTIME, 0, 500); + r = SendMessageA(hwnd, LVM_SETHOVERTIME, 0, 500); expect(HOVER_DEFAULT, r); - r = SendMessage(hwnd, LVM_GETHOVERTIME, 0, 0); + r = SendMessageA(hwnd, LVM_GETHOVERTIME, 0, 0); expect(500, r); DestroyWindow(hwnd); @@ -5061,6 +5079,7 @@ static void test_hover(void) static void test_destroynotify(void) { HWND hwnd; + BOOL ret; hwnd = create_listview_control(LVS_REPORT); ok(hwnd != NULL, "failed to create listview window\n"); @@ -5068,6 +5087,23 @@ static void test_destroynotify(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); DestroyWindow(hwnd); ok_sequence(sequences, COMBINED_SEQ_INDEX, listview_destroy, "check destroy order", FALSE); + + /* same for ownerdata list */ + hwnd = create_listview_control(LVS_REPORT|LVS_OWNERDATA); + ok(hwnd != NULL, "failed to create listview window\n"); + + flush_sequences(sequences, NUM_MSG_SEQUENCES); + DestroyWindow(hwnd); + ok_sequence(sequences, COMBINED_SEQ_INDEX, listview_ownerdata_destroy, "check destroy order, ownerdata", FALSE); + + hwnd = create_listview_control(LVS_REPORT|LVS_OWNERDATA); + ok(hwnd != NULL, "failed to create listview window\n"); + + flush_sequences(sequences, NUM_MSG_SEQUENCES); + ret = SendMessageA(hwnd, LVM_DELETEALLITEMS, 0, 0); + ok(ret == TRUE, "got %d\n", ret); + ok_sequence(sequences, COMBINED_SEQ_INDEX, listview_ownerdata_deleteall, "deleteall ownerdata", FALSE); + DestroyWindow(hwnd); } static void test_header_notification(void) @@ -5075,7 +5111,7 @@ static void test_header_notification(void) static char textA[] = "newtext"; HWND list, header; HDITEMA item; - NMHEADER nmh; + NMHEADERA nmh; LVCOLUMNA col; DWORD ret; BOOL r; @@ -5086,7 +5122,7 @@ static void test_header_notification(void) memset(&col, 0, sizeof(col)); col.mask = LVCF_WIDTH; col.cx = 100; - ret = SendMessage(list, LVM_INSERTCOLUMNA, 0, (LPARAM)&col); + ret = SendMessageA(list, LVM_INSERTCOLUMNA, 0, (LPARAM)&col); expect(0, ret); /* check list parent notification after header item changed, @@ -5096,7 +5132,7 @@ static void test_header_notification(void) col.mask = LVCF_TEXT; col.pszText = textA; - r = SendMessage(list, LVM_SETCOLUMNA, 0, (LPARAM)&col); + r = SendMessageA(list, LVM_SETCOLUMNA, 0, (LPARAM)&col); expect(TRUE, r); ok_sequence(sequences, LISTVIEW_SEQ_INDEX, listview_header_changed_seq, @@ -5106,24 +5142,24 @@ static void test_header_notification(void) header = subclass_header(list); - ret = SendMessage(header, HDM_GETITEMCOUNT, 0, 0); + ret = SendMessageA(header, HDM_GETITEMCOUNT, 0, 0); expect(1, ret); memset(&item, 0, sizeof(item)); item.mask = HDI_WIDTH; - ret = SendMessage(header, HDM_GETITEMA, 0, (LPARAM)&item); + ret = SendMessageA(header, HDM_GETITEMA, 0, (LPARAM)&item); expect(1, ret); expect(100, item.cxy); nmh.hdr.hwndFrom = header; - nmh.hdr.idFrom = GetWindowLongPtr(header, GWLP_ID); + nmh.hdr.idFrom = GetWindowLongPtrA(header, GWLP_ID); nmh.hdr.code = HDN_ITEMCHANGEDA; nmh.iItem = 0; nmh.iButton = 0; item.mask = HDI_WIDTH; item.cxy = 50; nmh.pitem = &item; - ret = SendMessage(list, WM_NOTIFY, 0, (LPARAM)&nmh); + ret = SendMessageA(list, WM_NOTIFY, 0, (LPARAM)&nmh); expect(0, ret); DestroyWindow(list); @@ -5150,10 +5186,10 @@ static void test_header_notification2(void) col.mask = LVCF_WIDTH | LVCF_TEXT; col.cx = 100; col.pszText = textA; - ret = SendMessage(list, LVM_INSERTCOLUMNA, 0, (LPARAM)&col); + ret = SendMessageA(list, LVM_INSERTCOLUMNA, 0, (LPARAM)&col); expect(0, ret); - header = ListView_GetHeader(list); + header = (HWND)SendMessageA(list, LVM_GETHEADER, 0, 0); ok(header != 0, "No header\n"); memset(&itemW, 0, sizeof(itemW)); itemW.mask = HDI_WIDTH | HDI_ORDER | HDI_TEXT; @@ -5163,7 +5199,7 @@ static void test_header_notification2(void) expect(1, ret); nmhdr.hdr.hwndFrom = header; - nmhdr.hdr.idFrom = GetWindowLongPtr(header, GWLP_ID); + nmhdr.hdr.idFrom = GetWindowLongPtrW(header, GWLP_ID); nmhdr.iItem = 0; nmhdr.iButton = 0; nmhdr.pitem = &itemW; @@ -5335,10 +5371,10 @@ static void test_LVM_SETITEMTEXT(void) insert_item(hwnd, 0); /* null item pointer */ - ret = SendMessage(hwnd, LVM_SETITEMTEXTA, 0, 0); + ret = SendMessageA(hwnd, LVM_SETITEMTEXTA, 0, 0); expect(FALSE, ret); - ret = SendMessage(hwnd, LVM_SETITEMTEXTW, 0, 0); + ret = SendMessageA(hwnd, LVM_SETITEMTEXTW, 0, 0); expect(FALSE, ret); /* index out of bounds */ @@ -5375,7 +5411,7 @@ static void test_imagelists(void) header = subclass_header(hwnd); ok(header != NULL, "Expected header\n"); - ret = SendMessage(header, HDM_GETIMAGELIST, 0, 0); + ret = SendMessageA(header, HDM_GETIMAGELIST, 0, 0); ok(ret == 0, "Expected no imagelist, got %p\n", (HIMAGELIST)ret); flush_sequences(sequences, NUM_MSG_SEQUENCES); @@ -5392,7 +5428,7 @@ static void test_imagelists(void) ok_sequence(sequences, LISTVIEW_SEQ_INDEX, listview_set_imagelist, "set state image list", TRUE); - ret = SendMessage(header, HDM_GETIMAGELIST, 0, 0); + ret = SendMessageA(header, HDM_GETIMAGELIST, 0, 0); ok(ret == 0, "Expected no imagelist, got %p\n", (HIMAGELIST)ret); flush_sequences(sequences, NUM_MSG_SEQUENCES); @@ -5402,7 +5438,7 @@ static void test_imagelists(void) ok_sequence(sequences, LISTVIEW_SEQ_INDEX, listview_header_set_imagelist, "set small image list", FALSE); - ret = SendMessage(header, HDM_GETIMAGELIST, 0, 0); + ret = SendMessageA(header, HDM_GETIMAGELIST, 0, 0); ok((HIMAGELIST)ret == himl3, "Expected imagelist %p, got %p\n", himl3, (HIMAGELIST)ret); DestroyWindow(hwnd); @@ -5429,15 +5465,15 @@ static void test_imagelists(void) ok_sequence(sequences, LISTVIEW_SEQ_INDEX, listview_set_imagelist, "set small image list", FALSE); - header = ListView_GetHeader(hwnd); + header = (HWND)SendMessageA(hwnd, LVM_GETHEADER, 0, 0); ok(header == NULL, "Expected no header, got %p\n", header); - SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) | LVS_REPORT); + SetWindowLongPtrA(hwnd, GWL_STYLE, GetWindowLongPtrA(hwnd, GWL_STYLE) | LVS_REPORT); - header = (HWND)SendMessage(hwnd, LVM_GETHEADER, 0, 0); + header = (HWND)SendMessageA(hwnd, LVM_GETHEADER, 0, 0); ok(header != NULL, "Expected header, got NULL\n"); - ret = SendMessage(header, HDM_GETIMAGELIST, 0, 0); + ret = SendMessageA(header, HDM_GETIMAGELIST, 0, 0); ok((HIMAGELIST)ret == himl3, "Expected imagelist %p, got %p\n", himl3, (HIMAGELIST)ret); DestroyWindow(hwnd); @@ -5557,7 +5593,6 @@ START_TEST(listview) ULONG_PTR ctx_cookie; HANDLE hCtx; - HWND hwnd; hComctl32 = GetModuleHandleA("comctl32.dll"); pInitCommonControlsEx = (void*)GetProcAddress(hComctl32, "InitCommonControlsEx"); @@ -5626,21 +5661,6 @@ START_TEST(listview) return; } - /* this is a XP SP3 failure workaround */ - hwnd = CreateWindowExA(0, WC_LISTVIEW, "foo", - WS_CHILD | WS_BORDER | WS_VISIBLE | LVS_REPORT, - 0, 0, 100, 100, - hwndparent, NULL, GetModuleHandleA(NULL), NULL); - if (!IsWindow(hwnd)) - { - win_skip("FIXME: failed to create ListView window.\n"); - unload_v6_module(ctx_cookie, hCtx); - DestroyWindow(hwndparent); - return; - } - else - DestroyWindow(hwnd); - /* comctl32 version 6 tests start here */ test_get_set_view(); test_canceleditlabel(); diff --git a/rostests/winetests/comctl32/misc.c b/rostests/winetests/comctl32/misc.c index c1f4e1ceab8..068e57cdcca 100644 --- a/rostests/winetests/comctl32/misc.c +++ b/rostests/winetests/comctl32/misc.c @@ -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); diff --git a/rostests/winetests/comctl32/monthcal.c b/rostests/winetests/comctl32/monthcal.c index 54a982e0517..466612bc9c6 100644 --- a/rostests/winetests/comctl32/monthcal.c +++ b/rostests/winetests/comctl32/monthcal.c @@ -272,7 +272,7 @@ static void test_monthcal(void) /* test range just after creation */ memset(&st, 0xcc, sizeof(st)); - limits = SendMessage(hwnd, MCM_GETRANGE, 0, (LPARAM)st); + limits = SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st); ok(limits == 0 || broken(limits == GDTR_MIN), /* comctl32 <= 4.70 */ "No limits should be set (%d)\n", limits); @@ -310,21 +310,21 @@ static void test_monthcal(void) GetSystemTime(&st[0]); st[1] = st[0]; - SendMessage(hwnd, MCM_GETTODAY, 0, (LPARAM)&today); + SendMessageA(hwnd, MCM_GETTODAY, 0, (LPARAM)&today); /* Invalid date/time */ st[0].wYear = 2000; /* Time should not matter */ st[1].wHour = st[1].wMinute = st[1].wSecond = 70; st[1].wMilliseconds = 1200; - ok(SendMessage(hwnd, MCM_SETRANGE, GDTR_MAX, (LPARAM)st), "Failed to set MAX limit\n"); + ok(SendMessageA(hwnd, MCM_SETRANGE, GDTR_MAX, (LPARAM)st), "Failed to set MAX limit\n"); /* invalid timestamp is written back with today data and msecs untouched */ expect(today.wHour, st[1].wHour); expect(today.wMinute, st[1].wMinute); expect(today.wSecond, st[1].wSecond); expect(1200, st[1].wMilliseconds); - ok(SendMessage(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == GDTR_MAX, "No limits should be set\n"); + ok(SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == GDTR_MAX, "No limits should be set\n"); ok(st1[0].wYear != 2000, "Lower limit changed\n"); /* invalid timestamp should be replaced with today data, except msecs */ expect(today.wHour, st1[1].wHour); @@ -337,7 +337,7 @@ static void test_monthcal(void) st[1] = st[0]; /* Time should not matter */ st[1].wMilliseconds = 1200; - ok(SendMessage(hwnd, MCM_SETRANGE, GDTR_MAX, (LPARAM)st), "Failed to set MAX limit\n"); + ok(SendMessageA(hwnd, MCM_SETRANGE, GDTR_MAX, (LPARAM)st), "Failed to set MAX limit\n"); /* invalid milliseconds field doesn't lead to invalid timestamp */ expect(st[0].wHour, st[1].wHour); expect(st[0].wMinute, st[1].wMinute); @@ -347,11 +347,13 @@ static void test_monthcal(void) GetSystemTime(&st[0]); st[1].wMonth = 0; - ok(!SendMessage(hwnd, MCM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st), "Should have failed to set limits\n"); - ok(SendMessage(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == GDTR_MAX, "No limits should be set\n"); + ok(!SendMessageA(hwnd, MCM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st), + "Should have failed to set limits\n"); + ok(SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == GDTR_MAX, "No limits should be set\n"); ok(st1[0].wYear != 2000, "Lower limit changed\n"); - ok(!SendMessage(hwnd, MCM_SETRANGE, GDTR_MAX, (LPARAM)st), "Should have failed to set MAX limit\n"); - ok(SendMessage(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == GDTR_MAX, "No limits should be set\n"); + ok(!SendMessageA(hwnd, MCM_SETRANGE, GDTR_MAX, (LPARAM)st), + "Should have failed to set MAX limit\n"); + ok(SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == GDTR_MAX, "No limits should be set\n"); ok(st1[0].wYear != 2000, "Lower limit changed\n"); GetSystemTime(&st[0]); @@ -359,44 +361,52 @@ static void test_monthcal(void) st[0].wMonth = 5; st[1] = st[0]; - month_range = SendMessage(hwnd, MCM_GETMONTHRANGE, GMR_VISIBLE, (LPARAM)st1); + month_range = SendMessageA(hwnd, MCM_GETMONTHRANGE, GMR_VISIBLE, (LPARAM)st1); st[1].wMonth--; - ok(SendMessage(hwnd, MCM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st), "Failed to set both min and max limits\n"); - res = SendMessage(hwnd, MCM_GETMONTHRANGE, GMR_VISIBLE, (LPARAM)st1); + ok(SendMessageA(hwnd, MCM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st), + "Failed to set both min and max limits\n"); + res = SendMessageA(hwnd, MCM_GETMONTHRANGE, GMR_VISIBLE, (LPARAM)st1); ok(res == month_range, "Invalid month range (%d)\n", res); - ok(SendMessage(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == (GDTR_MIN|GDTR_MAX), "Limits should be set\n"); + ok(SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == (GDTR_MIN|GDTR_MAX), + "Limits should be set\n"); st[1].wMonth += 2; - ok(SendMessage(hwnd, MCM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st), "Failed to set both min and max limits\n"); - res = SendMessage(hwnd, MCM_GETMONTHRANGE, GMR_VISIBLE, (LPARAM)st1); + ok(SendMessageA(hwnd, MCM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st), + "Failed to set both min and max limits\n"); + res = SendMessageA(hwnd, MCM_GETMONTHRANGE, GMR_VISIBLE, (LPARAM)st1); ok(res == month_range, "Invalid month range (%d)\n", res); st[1].wYear --; - ok(SendMessage(hwnd, MCM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st), "Failed to set both min and max limits\n"); + ok(SendMessageA(hwnd, MCM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st), + "Failed to set both min and max limits\n"); st[1].wYear += 1; - ok(SendMessage(hwnd, MCM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st), "Failed to set both min and max limits\n"); + ok(SendMessageA(hwnd, MCM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st), + "Failed to set both min and max limits\n"); st[1].wMonth -= 3; - ok(SendMessage(hwnd, MCM_SETRANGE, GDTR_MAX, (LPARAM)st), "Failed to set max limit\n"); - ok(SendMessage(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == GDTR_MAX, "Only MAX limit should be set\n"); + ok(SendMessageA(hwnd, MCM_SETRANGE, GDTR_MAX, (LPARAM)st), "Failed to set max limit\n"); + ok(SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == GDTR_MAX, + "Only MAX limit should be set\n"); st[1].wMonth += 4; - ok(SendMessage(hwnd, MCM_SETRANGE, GDTR_MAX, (LPARAM)st), "Failed to set max limit\n"); + ok(SendMessageA(hwnd, MCM_SETRANGE, GDTR_MAX, (LPARAM)st), "Failed to set max limit\n"); st[1].wYear -= 3; - ok(SendMessage(hwnd, MCM_SETRANGE, GDTR_MAX, (LPARAM)st), "Failed to set max limit\n"); + ok(SendMessageA(hwnd, MCM_SETRANGE, GDTR_MAX, (LPARAM)st), "Failed to set max limit\n"); st[1].wYear += 4; - ok(SendMessage(hwnd, MCM_SETRANGE, GDTR_MAX, (LPARAM)st), "Failed to set max limit\n"); - ok(SendMessage(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == GDTR_MAX, "Only MAX limit should be set\n"); + ok(SendMessageA(hwnd, MCM_SETRANGE, GDTR_MAX, (LPARAM)st), "Failed to set max limit\n"); + ok(SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == GDTR_MAX, + "Only MAX limit should be set\n"); /* set both limits, then set max < min */ GetSystemTime(&st[0]); st[0].wDay = 25; st[1] = st[0]; st[1].wYear++; - ok(SendMessage(hwnd, MCM_SETRANGE, GDTR_MIN|GDTR_MAX, (LPARAM)st), "Failed to set limits\n"); - ok(SendMessage(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == (GDTR_MIN|GDTR_MAX), "Min limit expected\n"); + ok(SendMessageA(hwnd, MCM_SETRANGE, GDTR_MIN|GDTR_MAX, (LPARAM)st), "Failed to set limits\n"); + ok(SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == (GDTR_MIN|GDTR_MAX), + "Min limit expected\n"); st[1].wYear -= 2; - ok(SendMessage(hwnd, MCM_SETRANGE, GDTR_MAX, (LPARAM)st), "Failed to set limits\n"); - ok(SendMessage(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == GDTR_MAX, "Max limit expected\n"); + ok(SendMessageA(hwnd, MCM_SETRANGE, GDTR_MAX, (LPARAM)st), "Failed to set limits\n"); + ok(SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == GDTR_MAX, "Max limit expected\n"); expect(0, st1[0].wYear); expect(0, st1[0].wMonth); @@ -418,11 +428,12 @@ static void test_monthcal(void) st[1] = st[0]; st[1].wYear++; - ok(SendMessage(hwnd, MCM_SETRANGE, GDTR_MIN|GDTR_MAX, (LPARAM)st), "Failed to set limits\n"); - ok(SendMessage(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == (GDTR_MIN|GDTR_MAX), "Min limit expected\n"); + ok(SendMessageA(hwnd, MCM_SETRANGE, GDTR_MIN|GDTR_MAX, (LPARAM)st), "Failed to set limits\n"); + ok(SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == (GDTR_MIN|GDTR_MAX), + "Min limit expected\n"); st[0].wYear++; /* start == end now */ - ok(SendMessage(hwnd, MCM_SETRANGE, GDTR_MIN, (LPARAM)st), "Failed to set limits\n"); - ok(SendMessage(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == GDTR_MIN, "Min limit expected\n"); + ok(SendMessageA(hwnd, MCM_SETRANGE, GDTR_MIN, (LPARAM)st), "Failed to set limits\n"); + ok(SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == GDTR_MIN, "Min limit expected\n"); expect(st[0].wYear, st1[0].wYear); expect(st[0].wMonth, st1[0].wMonth); @@ -492,13 +503,12 @@ static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LP { NMSELCHANGE *nmchg = (NMSELCHANGE*)lParam; SYSTEMTIME st[2]; - BOOL is_multisel = GetWindowLongPtr(nmchg->nmhdr.hwndFrom, GWL_STYLE) & - MCS_MULTISELECT; + BOOL is_multisel = GetWindowLongPtrA(nmchg->nmhdr.hwndFrom, GWL_STYLE) & MCS_MULTISELECT; - if(GetWindowLongPtr(nmchg->nmhdr.hwndFrom, GWLP_ID) != SEL_NOTIFY_TEST_ID) + if(GetWindowLongPtrA(nmchg->nmhdr.hwndFrom, GWLP_ID) != SEL_NOTIFY_TEST_ID) break; - SendMessage(nmchg->nmhdr.hwndFrom, is_multisel ? MCM_GETSELRANGE : - MCM_GETCURSEL, 0, (LPARAM)st); + SendMessageA(nmchg->nmhdr.hwndFrom, is_multisel ? MCM_GETSELRANGE : MCM_GETCURSEL, + 0, (LPARAM)st); expect(st[0].wYear, nmchg->stSelStart.wYear); expect(st[0].wMonth, nmchg->stSelStart.wMonth); @@ -542,7 +552,7 @@ static BOOL register_parent_wnd_class(void) cls.cbWndExtra = 0; cls.hInstance = GetModuleHandleA(NULL); cls.hIcon = 0; - cls.hCursor = LoadCursorA(0, IDC_ARROW); + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); cls.hbrBackground = GetStockObject(WHITE_BRUSH); cls.lpszMenuName = NULL; cls.lpszClassName = "Month-Cal test parent class"; @@ -561,14 +571,10 @@ static HWND create_parent_window(void) if (!register_parent_wnd_class()) return NULL; - hwnd = CreateWindowEx(0, "Month-Cal test parent class", - "Month-Cal test parent window", - WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | - WS_MAXIMIZEBOX | WS_VISIBLE, - 0, 0, 500, 500, - GetDesktopWindow(), NULL, GetModuleHandleA(NULL), NULL); - - assert(hwnd); + hwnd = CreateWindowExA(0, "Month-Cal test parent class", "Month-Cal test parent window", + WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_VISIBLE, + 0, 0, 500, 500, GetDesktopWindow(), NULL, GetModuleHandleA(NULL), NULL); + ok(hwnd != NULL, "failed to create parent wnd\n"); /* check for message sequences */ ok_sequence(sequences, PARENT_SEQ_INDEX, create_parent_window_seq, "create parent window", FALSE); @@ -611,20 +617,16 @@ static HWND create_monthcal_control(DWORD style) WNDPROC oldproc; HWND hwnd; - hwnd = CreateWindowEx(0, - MONTHCAL_CLASS, - "", - WS_CHILD | WS_BORDER | WS_VISIBLE | style, - 0, 0, 300, 400, - parent_wnd, NULL, GetModuleHandleA(NULL), NULL); - + hwnd = CreateWindowExA(0, MONTHCAL_CLASSA, "", WS_CHILD | WS_BORDER | WS_VISIBLE | style, + 0, 0, 300, 400, parent_wnd, NULL, GetModuleHandleA(NULL), NULL); + ok(hwnd != NULL, "failed to create monthcal wnd\n"); if (!hwnd) return NULL; oldproc = (WNDPROC)SetWindowLongPtrA(hwnd, GWLP_WNDPROC, (LONG_PTR)monthcal_subclass_proc); SetWindowLongPtrA(hwnd, GWLP_USERDATA, (LONG_PTR)oldproc); - SendMessage(hwnd, WM_SETFONT, (WPARAM)GetStockObject(SYSTEM_FONT), 0); + SendMessageA(hwnd, WM_SETFONT, (WPARAM)GetStockObject(SYSTEM_FONT), 0); return hwnd; } @@ -640,69 +642,69 @@ static void test_color(void) hwnd = create_monthcal_control(0); /* invalid color index */ - color = SendMessage(hwnd, MCM_GETCOLOR, MCSC_TRAILINGTEXT + 1, 0); + color = SendMessageA(hwnd, MCM_GETCOLOR, MCSC_TRAILINGTEXT + 1, 0); expect(~0u, color); - prev = SendMessage(hwnd, MCM_SETCOLOR, MCSC_TRAILINGTEXT + 1, RGB(255,255,255)); + prev = SendMessageA(hwnd, MCM_SETCOLOR, MCSC_TRAILINGTEXT + 1, RGB(255,255,255)); expect(~0u, prev); - color = SendMessage(hwnd, MCM_GETCOLOR, MCSC_BACKGROUND, 0); - prev = SendMessage(hwnd, MCM_SETCOLOR, MCSC_BACKGROUND, RGB(0,0,0)); + color = SendMessageA(hwnd, MCM_GETCOLOR, MCSC_BACKGROUND, 0); + prev = SendMessageA(hwnd, MCM_SETCOLOR, MCSC_BACKGROUND, RGB(0,0,0)); expect(color, prev); - color = SendMessage(hwnd, MCM_GETCOLOR, MCSC_BACKGROUND, 0); + color = SendMessageA(hwnd, MCM_GETCOLOR, MCSC_BACKGROUND, 0); expect(RGB(0,0,0), color); - prev = SendMessage(hwnd, MCM_SETCOLOR, MCSC_BACKGROUND, RGB(255,255,255)); + prev = SendMessageA(hwnd, MCM_SETCOLOR, MCSC_BACKGROUND, RGB(255,255,255)); expect(color, prev); - color = SendMessage(hwnd, MCM_GETCOLOR, MCSC_BACKGROUND, 0); + color = SendMessageA(hwnd, MCM_GETCOLOR, MCSC_BACKGROUND, 0); expect(RGB(255,255,255), color); - color = SendMessage(hwnd, MCM_GETCOLOR, MCSC_MONTHBK, 0); - prev = SendMessage(hwnd, MCM_SETCOLOR, MCSC_MONTHBK, RGB(0,0,0)); + color = SendMessageA(hwnd, MCM_GETCOLOR, MCSC_MONTHBK, 0); + prev = SendMessageA(hwnd, MCM_SETCOLOR, MCSC_MONTHBK, RGB(0,0,0)); expect(color, prev); - color = SendMessage(hwnd, MCM_GETCOLOR, MCSC_MONTHBK, 0); + color = SendMessageA(hwnd, MCM_GETCOLOR, MCSC_MONTHBK, 0); expect(RGB(0,0,0), color); - prev = SendMessage(hwnd, MCM_SETCOLOR, MCSC_MONTHBK, RGB(255,255,255)); + prev = SendMessageA(hwnd, MCM_SETCOLOR, MCSC_MONTHBK, RGB(255,255,255)); expect(color, prev); - color = SendMessage(hwnd, MCM_GETCOLOR, MCSC_MONTHBK, 0); + color = SendMessageA(hwnd, MCM_GETCOLOR, MCSC_MONTHBK, 0); expect(RGB(255,255,255), color); - color = SendMessage(hwnd, MCM_GETCOLOR, MCSC_TEXT, 0); - prev = SendMessage(hwnd, MCM_SETCOLOR, MCSC_TEXT, RGB(0,0,0)); + color = SendMessageA(hwnd, MCM_GETCOLOR, MCSC_TEXT, 0); + prev = SendMessageA(hwnd, MCM_SETCOLOR, MCSC_TEXT, RGB(0,0,0)); expect(color, prev); - color = SendMessage(hwnd, MCM_GETCOLOR, MCSC_TEXT, 0); + color = SendMessageA(hwnd, MCM_GETCOLOR, MCSC_TEXT, 0); expect(RGB(0,0,0), color); - prev = SendMessage(hwnd, MCM_SETCOLOR, MCSC_TEXT, RGB(255,255,255)); + prev = SendMessageA(hwnd, MCM_SETCOLOR, MCSC_TEXT, RGB(255,255,255)); expect(color, prev); - color = SendMessage(hwnd, MCM_GETCOLOR, MCSC_TEXT, 0); + color = SendMessageA(hwnd, MCM_GETCOLOR, MCSC_TEXT, 0); expect(RGB(255,255,255), color); - color = SendMessage(hwnd, MCM_GETCOLOR, MCSC_TITLEBK, 0); - prev = SendMessage(hwnd, MCM_SETCOLOR, MCSC_TITLEBK, RGB(0,0,0)); + color = SendMessageA(hwnd, MCM_GETCOLOR, MCSC_TITLEBK, 0); + prev = SendMessageA(hwnd, MCM_SETCOLOR, MCSC_TITLEBK, RGB(0,0,0)); expect(color, prev); - color = SendMessage(hwnd, MCM_GETCOLOR, MCSC_TITLEBK, 0); + color = SendMessageA(hwnd, MCM_GETCOLOR, MCSC_TITLEBK, 0); expect(RGB(0,0,0), color); - prev = SendMessage(hwnd, MCM_SETCOLOR, MCSC_TITLEBK, RGB(255,255,255)); + prev = SendMessageA(hwnd, MCM_SETCOLOR, MCSC_TITLEBK, RGB(255,255,255)); expect(color, prev); - color = SendMessage(hwnd, MCM_GETCOLOR, MCSC_TITLEBK, 0); + color = SendMessageA(hwnd, MCM_GETCOLOR, MCSC_TITLEBK, 0); expect(RGB(255,255,255), color); - color = SendMessage(hwnd, MCM_GETCOLOR, MCSC_TITLETEXT, 0); - prev = SendMessage(hwnd, MCM_SETCOLOR, MCSC_TITLETEXT, RGB(0,0,0)); + color = SendMessageA(hwnd, MCM_GETCOLOR, MCSC_TITLETEXT, 0); + prev = SendMessageA(hwnd, MCM_SETCOLOR, MCSC_TITLETEXT, RGB(0,0,0)); expect(color, prev); - color = SendMessage(hwnd, MCM_GETCOLOR, MCSC_TITLETEXT, 0); + color = SendMessageA(hwnd, MCM_GETCOLOR, MCSC_TITLETEXT, 0); expect(RGB(0,0,0), color); - prev = SendMessage(hwnd, MCM_SETCOLOR, MCSC_TITLETEXT, RGB(255,255,255)); + prev = SendMessageA(hwnd, MCM_SETCOLOR, MCSC_TITLETEXT, RGB(255,255,255)); expect(color, prev); - color = SendMessage(hwnd, MCM_GETCOLOR, MCSC_TITLETEXT, 0); + color = SendMessageA(hwnd, MCM_GETCOLOR, MCSC_TITLETEXT, 0); expect(RGB(255,255,255), color); - color = SendMessage(hwnd, MCM_GETCOLOR, MCSC_TRAILINGTEXT, 0); - prev = SendMessage(hwnd, MCM_SETCOLOR, MCSC_TRAILINGTEXT, RGB(0,0,0)); + color = SendMessageA(hwnd, MCM_GETCOLOR, MCSC_TRAILINGTEXT, 0); + prev = SendMessageA(hwnd, MCM_SETCOLOR, MCSC_TRAILINGTEXT, RGB(0,0,0)); expect(color, prev); - color = SendMessage(hwnd, MCM_GETCOLOR, MCSC_TRAILINGTEXT, 0); + color = SendMessageA(hwnd, MCM_GETCOLOR, MCSC_TRAILINGTEXT, 0); expect(RGB(0,0,0), color); - prev = SendMessage(hwnd, MCM_SETCOLOR, MCSC_TRAILINGTEXT, RGB(255,255,255)); + prev = SendMessageA(hwnd, MCM_SETCOLOR, MCSC_TRAILINGTEXT, RGB(255,255,255)); expect(color, prev); - color = SendMessage(hwnd, MCM_GETCOLOR, MCSC_TRAILINGTEXT, 0); + color = SendMessageA(hwnd, MCM_GETCOLOR, MCSC_TRAILINGTEXT, 0); expect(RGB(255,255,255), color); DestroyWindow(hwnd); @@ -731,12 +733,12 @@ static void test_currdate(void) st_new = st_test = st_original; /* Should not validate the time */ - res = SendMessage(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_test); + res = SendMessageA(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_test); expect(1,res); /* Overflow matters, check for wDay */ st_test.wDay += 4; - res = SendMessage(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_test); + res = SendMessageA(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_test); expect(0,res); /* correct wDay before checking for wMonth */ @@ -745,7 +747,7 @@ static void test_currdate(void) /* Overflow matters, check for wMonth */ st_test.wMonth += 4; - res = SendMessage(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_test); + res = SendMessageA(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_test); expect(0,res); /* checking if gets the information right, modify st_new */ @@ -756,7 +758,7 @@ static void test_currdate(void) st_new.wMinute += 4; st_new.wSecond += 4; - res = SendMessage(hwnd, MCM_GETCURSEL, 0, (LPARAM)&st_new); + res = SendMessageA(hwnd, MCM_GETCURSEL, 0, (LPARAM)&st_new); expect(1, res); /* st_new change to st_origin, above settings with overflow */ @@ -775,7 +777,7 @@ static void test_currdate(void) "Expected %d, got %d\n", st_original.wSecond, st_new.wSecond); /* lparam cannot be NULL */ - res = SendMessage(hwnd, MCM_GETCURSEL, 0, 0); + res = SendMessageA(hwnd, MCM_GETCURSEL, 0, 0); expect(0, res); ok_sequence(sequences, MONTHCAL_SEQ_INDEX, monthcal_curr_date_seq, "monthcal currDate", TRUE); @@ -785,10 +787,10 @@ static void test_currdate(void) st_new.wYear = 9999; st_new.wMonth = 12; st_new.wDay = 31; - res = SendMessage(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_new); + res = SendMessageA(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_new); expect(1, res); memset(&st_test, 0, sizeof(st_test)); - res = SendMessage(hwnd, MCM_GETCURSEL, 0, (LPARAM)&st_test); + res = SendMessageA(hwnd, MCM_GETCURSEL, 0, (LPARAM)&st_test); expect(1, res); expect(st_new.wYear, st_test.wYear); expect(st_new.wMonth, st_test.wMonth); @@ -801,14 +803,14 @@ static void test_currdate(void) st_new.wYear = 10000; st_new.wMonth = 1; st_new.wDay = 1; - res = SendMessage(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_new); + res = SendMessageA(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_new); ok(0 == res || broken(1 == res), /* comctl32 <= 4.72 */ "Expected 0, got %d\n", res); if (0 == res) { memset(&st_test, 0, sizeof(st_test)); - res = SendMessage(hwnd, MCM_GETCURSEL, 0, (LPARAM)&st_test); + res = SendMessageA(hwnd, MCM_GETCURSEL, 0, (LPARAM)&st_test); expect(1, res); expect(st_original.wYear, st_test.wYear); expect(st_original.wMonth, st_test.wMonth); @@ -823,16 +825,16 @@ static void test_currdate(void) st_new.wYear = 2009; st_new.wDay = 5; st_new.wMonth = 10; - res = SendMessage(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_new); + res = SendMessageA(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_new); expect(1, res); memset(&st_test, 0, sizeof(st_test)); st_test.wYear = 2009; st_test.wDay = 6; st_test.wMonth = 10; - res = SendMessage(hwnd, MCM_SETRANGE, GDTR_MIN, (LPARAM)&st_test); + res = SendMessageA(hwnd, MCM_SETRANGE, GDTR_MIN, (LPARAM)&st_test); expect(1, res); /* set to current again */ - res = SendMessage(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_new); + res = SendMessageA(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_new); expect(1, res); /* set with invalid day of week */ @@ -841,11 +843,11 @@ static void test_currdate(void) st_test.wDay = 7; st_test.wMonth = 10; st_test.wDayOfWeek = 100; - res = SendMessage(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_test); + res = SendMessageA(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_test); expect(1, res); memset(&st_test, 0, sizeof(st_test)); - res = SendMessage(hwnd, MCM_GETCURSEL, 0, (LPARAM)&st_test); + res = SendMessageA(hwnd, MCM_GETCURSEL, 0, (LPARAM)&st_test); expect(1, res); expect(2009, st_test.wYear); expect(7, st_test.wDay); @@ -881,16 +883,16 @@ static void test_firstDay(void) /* check for locale first day */ if(GetLocaleInfoA(lcid, LOCALE_IFIRSTDAYOFWEEK, b, 128)){ fday = atoi(b); - res = SendMessage(hwnd, MCM_GETFIRSTDAYOFWEEK, 0, 0); + res = SendMessageA(hwnd, MCM_GETFIRSTDAYOFWEEK, 0, 0); expect(fday, res); prev = fday; /* checking for the values that actually will be stored as */ /* current first day when we set a new value */ for (i = -5; i < 12; i++){ - res = SendMessage(hwnd, MCM_SETFIRSTDAYOFWEEK, 0, i); + res = SendMessageA(hwnd, MCM_SETFIRSTDAYOFWEEK, 0, i); expect(prev, res); - res = SendMessage(hwnd, MCM_GETFIRSTDAYOFWEEK, 0, 0); + res = SendMessageA(hwnd, MCM_GETFIRSTDAYOFWEEK, 0, 0); prev = res; if (i == -1){ @@ -924,30 +926,30 @@ static void test_unicode(void) /* Setter and Getters for Unicode format */ /* getting the current settings */ - temp = SendMessage(hwnd, MCM_GETUNICODEFORMAT, 0, 0); + temp = SendMessageA(hwnd, MCM_GETUNICODEFORMAT, 0, 0); /* setting to 1, should return previous settings */ - res = SendMessage(hwnd, MCM_SETUNICODEFORMAT, 1, 0); + res = SendMessageA(hwnd, MCM_SETUNICODEFORMAT, 1, 0); expect(temp, res); /* current setting is 1, so, should return 1 */ - res = SendMessage(hwnd, MCM_GETUNICODEFORMAT, 0, 0); + res = SendMessageA(hwnd, MCM_GETUNICODEFORMAT, 0, 0); ok(1 == res || broken(0 == res), /* comctl32 <= 4.70 */ "Expected 1, got %d\n", res); /* setting to 0, should return previous settings */ - res = SendMessage(hwnd, MCM_SETUNICODEFORMAT, 0, 0); + res = SendMessageA(hwnd, MCM_SETUNICODEFORMAT, 0, 0); ok(1 == res || broken(0 == res), /* comctl32 <= 4.70 */ "Expected 1, got %d\n", res); /* current setting is 0, so, it should return 0 */ - res = SendMessage(hwnd, MCM_GETUNICODEFORMAT, 0, 0); + res = SendMessageA(hwnd, MCM_GETUNICODEFORMAT, 0, 0); expect(0, res); /* should return previous settings */ - res = SendMessage(hwnd, MCM_SETUNICODEFORMAT, 1, 0); + res = SendMessageA(hwnd, MCM_SETUNICODEFORMAT, 1, 0); expect(0, res); ok_sequence(sequences, MONTHCAL_SEQ_INDEX, monthcal_unicode_seq, "monthcal unicode", FALSE); @@ -960,18 +962,18 @@ static void test_hittest(void) typedef struct hittest_test { UINT ht; - int todo; + BOOL todo; } hittest_test_t; static const hittest_test_t title_hits[] = { /* Start is the same everywhere */ - { MCHT_TITLE, 0 }, - { MCHT_TITLEBTNPREV, 0 }, + { MCHT_TITLE, FALSE }, + { MCHT_TITLEBTNPREV, FALSE }, /* The middle piece is only tested for presence of items */ /* End is the same everywhere */ - { MCHT_TITLEBTNNEXT, 0 }, - { MCHT_TITLE, 0 }, - { MCHT_NOWHERE, 1 } + { MCHT_TITLEBTNNEXT, FALSE }, + { MCHT_TITLE, FALSE }, + { MCHT_NOWHERE, TRUE } }; MCHITTESTINFO mchit; @@ -993,17 +995,17 @@ static void test_hittest(void) mchit.cbSize = MCHITTESTINFO_V1_SIZE - 1; mchit.pt.x = 0; mchit.pt.y = 0; - res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); + res = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); expect(0, mchit.pt.x); expect(0, mchit.pt.y); expect(~0u, res); expect(0, mchit.uHit); /* test with invalid pointer */ - res = SendMessage(hwnd, MCM_HITTEST, 0, 0); + res = SendMessageA(hwnd, MCM_HITTEST, 0, 0); expect(~0u, res); /* resize control to display single Calendar */ - res = SendMessage(hwnd, MCM_GETMINREQRECT, 0, (LPARAM)&r); + res = SendMessageA(hwnd, MCM_GETMINREQRECT, 0, (LPARAM)&r); if (res == 0) { win_skip("Message MCM_GETMINREQRECT unsupported. Skipping.\n"); @@ -1023,14 +1025,14 @@ static void test_hittest(void) st.wMilliseconds = 0; st.wDayOfWeek = 0; - res = SendMessage(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st); + res = SendMessageA(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st); expect(1,res); /* (0, 0) is the top left of the control - title */ mchit.cbSize = MCHITTESTINFO_V1_SIZE; mchit.pt.x = 0; mchit.pt.y = 0; - res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); + res = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); expect(0, mchit.pt.x); expect(0, mchit.pt.y); expect(mchit.uHit, res); @@ -1039,7 +1041,7 @@ static void test_hittest(void) /* bottom right of the control and should not be active */ mchit.pt.x = r.right; mchit.pt.y = r.bottom; - res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); + res = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); expect(r.right, mchit.pt.x); expect(r.bottom, mchit.pt.y); expect(mchit.uHit, res); @@ -1048,7 +1050,7 @@ static void test_hittest(void) /* completely out of the control, should not be active */ mchit.pt.x = 2 * r.right; mchit.pt.y = 2 * r.bottom; - res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM) & mchit); + res = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); expect(2 * r.right, mchit.pt.x); expect(2 * r.bottom, mchit.pt.y); expect(mchit.uHit, res); @@ -1057,7 +1059,7 @@ static void test_hittest(void) /* in active area - day of the week */ mchit.pt.x = r.right / 2; mchit.pt.y = r.bottom / 2; - res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM) & mchit); + res = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); expect(r.right / 2, mchit.pt.x); expect(r.bottom / 2, mchit.pt.y); expect(mchit.uHit, res); @@ -1066,7 +1068,7 @@ static void test_hittest(void) /* in active area - day of the week #2 */ mchit.pt.x = r.right / 14; /* half of first day rect */ mchit.pt.y = r.bottom / 2; - res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM) & mchit); + res = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); expect(r.right / 14, mchit.pt.x); expect(r.bottom / 2, mchit.pt.y); expect(mchit.uHit, res); @@ -1075,27 +1077,28 @@ static void test_hittest(void) /* in active area - date from prev month */ mchit.pt.x = r.right / 14; /* half of first day rect */ mchit.pt.y = 6 * r.bottom / 19; - res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM) & mchit); + res = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); expect(r.right / 14, mchit.pt.x); expect(6 * r.bottom / 19, mchit.pt.y); expect(mchit.uHit, res); expect_hex(MCHT_CALENDARDATEPREV, res); -#if 0 +if (0) +{ /* (125, 115) is in active area - date from this month */ mchit.pt.x = 125; mchit.pt.y = 115; - res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM) & mchit); + res = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); expect(125, mchit.pt.x); expect(115, mchit.pt.y); expect(mchit.uHit, res); expect(MCHT_CALENDARDATE, res); -#endif +} /* in active area - date from next month */ mchit.pt.x = 11 * r.right / 14; mchit.pt.y = 16 * r.bottom / 19; - res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM) & mchit); + res = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); expect(11 * r.right / 14, mchit.pt.x); expect(16 * r.bottom / 19, mchit.pt.y); expect(mchit.uHit, res); @@ -1104,7 +1107,7 @@ static void test_hittest(void) /* in active area - today link */ mchit.pt.x = r.right / 14; mchit.pt.y = 18 * r.bottom / 19; - res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM) & mchit); + res = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); expect(r.right / 14, mchit.pt.x); expect(18 * r.bottom / 19, mchit.pt.y); expect(mchit.uHit, res); @@ -1113,7 +1116,7 @@ static void test_hittest(void) /* in active area - today link */ mchit.pt.x = r.right / 2; mchit.pt.y = 18 * r.bottom / 19; - res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM) & mchit); + res = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); expect(r.right / 2, mchit.pt.x); expect(18 * r.bottom / 19, mchit.pt.y); expect(mchit.uHit, res); @@ -1122,7 +1125,7 @@ static void test_hittest(void) /* in active area - today link */ mchit.pt.x = r.right / 10; mchit.pt.y = 18 * r.bottom / 19; - res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM) & mchit); + res = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); expect(r.right / 10, mchit.pt.x); expect(18 * r.bottom / 19, mchit.pt.y); expect(mchit.uHit, res); @@ -1135,7 +1138,7 @@ static void test_hittest(void) find all elements. */ /* Get the format of the title */ - GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SYEARMONTH, yearmonth, 80); + GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_SYEARMONTH, yearmonth, 80); /* Find out if we have a month and/or year */ locale_year = strstr(yearmonth, "y"); locale_month = strstr(yearmonth, "M"); @@ -1143,14 +1146,14 @@ static void test_hittest(void) mchit.pt.x = 0; mchit.pt.y = (5/2) * r.bottom / 19; title_index = 0; - old_res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM) & mchit); + old_res = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); expect_hex(title_hits[title_index].ht, old_res); in_the_middle = FALSE; month_count = year_count = 0; for (x = 0; x < r.right; x++){ mchit.pt.x = x; - res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM) & mchit); + res = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); expect(x, mchit.pt.x); expect((5/2) * r.bottom / 19, mchit.pt.y); expect(mchit.uHit, res); @@ -1218,7 +1221,7 @@ static void test_todaylink(void) hwnd = create_monthcal_control(0); - res = SendMessage(hwnd, MCM_GETMINREQRECT, 0, (LPARAM)&r); + res = SendMessageA(hwnd, MCM_GETMINREQRECT, 0, (LPARAM)&r); expect(1, res); MoveWindow(hwnd, 0, 0, r.right, r.bottom, FALSE); @@ -1228,7 +1231,7 @@ static void test_todaylink(void) mchit.cbSize = MCHITTESTINFO_V1_SIZE; mchit.pt.x = r.right / 14; mchit.pt.y = 18 * r.bottom / 19; - res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM) & mchit); + res = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); expect(r.right / 14, mchit.pt.x); expect(18 * r.bottom / 19, mchit.pt.y); expect(mchit.uHit, res); @@ -1238,21 +1241,21 @@ static void test_todaylink(void) st_test.wMonth = 1; st_test.wYear = 2005; - res = SendMessage(hwnd, MCM_SETTODAY, 0, (LPARAM)&st_test); + res = SendMessageA(hwnd, MCM_SETTODAY, 0, (LPARAM)&st_test); expect(0, res); memset(&st_new, 0, sizeof(st_new)); - res = SendMessage(hwnd, MCM_GETTODAY, 0, (LPARAM)&st_new); + res = SendMessageA(hwnd, MCM_GETTODAY, 0, (LPARAM)&st_new); expect(1, res); expect(1, st_new.wDay); expect(1, st_new.wMonth); expect(2005, st_new.wYear); - res = SendMessage(hwnd, WM_LBUTTONDOWN, MK_LBUTTON, MAKELONG(mchit.pt.x, mchit.pt.y)); + res = SendMessageA(hwnd, WM_LBUTTONDOWN, MK_LBUTTON, MAKELONG(mchit.pt.x, mchit.pt.y)); expect(0, res); memset(&st_new, 0, sizeof(st_new)); - res = SendMessage(hwnd, MCM_GETCURSEL, 0, (LPARAM)&st_new); + res = SendMessageA(hwnd, MCM_GETCURSEL, 0, (LPARAM)&st_new); expect(1, res); expect(1, st_new.wDay); expect(1, st_new.wMonth); @@ -1283,10 +1286,10 @@ static void test_today(void) st_new.wDay = 27; st_new.wMonth = 27; - res = SendMessage(hwnd, MCM_SETTODAY, 0, (LPARAM)&st_test); + res = SendMessageA(hwnd, MCM_SETTODAY, 0, (LPARAM)&st_test); expect(0, res); - res = SendMessage(hwnd, MCM_GETTODAY, 0, (LPARAM)&st_new); + res = SendMessageA(hwnd, MCM_GETTODAY, 0, (LPARAM)&st_new); expect(1, res); /* st_test should not change */ @@ -1301,10 +1304,10 @@ static void test_today(void) st_test.wDay = 0; st_test.wMonth = 0; - res = SendMessage(hwnd, MCM_SETTODAY, 0, (LPARAM)&st_test); + res = SendMessageA(hwnd, MCM_SETTODAY, 0, (LPARAM)&st_test); expect(0, res); - res = SendMessage(hwnd, MCM_GETTODAY, 0, (LPARAM)&st_new); + res = SendMessageA(hwnd, MCM_GETTODAY, 0, (LPARAM)&st_new); expect(1, res); /* st_test should not change */ @@ -1327,33 +1330,33 @@ static void test_scroll(void) hwnd = create_monthcal_control(0); - res = SendMessage(hwnd, MCM_GETMONTHDELTA, 0, 0); + res = SendMessageA(hwnd, MCM_GETMONTHDELTA, 0, 0); expect(2, res); flush_sequences(sequences, NUM_MSG_SEQUENCES); /* Setter and Getters for scroll rate */ - res = SendMessage(hwnd, MCM_SETMONTHDELTA, 2, 0); + res = SendMessageA(hwnd, MCM_SETMONTHDELTA, 2, 0); expect(0, res); - res = SendMessage(hwnd, MCM_SETMONTHDELTA, 3, 0); + res = SendMessageA(hwnd, MCM_SETMONTHDELTA, 3, 0); expect(2, res); - res = SendMessage(hwnd, MCM_GETMONTHDELTA, 0, 0); + res = SendMessageA(hwnd, MCM_GETMONTHDELTA, 0, 0); expect(3, res); - res = SendMessage(hwnd, MCM_SETMONTHDELTA, 12, 0); + res = SendMessageA(hwnd, MCM_SETMONTHDELTA, 12, 0); expect(3, res); - res = SendMessage(hwnd, MCM_GETMONTHDELTA, 0, 0); + res = SendMessageA(hwnd, MCM_GETMONTHDELTA, 0, 0); expect(12, res); - res = SendMessage(hwnd, MCM_SETMONTHDELTA, 15, 0); + res = SendMessageA(hwnd, MCM_SETMONTHDELTA, 15, 0); expect(12, res); - res = SendMessage(hwnd, MCM_GETMONTHDELTA, 0, 0); + res = SendMessageA(hwnd, MCM_GETMONTHDELTA, 0, 0); expect(15, res); - res = SendMessage(hwnd, MCM_SETMONTHDELTA, -5, 0); + res = SendMessageA(hwnd, MCM_SETMONTHDELTA, -5, 0); expect(15, res); - res = SendMessage(hwnd, MCM_GETMONTHDELTA, 0, 0); + res = SendMessageA(hwnd, MCM_GETMONTHDELTA, 0, 0); expect(-5, res); ok_sequence(sequences, MONTHCAL_SEQ_INDEX, monthcal_scroll_seq, "monthcal scroll", FALSE); @@ -1382,20 +1385,20 @@ static void test_monthrange(void) st.wMilliseconds = 0; st.wDayOfWeek = 0; - res = SendMessage(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st); + res = SendMessageA(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st); expect(1,res); /* to be locale independent */ - SendMessage(hwnd, MCM_SETFIRSTDAYOFWEEK, 0, (LPARAM)6); + SendMessageA(hwnd, MCM_SETFIRSTDAYOFWEEK, 0, (LPARAM)6); - res = SendMessage(hwnd, MCM_GETMINREQRECT, 0, (LPARAM)&r); + res = SendMessageA(hwnd, MCM_GETMINREQRECT, 0, (LPARAM)&r); expect(TRUE, res); /* resize control to display two Calendars */ MoveWindow(hwnd, 0, 0, r.right, (5/2)*r.bottom, FALSE); flush_sequences(sequences, NUM_MSG_SEQUENCES); - res = SendMessage(hwnd, MCM_GETMONTHRANGE, GMR_VISIBLE, (LPARAM)st_visible); + res = SendMessageA(hwnd, MCM_GETMONTHRANGE, GMR_VISIBLE, (LPARAM)st_visible); expect(2, res); expect(2000, st_visible[0].wYear); expect(11, st_visible[0].wMonth); @@ -1404,7 +1407,7 @@ static void test_monthrange(void) expect(12, st_visible[1].wMonth); expect(31, st_visible[1].wDay); - res = SendMessage(hwnd, MCM_GETMONTHRANGE, GMR_DAYSTATE, (LPARAM)st_daystate); + res = SendMessageA(hwnd, MCM_GETMONTHRANGE, GMR_DAYSTATE, (LPARAM)st_daystate); expect(4, res); expect(2000, st_daystate[0].wYear); expect(10, st_daystate[0].wMonth); @@ -1416,10 +1419,10 @@ static void test_monthrange(void) ok_sequence(sequences, MONTHCAL_SEQ_INDEX, monthcal_monthrange_seq, "monthcal monthrange", FALSE); /* with null date array parameter */ - res = SendMessage(hwnd, MCM_GETMONTHRANGE, GMR_VISIBLE, 0); + res = SendMessageA(hwnd, MCM_GETMONTHRANGE, GMR_VISIBLE, 0); expect(2, res); - res = SendMessage(hwnd, MCM_GETMONTHRANGE, GMR_DAYSTATE, 0); + res = SendMessageA(hwnd, MCM_GETMONTHRANGE, GMR_DAYSTATE, 0); expect(4, res); /* resize control to display single Calendar */ @@ -1430,11 +1433,11 @@ static void test_monthrange(void) st.wYear = 1752; st.wDay = 14; - res = SendMessage(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st); + res = SendMessageA(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st); expect(1, res); /* September 1752 has 19 days */ - res = SendMessage(hwnd, MCM_GETMONTHRANGE, GMR_VISIBLE, (LPARAM)st_visible); + res = SendMessageA(hwnd, MCM_GETMONTHRANGE, GMR_VISIBLE, (LPARAM)st_visible); expect(1, res); expect(1752, st_visible[0].wYear); @@ -1458,59 +1461,59 @@ static void test_maxselday(void) hwnd = create_monthcal_control(0); /* if no style specified default to 1 */ - res = SendMessage(hwnd, MCM_GETMAXSELCOUNT, 0, 0); + res = SendMessageA(hwnd, MCM_GETMAXSELCOUNT, 0, 0); expect(1, res); - res = SendMessage(hwnd, MCM_SETMAXSELCOUNT, 5, 0); + res = SendMessageA(hwnd, MCM_SETMAXSELCOUNT, 5, 0); expect(0, res); - res = SendMessage(hwnd, MCM_GETMAXSELCOUNT, 0, 0); + res = SendMessageA(hwnd, MCM_GETMAXSELCOUNT, 0, 0); expect(1, res); /* try to set style */ - style = GetWindowLong(hwnd, GWL_STYLE); - SetWindowLong(hwnd, GWL_STYLE, style | MCS_MULTISELECT); - style = GetWindowLong(hwnd, GWL_STYLE); + style = GetWindowLongA(hwnd, GWL_STYLE); + SetWindowLongA(hwnd, GWL_STYLE, style | MCS_MULTISELECT); + style = GetWindowLongA(hwnd, GWL_STYLE); ok(!(style & MCS_MULTISELECT), "Expected MCS_MULTISELECT not to be set\n"); DestroyWindow(hwnd); hwnd = create_monthcal_control(MCS_MULTISELECT); /* try to remove style */ - style = GetWindowLong(hwnd, GWL_STYLE); - SetWindowLong(hwnd, GWL_STYLE, style & ~MCS_MULTISELECT); - style = GetWindowLong(hwnd, GWL_STYLE); + style = GetWindowLongA(hwnd, GWL_STYLE); + SetWindowLongA(hwnd, GWL_STYLE, style & ~MCS_MULTISELECT); + style = GetWindowLongA(hwnd, GWL_STYLE); ok(style & MCS_MULTISELECT, "Expected MCS_MULTISELECT to be set\n"); DestroyWindow(hwnd); hwnd = create_monthcal_control(MCS_MULTISELECT); /* default width is a week */ - res = SendMessage(hwnd, MCM_GETMAXSELCOUNT, 0, 0); + res = SendMessageA(hwnd, MCM_GETMAXSELCOUNT, 0, 0); expect(7, res); flush_sequences(sequences, NUM_MSG_SEQUENCES); /* Setter and Getters for max selected days */ - res = SendMessage(hwnd, MCM_SETMAXSELCOUNT, 5, 0); + res = SendMessageA(hwnd, MCM_SETMAXSELCOUNT, 5, 0); expect(1, res); - res = SendMessage(hwnd, MCM_GETMAXSELCOUNT, 0, 0); + res = SendMessageA(hwnd, MCM_GETMAXSELCOUNT, 0, 0); expect(5, res); - res = SendMessage(hwnd, MCM_SETMAXSELCOUNT, 15, 0); + res = SendMessageA(hwnd, MCM_SETMAXSELCOUNT, 15, 0); expect(1, res); - res = SendMessage(hwnd, MCM_GETMAXSELCOUNT, 0, 0); + res = SendMessageA(hwnd, MCM_GETMAXSELCOUNT, 0, 0); expect(15, res); /* test invalid value */ - res = SendMessage(hwnd, MCM_SETMAXSELCOUNT, -1, 0); + res = SendMessageA(hwnd, MCM_SETMAXSELCOUNT, -1, 0); expect(0, res); - res = SendMessage(hwnd, MCM_GETMAXSELCOUNT, 0, 0); + res = SendMessageA(hwnd, MCM_GETMAXSELCOUNT, 0, 0); expect(15, res); ok_sequence(sequences, MONTHCAL_SEQ_INDEX, monthcal_max_sel_day_seq, "monthcal MaxSelDay", FALSE); /* zero value is invalid too */ - res = SendMessage(hwnd, MCM_SETMAXSELCOUNT, 0, 0); + res = SendMessageA(hwnd, MCM_SETMAXSELCOUNT, 0, 0); expect(0, res); - res = SendMessage(hwnd, MCM_GETMAXSELCOUNT, 0, 0); + res = SendMessageA(hwnd, MCM_GETMAXSELCOUNT, 0, 0); expect(15, res); DestroyWindow(hwnd); @@ -1535,14 +1538,14 @@ static void test_size(void) hFont2 = CreateFontIndirectA(&logfont); /* initialize to a font we can compare against */ - SendMessage(hwnd, WM_SETFONT, (WPARAM)hFont1, 0); - res = SendMessage(hwnd, MCM_GETMINREQRECT, 0, (LPARAM)&r1); - ok(res, "SendMessage(MCM_GETMINREQRECT) failed\n"); + SendMessageA(hwnd, WM_SETFONT, (WPARAM)hFont1, 0); + res = SendMessageA(hwnd, MCM_GETMINREQRECT, 0, (LPARAM)&r1); + ok(res, "SendMessageA(MCM_GETMINREQRECT) failed\n"); /* check that setting a larger font results in an larger rect */ - SendMessage(hwnd, WM_SETFONT, (WPARAM)hFont2, 0); - res = SendMessage(hwnd, MCM_GETMINREQRECT, 0, (LPARAM)&r2); - ok(res, "SendMessage(MCM_GETMINREQRECT) failed\n"); + SendMessageA(hwnd, WM_SETFONT, (WPARAM)hFont2, 0); + res = SendMessageA(hwnd, MCM_GETMINREQRECT, 0, (LPARAM)&r2); + ok(res, "SendMessageA(MCM_GETMINREQRECT) failed\n"); OffsetRect(&r1, -r1.left, -r1.top); OffsetRect(&r2, -r2.left, -r2.top); @@ -1595,11 +1598,11 @@ static void test_selrange(void) hwnd = create_monthcal_control(MCS_MULTISELECT); /* just after creation selection should start and end today */ - ret = SendMessage(hwnd, MCM_GETTODAY, 0, (LPARAM)&st); + ret = SendMessageA(hwnd, MCM_GETTODAY, 0, (LPARAM)&st); expect(TRUE, ret); memset(range, 0xcc, sizeof(range)); - ret = SendMessage(hwnd, MCM_GETSELRANGE, 0, (LPARAM)range); + ret = SendMessageA(hwnd, MCM_GETSELRANGE, 0, (LPARAM)range); expect(TRUE, ret); expect(st.wYear, range[0].wYear); expect(st.wMonth, range[0].wMonth); @@ -1638,10 +1641,10 @@ static void test_selrange(void) range[1] = range[0]; range[1].wDay = 3; - ret = SendMessage(hwnd, MCM_SETSELRANGE, 0, (LPARAM)range); + ret = SendMessageA(hwnd, MCM_SETSELRANGE, 0, (LPARAM)range); expect(TRUE, ret); - ret = SendMessage(hwnd, MCM_GETSELRANGE, 0, (LPARAM)range2); + ret = SendMessageA(hwnd, MCM_GETSELRANGE, 0, (LPARAM)range2); expect(TRUE, ret); expect(range[1].wYear, range2[0].wYear); @@ -1669,17 +1672,17 @@ static void test_selrange(void) range[0].wDay = 1; range[1] = range[0]; - ret = SendMessage(hwnd, MCM_SETSELRANGE, 0, (LPARAM)range); + ret = SendMessageA(hwnd, MCM_SETSELRANGE, 0, (LPARAM)range); expect(TRUE, ret); range[1] = range[0]; /* default max. range is 7 days */ range[1].wDay = 8; - ret = SendMessage(hwnd, MCM_SETSELRANGE, 0, (LPARAM)range); + ret = SendMessageA(hwnd, MCM_SETSELRANGE, 0, (LPARAM)range); expect(FALSE, ret); - ret = SendMessage(hwnd, MCM_GETSELRANGE, 0, (LPARAM)range2); + ret = SendMessageA(hwnd, MCM_GETSELRANGE, 0, (LPARAM)range2); expect(TRUE, ret); expect(range[0].wYear, range2[0].wYear); @@ -1700,16 +1703,16 @@ static void test_killfocus(void) hwnd = create_monthcal_control(0); /* make parent invisible */ - style = GetWindowLong(parent_wnd, GWL_STYLE); - SetWindowLong(parent_wnd, GWL_STYLE, style &~ WS_VISIBLE); + style = GetWindowLongA(parent_wnd, GWL_STYLE); + SetWindowLongA(parent_wnd, GWL_STYLE, style & ~WS_VISIBLE); - SendMessage(hwnd, WM_KILLFOCUS, (WPARAM)GetDesktopWindow(), 0); + SendMessageA(hwnd, WM_KILLFOCUS, (WPARAM)GetDesktopWindow(), 0); - style = GetWindowLong(hwnd, GWL_STYLE); + style = GetWindowLongA(hwnd, GWL_STYLE); ok(style & WS_VISIBLE, "Expected WS_VISIBLE to be set\n"); - style = GetWindowLong(parent_wnd, GWL_STYLE); - SetWindowLong(parent_wnd, GWL_STYLE, style | WS_VISIBLE); + style = GetWindowLongA(parent_wnd, GWL_STYLE); + SetWindowLongA(parent_wnd, GWL_STYLE, style | WS_VISIBLE); DestroyWindow(hwnd); } @@ -1722,9 +1725,9 @@ static void test_hittest_v6(void) RECT r; hwnd = create_monthcal_control(0); - SendMessage(hwnd, MCM_SETCALENDARBORDER, TRUE, 0); + SendMessageA(hwnd, MCM_SETCALENDARBORDER, TRUE, 0); - SendMessage(hwnd, MCM_GETMINREQRECT, 0, (LPARAM)&r); + SendMessageA(hwnd, MCM_GETMINREQRECT, 0, (LPARAM)&r); /* reserving some area around calendar */ MoveWindow(hwnd, 0, 0, r.right * 3 / 2, r.bottom * 3 / 2, FALSE); mchit.cbSize = sizeof(MCHITTESTINFO); @@ -1732,7 +1735,7 @@ static void test_hittest_v6(void) mchit.iOffset = -1; mchit.iRow = -1; mchit.iCol = -1; - ret = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); + ret = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); if (ret == ~0u) { win_skip("Only MCHITTESTINFO_V1 supported\n"); @@ -1748,7 +1751,7 @@ static void test_hittest_v6(void) mchit.pt.x = r.right / 2; mchit.pt.y = r.bottom / 2; mchit.iOffset = -1; - ret = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); + ret = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); expect_hex(MCHT_CALENDARDATE, ret); expect(0, mchit.iOffset); @@ -1759,7 +1762,7 @@ static void test_hittest_v6(void) mchit.iCol = mchit.iRow = -1; mchit.uHit = 0; mchit.rc.left = mchit.rc.right = mchit.rc.top = mchit.rc.bottom = -1; - ret = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); + ret = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); expect_hex(MCHT_CALENDARDATE, ret); expect_hex(MCHT_CALENDARDATE, mchit.uHit); expect(0, mchit.iOffset); @@ -1776,7 +1779,7 @@ static void test_hittest_v6(void) mchit.iCol = mchit.iRow = -1; mchit.uHit = 0; mchit.rc.left = mchit.rc.right = mchit.rc.top = mchit.rc.bottom = -1; - ret = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); + ret = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); expect_hex(MCHT_TITLE, ret); expect_hex(MCHT_TITLE, mchit.uHit); expect(0, mchit.iOffset); @@ -1795,7 +1798,7 @@ static void test_hittest_v6(void) mchit.iCol = mchit.iRow = -2; mchit.uHit = ~0; mchit.rc.left = mchit.rc.right = mchit.rc.top = mchit.rc.bottom = -1; - ret = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); + ret = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); todo_wine expect_hex(MCHT_NOWHERE, ret); todo_wine expect_hex(MCHT_NOWHERE, mchit.uHit); expect(-2, mchit.iOffset); @@ -1817,10 +1820,10 @@ static void test_get_set_border(void) hwnd = create_monthcal_control(0); /* a non-default value */ - ret = SendMessage(hwnd, MCM_SETCALENDARBORDER, TRUE, 10); + ret = SendMessageA(hwnd, MCM_SETCALENDARBORDER, TRUE, 10); expect(0, ret); - ret = SendMessage(hwnd, MCM_GETCALENDARBORDER, 0, 0); + ret = SendMessageA(hwnd, MCM_GETCALENDARBORDER, 0, 0); if (ret != 10) { @@ -1907,7 +1910,7 @@ static void test_daystate(void) /* without MCS_DAYSTATE */ hwnd = create_monthcal_control(0); - ret = SendMessage(hwnd, MCM_GETMINREQRECT, 0, (LPARAM)&r); + ret = SendMessageA(hwnd, MCM_GETMINREQRECT, 0, (LPARAM)&r); expect(TRUE, ret); /* resize control to display two Calendars */ @@ -1978,23 +1981,22 @@ static void test_sel_notify(void) for(i = 0; i < sizeof styles / sizeof styles[0]; i++) { hwnd = create_monthcal_control(styles[i].val); - SetWindowLongPtr(hwnd, GWLP_ID, SEL_NOTIFY_TEST_ID); - assert(hwnd); - SendMessage(hwnd, MCM_GETMINREQRECT, 0, (LPARAM)&rc); + SetWindowLongPtrA(hwnd, GWLP_ID, SEL_NOTIFY_TEST_ID); + SendMessageA(hwnd, MCM_GETMINREQRECT, 0, (LPARAM)&rc); MoveWindow(hwnd, 0, 0, rc.right, rc.bottom, FALSE); /* Simulate mouse click on some unselected day to generate MCN_SELECT and MCN_SELCHANGE notifications */ mchit.pt.x = rc.right / 2; mchit.pt.y = rc.bottom / 2; - SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); - SendMessage(hwnd, MCM_GETCURSEL, 0, (LPARAM)&st); + SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); + SendMessageA(hwnd, MCM_GETCURSEL, 0, (LPARAM)&st); while(st.wDay == mchit.st.wDay) /* Ensure that mchit.pt points to unselected day */ { mchit.pt.y++; - SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); + SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); } - SendMessage(hwnd, WM_LBUTTONDOWN, 0, MAKELPARAM(mchit.pt.x, mchit.pt.y)); - SendMessage(hwnd, WM_LBUTTONUP, 0, MAKELPARAM(mchit.pt.x, mchit.pt.y)); + SendMessageA(hwnd, WM_LBUTTONDOWN, 0, MAKELPARAM(mchit.pt.x, mchit.pt.y)); + SendMessageA(hwnd, WM_LBUTTONUP, 0, MAKELPARAM(mchit.pt.x, mchit.pt.y)); DestroyWindow(hwnd); } } @@ -2004,7 +2006,6 @@ START_TEST(monthcal) BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*); INITCOMMONCONTROLSEX iccex; HMODULE hComctl32; - HWND hwnd; ULONG_PTR ctx_cookie; HANDLE hCtx; @@ -2050,21 +2051,6 @@ START_TEST(monthcal) return; } - /* this is a XP SP3 failure workaround */ - hwnd = CreateWindowExA(0, MONTHCAL_CLASSA, "foo", - WS_CHILD | WS_BORDER | WS_VISIBLE, - 0, 0, 100, 100, - parent_wnd, NULL, GetModuleHandleA(NULL), NULL); - if (!IsWindow(hwnd)) - { - win_skip("FIXME: failed to create Monthcal window.\n"); - unload_v6_module(ctx_cookie, hCtx); - DestroyWindow(parent_wnd); - return; - } - else - DestroyWindow(hwnd); - test_hittest_v6(); test_get_set_border(); test_MCM_SIZERECTTOMIN(); diff --git a/rostests/winetests/comctl32/mru.c b/rostests/winetests/comctl32/mru.c index 075281c9fb7..774357f798f 100644 --- a/rostests/winetests/comctl32/mru.c +++ b/rostests/winetests/comctl32/mru.c @@ -409,7 +409,7 @@ static void test_MRUListA(void) /* check entry 0 */ buffer[0] = 0; iRet = pEnumMRUListA(hMRU, 0, buffer, 255); - ok(iRet == lstrlen(checks[3]), "EnumMRUList expected %d, got %d\n", lstrlen(checks[3]), iRet); + ok(iRet == lstrlenA(checks[3]), "EnumMRUList expected %d, got %d\n", lstrlenA(checks[3]), iRet); ok(strcmp(buffer, checks[3]) == 0, "EnumMRUList expected %s, got %s\n", checks[3], buffer); /* check entry 0 with a too small buffer */ @@ -418,7 +418,7 @@ static void test_MRUListA(void) buffer[2] = 'A'; /* unchanged */ buffer[3] = 0; /* unchanged */ iRet = pEnumMRUListA(hMRU, 0, buffer, 2); - ok(iRet == lstrlen(checks[3]), "EnumMRUList expected %d, got %d\n", lstrlen(checks[3]), iRet); + ok(iRet == lstrlenA(checks[3]), "EnumMRUList expected %d, got %d\n", lstrlenA(checks[3]), iRet); ok(strcmp(buffer, "T") == 0, "EnumMRUList expected %s, got %s\n", "T", buffer); /* make sure space after buffer has old values */ ok(buffer[2] == 'A', "EnumMRUList expected %02x, got %02x\n", 'A', buffer[2]); @@ -426,13 +426,13 @@ static void test_MRUListA(void) /* check entry 1 */ buffer[0] = 0; iRet = pEnumMRUListA(hMRU, 1, buffer, 255); - ok(iRet == lstrlen(checks[1]), "EnumMRUList expected %d, got %d\n", lstrlen(checks[1]), iRet); + ok(iRet == lstrlenA(checks[1]), "EnumMRUList expected %d, got %d\n", lstrlenA(checks[1]), iRet); ok(strcmp(buffer, checks[1]) == 0, "EnumMRUList expected %s, got %s\n", checks[1], buffer); /* check entry 2 */ buffer[0] = 0; iRet = pEnumMRUListA(hMRU, 2, buffer, 255); - ok(iRet == lstrlen(checks[2]), "EnumMRUList expected %d, got %d\n", lstrlen(checks[2]), iRet); + ok(iRet == lstrlenA(checks[2]), "EnumMRUList expected %d, got %d\n", lstrlenA(checks[2]), iRet); ok(strcmp(buffer, checks[2]) == 0, "EnumMRUList expected %s, got %s\n", checks[2], buffer); /* check out of bounds entry 3 */ diff --git a/rostests/winetests/comctl32/msg.h b/rostests/winetests/comctl32/msg.h index fd6fb99c57f..71f96e993d2 100644 --- a/rostests/winetests/comctl32/msg.h +++ b/rostests/winetests/comctl32/msg.h @@ -106,7 +106,7 @@ static inline void flush_sequences(struct msg_sequence **seq, int n) } static void ok_sequence_(struct msg_sequence **seq, int sequence_index, - const struct message *expected, const char *context, int todo, + const struct message *expected, const char *context, BOOL todo, const char *file, int line) { struct msg_sequence *msg_seq = seq[sequence_index]; diff --git a/rostests/winetests/comctl32/pager.c b/rostests/winetests/comctl32/pager.c index 3d5a32e94da..e32b5d0ee8b 100644 --- a/rostests/winetests/comctl32/pager.c +++ b/rostests/winetests/comctl32/pager.c @@ -103,7 +103,7 @@ static BOOL register_parent_wnd_class(void) cls.cbWndExtra = 0; cls.hInstance = GetModuleHandleA(NULL); cls.hIcon = 0; - cls.hCursor = LoadCursorA(0, IDC_ARROW); + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); cls.hbrBackground = GetStockObject(WHITE_BRUSH); cls.lpszMenuName = NULL; cls.lpszClassName = "Pager test parent class"; @@ -115,7 +115,7 @@ static HWND create_parent_window(void) if (!register_parent_wnd_class()) return NULL; - return CreateWindow("Pager test parent class", "Pager test parent window", + return CreateWindowA("Pager test parent class", "Pager test parent window", WS_OVERLAPPED | WS_VISIBLE, 0, 0, 200, 200, 0, NULL, GetModuleHandleA(NULL), NULL ); } diff --git a/rostests/winetests/comctl32/progress.c b/rostests/winetests/comctl32/progress.c index 59a4b00804d..19e84cd0fb8 100644 --- a/rostests/winetests/comctl32/progress.c +++ b/rostests/winetests/comctl32/progress.c @@ -17,7 +17,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include #include #include "windef.h" @@ -48,12 +47,12 @@ static void flush_events(void) while (diff > 0) { if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min(10,diff), QS_ALLINPUT ) == WAIT_TIMEOUT) break; - while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg ); + while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); diff = time - GetTickCount(); } } -static LRESULT CALLBACK ProgressTestWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +static LRESULT CALLBACK progress_test_wnd_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { @@ -72,7 +71,7 @@ static WNDPROC progress_wndproc; static BOOL erased; static RECT last_paint_rect; -static LRESULT CALLBACK ProgressSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +static LRESULT CALLBACK progress_subclass_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { if (msg == WM_PAINT) { @@ -82,7 +81,7 @@ static LRESULT CALLBACK ProgressSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, { erased = TRUE; } - return CallWindowProc(progress_wndproc, hWnd, msg, wParam, lParam); + return CallWindowProcA(progress_wndproc, hWnd, msg, wParam, lParam); } @@ -99,7 +98,8 @@ static void init(void) BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*); WNDCLASSA wc; RECT rect; - + BOOL ret; + hComctl32 = GetModuleHandleA("comctl32.dll"); pInitCommonControlsEx = (void*)GetProcAddress(hComctl32, "InitCommonControlsEx"); if (pInitCommonControlsEx) @@ -117,28 +117,29 @@ static void init(void) wc.cbWndExtra = 0; wc.hInstance = GetModuleHandleA(NULL); wc.hIcon = NULL; - wc.hCursor = LoadCursorA(NULL, IDC_ARROW); + wc.hCursor = LoadCursorA(NULL, (LPCSTR)IDC_ARROW); wc.hbrBackground = GetSysColorBrush(COLOR_WINDOW); wc.lpszMenuName = NULL; wc.lpszClassName = progressTestClass; - wc.lpfnWndProc = ProgressTestWndProc; + wc.lpfnWndProc = progress_test_wnd_proc; RegisterClassA(&wc); rect.left = 0; rect.top = 0; rect.right = 400; rect.bottom = 20; - assert(AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW, FALSE)); + ret = AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW, FALSE); + ok(ret, "got %d\n", ret); hProgressParentWnd = CreateWindowExA(0, progressTestClass, "Progress Bar Test", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, rect.right - rect.left, rect.bottom - rect.top, NULL, NULL, GetModuleHandleA(NULL), 0); - assert(hProgressParentWnd != NULL); + ok(hProgressParentWnd != NULL, "failed to create parent wnd\n"); GetClientRect(hProgressParentWnd, &rect); - hProgressWnd = CreateWindowEx(0, PROGRESS_CLASS, "", WS_CHILD | WS_VISIBLE, + hProgressWnd = CreateWindowExA(0, PROGRESS_CLASSA, "", WS_CHILD | WS_VISIBLE, 0, 0, rect.right, rect.bottom, hProgressParentWnd, NULL, GetModuleHandleA(NULL), 0); - assert(hProgressWnd != NULL); - progress_wndproc = (WNDPROC)SetWindowLongPtr(hProgressWnd, GWLP_WNDPROC, (LPARAM)ProgressSubclassProc); + ok(hProgressWnd != NULL, "failed to create parent wnd\n"); + progress_wndproc = (WNDPROC)SetWindowLongPtrA(hProgressWnd, GWLP_WNDPROC, (LPARAM)progress_subclass_proc); ShowWindow(hProgressParentWnd, SW_SHOWNORMAL); ok(GetUpdateRect(hProgressParentWnd, NULL, FALSE), "GetUpdateRect: There should be a region that needs to be updated\n"); @@ -146,7 +147,6 @@ static void init(void) update_window(hProgressParentWnd); } - static void cleanup(void) { MSG msg; @@ -201,13 +201,13 @@ static void test_redraw(void) position is not in the new range, it does. Don't test this, it may change in future Windows versions. */ - SendMessage(hProgressWnd, PBM_SETPOS, 0, 0); + SendMessageA(hProgressWnd, PBM_SETPOS, 0, 0); update_window(hProgressWnd); /* increase to 10 - no background erase required */ erased = FALSE; SetRectEmpty(&last_paint_rect); - SendMessage(hProgressWnd, PBM_SETPOS, 10, 0); + SendMessageA(hProgressWnd, PBM_SETPOS, 10, 0); GetClientRect(hProgressWnd, &client_rect); ok(EqualRect(&last_paint_rect, &client_rect), "last_paint_rect was { %d, %d, %d, %d } instead of { %d, %d, %d, %d }\n", @@ -219,7 +219,7 @@ static void test_redraw(void) /* decrease to 0 - background erase will be required */ erased = FALSE; SetRectEmpty(&last_paint_rect); - SendMessage(hProgressWnd, PBM_SETPOS, 0, 0); + SendMessageA(hProgressWnd, PBM_SETPOS, 0, 0); GetClientRect(hProgressWnd, &client_rect); ok(EqualRect(&last_paint_rect, &client_rect), "last_paint_rect was { %d, %d, %d, %d } instead of { %d, %d, %d, %d }\n", diff --git a/rostests/winetests/comctl32/propsheet.c b/rostests/winetests/comctl32/propsheet.c index 387c9a7d840..20c9e06c84c 100644 --- a/rostests/winetests/comctl32/propsheet.c +++ b/rostests/winetests/comctl32/propsheet.c @@ -47,7 +47,7 @@ static void flush_events(void) while (diff > 0) { if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min_timeout, QS_ALLINPUT ) == WAIT_TIMEOUT) break; - while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg ); + while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); diff = time - GetTickCount(); } } @@ -134,7 +134,7 @@ static void test_title(void) hdlg = (HWND)PropertySheetA(&psh); ok(hdlg != INVALID_HANDLE_VALUE, "got invalid handle value %p\n", hdlg); - style = GetWindowLong(hdlg, GWL_STYLE); + style = GetWindowLongA(hdlg, GWL_STYLE); ok(style == (WS_POPUP|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CAPTION|WS_SYSMENU| DS_CONTEXTHELP|DS_MODALFRAME|DS_SETFONT|DS_3DLOOK), "got unexpected style: %x\n", style); @@ -174,14 +174,17 @@ static void test_nopage(void) ok(hdlg != INVALID_HANDLE_VALUE, "got invalid handle value %p\n", hdlg); ShowWindow(hdlg,SW_NORMAL); - SendMessage(hdlg, PSM_REMOVEPAGE, 0, 0); - hpage = PropSheet_GetCurrentPageHwnd(hdlg); - ok(hpage == NULL, "expected no current page, got %p, index=%d\n", hpage, PropSheet_HwndToIndex(hdlg, hpage)); + SendMessageA(hdlg, PSM_REMOVEPAGE, 0, 0); + hpage = /* PropSheet_GetCurrentPageHwnd(hdlg); */ + (HWND)SendMessageA(hdlg, PSM_GETCURRENTPAGEHWND, 0, 0); + active_page = /* PropSheet_HwndToIndex(hdlg, hpage)); */ + (int)SendMessageA(hdlg, PSM_HWNDTOINDEX, (WPARAM)hpage, 0); + ok(hpage == NULL, "expected no current page, got %p, index=%d\n", hpage, active_page); flush_events(); RedrawWindow(hdlg,NULL,NULL,RDW_UPDATENOW|RDW_ERASENOW); /* Check that the property sheet was fully redrawn */ - ok(!PeekMessage(&msg, 0, WM_PAINT, WM_PAINT, PM_NOREMOVE), + ok(!PeekMessageA(&msg, 0, WM_PAINT, WM_PAINT, PM_NOREMOVE), "expected no pending WM_PAINT messages\n"); DestroyWindow(hdlg); } @@ -210,7 +213,7 @@ static void register_parent_wnd_class(void) cls.cbWndExtra = 0; cls.hInstance = GetModuleHandleA(NULL); cls.hIcon = 0; - cls.hCursor = LoadCursorA(0, IDC_ARROW); + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); cls.hbrBackground = GetStockObject(WHITE_BRUSH); cls.lpszMenuName = NULL; cls.lpszClassName = "parent class"; @@ -262,12 +265,13 @@ static INT_PTR CALLBACK nav_page_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM LPNMHDR hdr = (LPNMHDR)lparam; switch(hdr->code){ case PSN_SETACTIVE: - active_page = PropSheet_HwndToIndex(hdr->hwndFrom, hwnd); + active_page = /* PropSheet_HwndToIndex(hdr->hwndFrom, hwnd); */ + (int)SendMessageA(hdr->hwndFrom, PSM_HWNDTOINDEX, (WPARAM)hwnd, 0); return TRUE; case PSN_KILLACTIVE: /* prevent navigation away from the fourth page */ if(active_page == 3){ - SetWindowLongPtr(hwnd, DWLP_MSGRESULT, TRUE); + SetWindowLongPtrA(hwnd, DWLP_MSGRESULT, TRUE); return TRUE; } } @@ -295,25 +299,25 @@ static void test_wiznavigation(void) psp[0].dwSize = sizeof(PROPSHEETPAGEA); psp[0].hInstance = GetModuleHandleA(NULL); - U(psp[0]).pszTemplate = MAKEINTRESOURCE(IDD_PROP_PAGE_INTRO); + U(psp[0]).pszTemplate = (LPCSTR)MAKEINTRESOURCE(IDD_PROP_PAGE_INTRO); psp[0].pfnDlgProc = nav_page_proc; hpsp[0] = CreatePropertySheetPageA(&psp[0]); psp[1].dwSize = sizeof(PROPSHEETPAGEA); psp[1].hInstance = GetModuleHandleA(NULL); - U(psp[1]).pszTemplate = MAKEINTRESOURCE(IDD_PROP_PAGE_EDIT); + U(psp[1]).pszTemplate = (LPCSTR)MAKEINTRESOURCE(IDD_PROP_PAGE_EDIT); psp[1].pfnDlgProc = nav_page_proc; hpsp[1] = CreatePropertySheetPageA(&psp[1]); psp[2].dwSize = sizeof(PROPSHEETPAGEA); psp[2].hInstance = GetModuleHandleA(NULL); - U(psp[2]).pszTemplate = MAKEINTRESOURCE(IDD_PROP_PAGE_RADIO); + U(psp[2]).pszTemplate = (LPCSTR)MAKEINTRESOURCE(IDD_PROP_PAGE_RADIO); psp[2].pfnDlgProc = nav_page_proc; hpsp[2] = CreatePropertySheetPageA(&psp[2]); psp[3].dwSize = sizeof(PROPSHEETPAGEA); psp[3].hInstance = GetModuleHandleA(NULL); - U(psp[3]).pszTemplate = MAKEINTRESOURCE(IDD_PROP_PAGE_EXIT); + U(psp[3]).pszTemplate = (LPCSTR)MAKEINTRESOURCE(IDD_PROP_PAGE_EXIT); psp[3].pfnDlgProc = nav_page_proc; hpsp[3] = CreatePropertySheetPageA(&psp[3]); @@ -330,71 +334,71 @@ static void test_wiznavigation(void) ok(active_page == 0, "Active page should be 0. Is: %d\n", active_page); - style = GetWindowLong(hdlg, GWL_STYLE) & ~(DS_CONTEXTHELP|WS_SYSMENU); + style = GetWindowLongA(hdlg, GWL_STYLE) & ~(DS_CONTEXTHELP|WS_SYSMENU); ok(style == (WS_POPUP|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CAPTION| DS_MODALFRAME|DS_SETFONT|DS_3DLOOK), "got unexpected style: %x\n", style); control = GetFocus(); - controlID = GetWindowLongPtr(control, GWLP_ID); + controlID = GetWindowLongPtrA(control, GWLP_ID); ok(controlID == nextID, "Focus should have been set to the Next button. Expected: %d, Found: %ld\n", nextID, controlID); /* simulate pressing the Next button */ - SendMessage(hdlg, PSM_PRESSBUTTON, PSBTN_NEXT, 0); + SendMessageA(hdlg, PSM_PRESSBUTTON, PSBTN_NEXT, 0); if (!active_page) hwndtoindex_supported = FALSE; if (hwndtoindex_supported) ok(active_page == 1, "Active page should be 1 after pressing Next. Is: %d\n", active_page); control = GetFocus(); - controlID = GetWindowLongPtr(control, GWLP_ID); + controlID = GetWindowLongPtrA(control, GWLP_ID); ok(controlID == IDC_PS_EDIT1, "Focus should be set to the first item on the second page. Expected: %d, Found: %ld\n", IDC_PS_EDIT1, controlID); - defidres = SendMessage(hdlg, DM_GETDEFID, 0, 0); + defidres = SendMessageA(hdlg, DM_GETDEFID, 0, 0); ok(defidres == MAKELRESULT(nextID, DC_HASDEFID), "Expected default button ID to be %d, is %d\n", nextID, LOWORD(defidres)); /* set the focus to the second edit box on this page */ SetFocus(GetNextDlgTabItem(hdlg, control, FALSE)); /* press next again */ - SendMessage(hdlg, PSM_PRESSBUTTON, PSBTN_NEXT, 0); + SendMessageA(hdlg, PSM_PRESSBUTTON, PSBTN_NEXT, 0); if (hwndtoindex_supported) ok(active_page == 2, "Active page should be 2 after pressing Next. Is: %d\n", active_page); control = GetFocus(); - controlID = GetWindowLongPtr(control, GWLP_ID); + controlID = GetWindowLongPtrA(control, GWLP_ID); ok(controlID == IDC_PS_RADIO1, "Focus should have been set to item on third page. Expected: %d, Found %ld\n", IDC_PS_RADIO1, controlID); /* back button */ - SendMessage(hdlg, PSM_PRESSBUTTON, PSBTN_BACK, 0); + SendMessageA(hdlg, PSM_PRESSBUTTON, PSBTN_BACK, 0); if (hwndtoindex_supported) ok(active_page == 1, "Active page should be 1 after pressing Back. Is: %d\n", active_page); control = GetFocus(); - controlID = GetWindowLongPtr(control, GWLP_ID); + controlID = GetWindowLongPtrA(control, GWLP_ID); ok(controlID == IDC_PS_EDIT1, "Focus should have been set to the first item on second page. Expected: %d, Found %ld\n", IDC_PS_EDIT1, controlID); - defidres = SendMessage(hdlg, DM_GETDEFID, 0, 0); + defidres = SendMessageA(hdlg, DM_GETDEFID, 0, 0); ok(defidres == MAKELRESULT(backID, DC_HASDEFID), "Expected default button ID to be %d, is %d\n", backID, LOWORD(defidres)); /* press next twice */ - SendMessage(hdlg, PSM_PRESSBUTTON, PSBTN_NEXT, 0); + SendMessageA(hdlg, PSM_PRESSBUTTON, PSBTN_NEXT, 0); if (hwndtoindex_supported) ok(active_page == 2, "Active page should be 2 after pressing Next. Is: %d\n", active_page); - SendMessage(hdlg, PSM_PRESSBUTTON, PSBTN_NEXT, 0); + SendMessageA(hdlg, PSM_PRESSBUTTON, PSBTN_NEXT, 0); if (hwndtoindex_supported) ok(active_page == 3, "Active page should be 3 after pressing Next. Is: %d\n", active_page); else active_page = 3; control = GetFocus(); - controlID = GetWindowLongPtr(control, GWLP_ID); + controlID = GetWindowLongPtrA(control, GWLP_ID); ok(controlID == nextID, "Focus should have been set to the Next button. Expected: %d, Found: %ld\n", nextID, controlID); /* try to navigate away, but shouldn't be able to */ - SendMessage(hdlg, PSM_PRESSBUTTON, PSBTN_BACK, 0); + SendMessageA(hdlg, PSM_PRESSBUTTON, PSBTN_BACK, 0); ok(active_page == 3, "Active page should still be 3 after pressing Back. Is: %d\n", active_page); - defidres = SendMessage(hdlg, DM_GETDEFID, 0, 0); + defidres = SendMessageA(hdlg, DM_GETDEFID, 0, 0); ok(defidres == MAKELRESULT(nextID, DC_HASDEFID), "Expected default button ID to be %d, is %d\n", nextID, LOWORD(defidres)); DestroyWindow(hdlg); @@ -495,7 +499,7 @@ static void test_custom_default_button(void) psp[0].dwSize = sizeof (PROPSHEETPAGEA); psp[0].dwFlags = PSP_USETITLE; psp[0].hInstance = GetModuleHandleA(NULL); - U(psp[0]).pszTemplate = MAKEINTRESOURCE(IDD_PROP_PAGE_WITH_CUSTOM_DEFAULT_BUTTON); + U(psp[0]).pszTemplate = (LPCSTR)MAKEINTRESOURCE(IDD_PROP_PAGE_WITH_CUSTOM_DEFAULT_BUTTON); U2(psp[0]).pszIcon = NULL; psp[0].pfnDlgProc = page_with_custom_default_button_dlg_proc; psp[0].pszTitle = "Page1"; @@ -521,10 +525,10 @@ static void test_custom_default_button(void) ok(hdlg != INVALID_HANDLE_VALUE, "Cannot create the property sheet\n"); /* Set the Add button as the default button. */ - SendMessage(hdlg, DM_SETDEFID, (WPARAM)IDC_PS_PUSHBUTTON1, 0); + SendMessageA(hdlg, DM_SETDEFID, (WPARAM)IDC_PS_PUSHBUTTON1, 0); /* Make sure the default button is the Add button. */ - result = SendMessage(hdlg, DM_GETDEFID, 0, 0); + result = SendMessageA(hdlg, DM_GETDEFID, 0, 0); ok(DC_HASDEFID == HIWORD(result), "The property sheet does not have a default button\n"); ok(IDC_PS_PUSHBUTTON1 == LOWORD(result), "The default button is not the Add button\n"); @@ -533,12 +537,13 @@ static void test_custom_default_button(void) keybd_event(VK_RETURN, 0, 0, 0); /* Process all the messages in the queue for this thread. */ - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) { - if (!PropSheet_IsDialogMessage(hdlg, &msg)) + /* (!PropSheet_IsDialogMessage(hdlg, &msg)) */ + if (!((BOOL)SendMessageA(hdlg, PSM_ISDIALOGMESSAGE, 0, (LPARAM)&msg))) { TranslateMessage(&msg); - DispatchMessage(&msg); + DispatchMessageA(&msg); } } @@ -682,7 +687,7 @@ static LRESULT CALLBACK sheet_callback_messages_proc (HWND hwnd, UINT msg, WPARA { save_message(hwnd, msg, wParam, lParam, RECEIVER_SHEET_WINPROC); - return CallWindowProc (oldWndProc, hwnd, msg, wParam, lParam); + return CallWindowProcA(oldWndProc, hwnd, msg, wParam, lParam); } static int CALLBACK sheet_callback_messages(HWND hwnd, UINT msg, LPARAM lParam) @@ -692,8 +697,8 @@ static int CALLBACK sheet_callback_messages(HWND hwnd, UINT msg, LPARAM lParam) switch (msg) { case PSCB_INITIALIZED: - oldWndProc = (WNDPROC)GetWindowLongPtr (hwnd, GWLP_WNDPROC); - SetWindowLongPtr (hwnd, GWLP_WNDPROC, (LONG_PTR)&sheet_callback_messages_proc); + oldWndProc = (WNDPROC)GetWindowLongPtrA(hwnd, GWLP_WNDPROC); + SetWindowLongPtrA(hwnd, GWLP_WNDPROC, (LONG_PTR)&sheet_callback_messages_proc); return TRUE; } @@ -721,7 +726,7 @@ static void test_messages(void) psp.dwSize = sizeof(psp); psp.dwFlags = 0; psp.hInstance = GetModuleHandleA(NULL); - U(psp).pszTemplate = MAKEINTRESOURCE(IDD_PROP_PAGE_MESSAGE_TEST); + U(psp).pszTemplate = (LPCSTR)MAKEINTRESOURCE(IDD_PROP_PAGE_MESSAGE_TEST); U2(psp).pszIcon = NULL; psp.pfnDlgProc = page_dlg_proc_messages; psp.lParam = 0; @@ -761,7 +766,7 @@ static void test_PSM_ADDPAGE(void) psp.dwSize = sizeof(psp); psp.dwFlags = 0; psp.hInstance = GetModuleHandleA(NULL); - U(psp).pszTemplate = MAKEINTRESOURCE(IDD_PROP_PAGE_MESSAGE_TEST); + U(psp).pszTemplate = (LPCSTR)MAKEINTRESOURCE(IDD_PROP_PAGE_MESSAGE_TEST); U2(psp).pszIcon = NULL; psp.pfnDlgProc = page_dlg_proc_messages; psp.lParam = 0; @@ -771,7 +776,7 @@ static void test_PSM_ADDPAGE(void) hpsp[1] = CreatePropertySheetPageA(&psp); hpsp[2] = CreatePropertySheetPageA(&psp); - U(psp).pszTemplate = MAKEINTRESOURCE(IDD_PROP_PAGE_ERROR); + U(psp).pszTemplate = (LPCSTR)MAKEINTRESOURCE(IDD_PROP_PAGE_ERROR); hpsp[3] = CreatePropertySheetPageA(&psp); psp.dwFlags = PSP_PREMATURE; diff --git a/rostests/winetests/comctl32/rebar.c b/rostests/winetests/comctl32/rebar.c index f85d0926766..bf9085bc88f 100644 --- a/rostests/winetests/comctl32/rebar.c +++ b/rostests/winetests/comctl32/rebar.c @@ -52,7 +52,7 @@ static int system_font_height; #define expect_eq(line, expr, value, type, format) { type ret = expr;\ ok((value) == ret, #expr " expected " format " got " format " from line %d\n", (value), (ret), line); } -static INT CALLBACK is_font_installed_proc(const LOGFONT *elf, const TEXTMETRIC *ntm, DWORD type, LPARAM lParam) +static INT CALLBACK is_font_installed_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam) { return 0; } @@ -71,10 +71,10 @@ static BOOL is_font_installed(const char *name) static void init_system_font_height(void) { HDC hDC; - TEXTMETRIC tm; + TEXTMETRICA tm; hDC = CreateCompatibleDC(NULL); - GetTextMetrics(hDC, &tm); + GetTextMetricsA(hDC, &tm); DeleteDC(NULL); system_font_height = tm.tmHeight; @@ -84,8 +84,8 @@ static HWND create_rebar_control(void) { HWND hwnd; - hwnd = CreateWindow(REBARCLASSNAME, NULL, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, - hMainWnd, (HMENU)17, GetModuleHandle(NULL), NULL); + hwnd = CreateWindowA(REBARCLASSNAMEA, NULL, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, + hMainWnd, (HMENU)17, GetModuleHandleA(NULL), NULL); ok(hwnd != NULL, "Failed to create Rebar\n"); SendMessageA(hwnd, WM_SETFONT, (WPARAM)GetStockObject(SYSTEM_FONT), 0); @@ -96,15 +96,15 @@ static HWND create_rebar_control(void) static HWND build_toolbar(int nr, HWND hParent) { TBBUTTON btns[8]; - HWND hToolbar = CreateWindowEx(0, TOOLBARCLASSNAME, NULL, WS_CHILD | WS_VISIBLE | CCS_NORESIZE, 0, 0, 0, 0, - hParent, (HMENU)5, GetModuleHandle(NULL), NULL); + HWND hToolbar = CreateWindowExA(0, TOOLBARCLASSNAMEA, NULL, WS_CHILD | WS_VISIBLE | CCS_NORESIZE, 0, 0, 0, 0, + hParent, (HMENU)5, GetModuleHandleA(NULL), NULL); int iBitmapId = 0; int i; ok(hToolbar != NULL, "Toolbar creation problem\n"); - ok(SendMessage(hToolbar, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0) == 0, "TB_BUTTONSTRUCTSIZE failed\n"); - ok(SendMessage(hToolbar, TB_AUTOSIZE, 0, 0) == 0, "TB_AUTOSIZE failed\n"); - ok(SendMessage(hToolbar, WM_SETFONT, (WPARAM)GetStockObject(SYSTEM_FONT), 0)==1, "WM_SETFONT\n"); + ok(SendMessageA(hToolbar, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0) == 0, "TB_BUTTONSTRUCTSIZE failed\n"); + ok(SendMessageA(hToolbar, TB_AUTOSIZE, 0, 0) == 0, "TB_AUTOSIZE failed\n"); + ok(SendMessageA(hToolbar, WM_SETFONT, (WPARAM)GetStockObject(SYSTEM_FONT), 0)==1, "WM_SETFONT\n"); for (i=0; i<5+nr; i++) { @@ -121,8 +121,8 @@ static HWND build_toolbar(int nr, HWND hParent) case 1: iBitmapId = IDB_VIEW_SMALL_COLOR; break; case 2: iBitmapId = IDB_STD_SMALL_COLOR; break; } - ok(SendMessage(hToolbar, TB_LOADIMAGES, iBitmapId, (LPARAM)HINST_COMMCTRL) == 0, "TB_LOADIMAGES failed\n"); - ok(SendMessage(hToolbar, TB_ADDBUTTONS, 5+nr, (LPARAM)btns), "TB_ADDBUTTONS failed\n"); + ok(SendMessageA(hToolbar, TB_LOADIMAGES, iBitmapId, (LPARAM)HINST_COMMCTRL) == 0, "TB_LOADIMAGES failed\n"); + ok(SendMessageA(hToolbar, TB_ADDBUTTONSA, 5+nr, (LPARAM)btns), "TB_ADDBUTTONSA failed\n"); return hToolbar; } @@ -171,10 +171,10 @@ static void dump_sizes(HWND hRebar) printf("{{0, 0, 0, 0}, 0, 0},"); for (i=0; ircClient); \ - count = SendMessage(hRebar, RB_GETROWCOUNT, 0, 0); \ + count = SendMessageA(hRebar, RB_GETROWCOUNT, 0, 0); \ compare(count, res->nRows, "%d"); \ for (i=0; inRows); i++) { \ int height = SendMessageA(hRebar, RB_GETROWHEIGHT, 0, 0);\ ok(height == res->cyRowHeights[i], "Height mismatch for row %d - %d vs %d\n", i, res->cyRowHeights[i], height); \ } \ - count = SendMessage(hRebar, RB_GETBANDCOUNT, 0, 0); \ + count = SendMessageA(hRebar, RB_GETBANDCOUNT, 0, 0); \ compare(count, res->nBands, "%d"); \ for (i=0; inBands); i++) { \ ok(SendMessageA(hRebar, RB_GETRECT, i, (LPARAM)&rc) == 1, "RB_GETRECT\n"); \ @@ -463,7 +463,7 @@ static int rbsize_numtests = 0; check_rect("band", rc, res->bands[i].rc); \ rbi.cbSize = REBARBANDINFOA_V6_SIZE; \ rbi.fMask = RBBIM_STYLE | RBBIM_SIZE; \ - ok(SendMessageA(hRebar, RB_GETBANDINFO, i, (LPARAM)&rbi) == 1, "RB_GETBANDINFO\n"); \ + ok(SendMessageA(hRebar, RB_GETBANDINFOA, i, (LPARAM)&rbi) == 1, "RB_GETBANDINFOA\n"); \ compare(rbi.fStyle, res->bands[i].fStyle, "%x"); \ compare(rbi.cx, res->bands[i].cx, "%d"); \ } \ @@ -489,13 +489,13 @@ static void add_band_w(HWND hRebar, LPCSTR lpszText, int cxMinChild, int cx, int rbi.cyMinChild = 20; rbi.hwndChild = build_toolbar(1, hRebar); rbi.lpText = (lpszText ? buffer : NULL); - SendMessage(hRebar, RB_INSERTBAND, -1, (LPARAM)&rbi); + SendMessageA(hRebar, RB_INSERTBANDA, -1, (LPARAM)&rbi); } static void test_layout(void) { HWND hRebar; - REBARBANDINFO rbi; + REBARBANDINFOA rbi; HIMAGELIST himl; REBARINFO ri; @@ -509,12 +509,12 @@ static void test_layout(void) rbi.cxMinChild = 100; rbi.cyMinChild = 30; rbi.hwndChild = NULL; - SendMessageA(hRebar, RB_INSERTBAND, -1, (LPARAM)&rbi); + SendMessageA(hRebar, RB_INSERTBANDA, -1, (LPARAM)&rbi); check_sizes(); rbi.fMask |= RBBIM_STYLE; rbi.fStyle = RBBS_CHILDEDGE; - SendMessageA(hRebar, RB_INSERTBAND, -1, (LPARAM)&rbi); + SendMessageA(hRebar, RB_INSERTBANDA, -1, (LPARAM)&rbi); check_sizes(); rbi.fStyle = 0; @@ -522,20 +522,20 @@ static void test_layout(void) rbi.cxMinChild = 30; rbi.cyMinChild = 30; rbi.hwndChild = build_toolbar(0, hRebar); - SendMessageA(hRebar, RB_INSERTBAND, -1, (LPARAM)&rbi); + SendMessageA(hRebar, RB_INSERTBANDA, -1, (LPARAM)&rbi); check_sizes(); rbi.fStyle = RBBS_CHILDEDGE; rbi.cx = 68; rbi.hwndChild = build_toolbar(0, hRebar); - SendMessageA(hRebar, RB_INSERTBAND, -1, (LPARAM)&rbi); + SendMessageA(hRebar, RB_INSERTBANDA, -1, (LPARAM)&rbi); check_sizes(); - SetWindowLong(hRebar, GWL_STYLE, GetWindowLong(hRebar, GWL_STYLE) | RBS_BANDBORDERS); + SetWindowLongA(hRebar, GWL_STYLE, GetWindowLongA(hRebar, GWL_STYLE) | RBS_BANDBORDERS); check_sizes(); /* a style change won't start a relayout */ rbi.fMask = RBBIM_SIZE; rbi.cx = 66; - SendMessageA(hRebar, RB_SETBANDINFO, 3, (LPARAM)&rbi); + SendMessageA(hRebar, RB_SETBANDINFOA, 3, (LPARAM)&rbi); check_sizes(); /* here it will be relayouted */ /* this will force a new row */ @@ -544,12 +544,12 @@ static void test_layout(void) rbi.cxMinChild = 400; rbi.cyMinChild = 30; rbi.hwndChild = build_toolbar(0, hRebar); - SendMessageA(hRebar, RB_INSERTBAND, 1, (LPARAM)&rbi); + SendMessageA(hRebar, RB_INSERTBANDA, 1, (LPARAM)&rbi); check_sizes(); rbi.fMask = RBBIM_STYLE; rbi.fStyle = RBBS_HIDDEN; - SendMessageA(hRebar, RB_SETBANDINFO, 2, (LPARAM)&rbi); + SendMessageA(hRebar, RB_SETBANDINFOA, 2, (LPARAM)&rbi); check_sizes(); SendMessageA(hRebar, RB_DELETEBAND, 2, 0); @@ -580,31 +580,32 @@ static void test_layout(void) check_sizes(); /* an image will increase the band height */ - himl = ImageList_LoadImage(LoadLibrary("comctl32"), MAKEINTRESOURCE(121), 24, 2, CLR_NONE, IMAGE_BITMAP, LR_DEFAULTCOLOR); + himl = ImageList_LoadImageA(GetModuleHandleA("comctl32"), MAKEINTRESOURCEA(121), 24, 2, + CLR_NONE, IMAGE_BITMAP, LR_DEFAULTCOLOR); ri.cbSize = sizeof(ri); ri.fMask = RBIM_IMAGELIST; ri.himl = himl; - ok(SendMessage(hRebar, RB_SETBARINFO, 0, (LPARAM)&ri), "RB_SETBARINFO failed\n"); + ok(SendMessageA(hRebar, RB_SETBARINFO, 0, (LPARAM)&ri), "RB_SETBARINFO failed\n"); rbi.fMask = RBBIM_IMAGE; rbi.iImage = 1; - SendMessage(hRebar, RB_SETBANDINFO, 1, (LPARAM)&rbi); + SendMessageA(hRebar, RB_SETBANDINFOA, 1, (LPARAM)&rbi); check_sizes(); /* after removing it everything is back to normal*/ rbi.iImage = -1; - SendMessage(hRebar, RB_SETBANDINFO, 1, (LPARAM)&rbi); + SendMessageA(hRebar, RB_SETBANDINFOA, 1, (LPARAM)&rbi); check_sizes(); /* Only -1 means that the image is not present. Other invalid values increase the height */ rbi.iImage = -2; - SendMessage(hRebar, RB_SETBANDINFO, 1, (LPARAM)&rbi); + SendMessageA(hRebar, RB_SETBANDINFOA, 1, (LPARAM)&rbi); check_sizes(); DestroyWindow(hRebar); /* VARHEIGHT resizing test on a horizontal rebar */ hRebar = create_rebar_control(); - SetWindowLong(hRebar, GWL_STYLE, GetWindowLong(hRebar, GWL_STYLE) | RBS_AUTOSIZE); + SetWindowLongA(hRebar, GWL_STYLE, GetWindowLongA(hRebar, GWL_STYLE) | RBS_AUTOSIZE); check_sizes(); rbi.fMask = RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_SIZE | RBBIM_STYLE; rbi.fStyle = RBBS_VARIABLEHEIGHT; @@ -615,24 +616,24 @@ static void test_layout(void) rbi.cyMaxChild = 200; rbi.cx = 90; rbi.hwndChild = build_toolbar(0, hRebar); - SendMessageA(hRebar, RB_INSERTBAND, -1, (LPARAM)&rbi); + SendMessageA(hRebar, RB_INSERTBANDA, -1, (LPARAM)&rbi); rbi.cyChild = 50; rbi.hwndChild = build_toolbar(0, hRebar); - SendMessageA(hRebar, RB_INSERTBAND, -1, (LPARAM)&rbi); + SendMessageA(hRebar, RB_INSERTBANDA, -1, (LPARAM)&rbi); rbi.cyMinChild = 40; rbi.cyChild = 50; rbi.cyIntegral = 5; rbi.hwndChild = build_toolbar(0, hRebar); - SendMessageA(hRebar, RB_INSERTBAND, -1, (LPARAM)&rbi); + SendMessageA(hRebar, RB_INSERTBANDA, -1, (LPARAM)&rbi); check_sizes(); DestroyWindow(hRebar); /* VARHEIGHT resizing on a vertical rebar */ hRebar = create_rebar_control(); - SetWindowLong(hRebar, GWL_STYLE, GetWindowLong(hRebar, GWL_STYLE) | CCS_VERT | RBS_AUTOSIZE); + SetWindowLongA(hRebar, GWL_STYLE, GetWindowLongA(hRebar, GWL_STYLE) | CCS_VERT | RBS_AUTOSIZE); check_sizes(); rbi.fMask = RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_SIZE | RBBIM_STYLE; rbi.fStyle = RBBS_VARIABLEHEIGHT; @@ -643,19 +644,19 @@ static void test_layout(void) rbi.cyMaxChild = 90; rbi.cx = 90; rbi.hwndChild = build_toolbar(0, hRebar); - SendMessageA(hRebar, RB_INSERTBAND, -1, (LPARAM)&rbi); + SendMessageA(hRebar, RB_INSERTBANDA, -1, (LPARAM)&rbi); check_sizes(); rbi.cyChild = 50; rbi.hwndChild = build_toolbar(0, hRebar); - SendMessageA(hRebar, RB_INSERTBAND, -1, (LPARAM)&rbi); + SendMessageA(hRebar, RB_INSERTBANDA, -1, (LPARAM)&rbi); check_sizes(); rbi.cyMinChild = 40; rbi.cyChild = 50; rbi.cyIntegral = 5; rbi.hwndChild = build_toolbar(0, hRebar); - SendMessageA(hRebar, RB_INSERTBAND, -1, (LPARAM)&rbi); + SendMessageA(hRebar, RB_INSERTBANDA, -1, (LPARAM)&rbi); check_sizes(); rbsize_results_free(); @@ -680,7 +681,7 @@ static void dump_client(HWND hRebar) } else notify = FALSE; - printf(" {{%d, %d, %d, %d}, %d, %s},\n", r.left, r.top, r.right, r.bottom, SendMessage(hRebar, RB_GETROWCOUNT, 0, 0), + printf(" {{%d, %d, %d, %d}, %d, %s},\n", r.left, r.top, r.right, r.bottom, SendMessageA(hRebar, RB_GETROWCOUNT, 0, 0), notify ? "TRUE" : "FALSE"); SetRect(&height_change_notify_rect, -1, -1, -1, -1); } @@ -832,7 +833,7 @@ static DWORD resize_numtests = 0; } else { \ check_rect("client", r, res->rc); \ } \ - value = (int)SendMessage(hRebar, RB_GETROWCOUNT, 0, 0); \ + value = (int)SendMessageA(hRebar, RB_GETROWCOUNT, 0, 0); \ ok(res->iNumRows == value, "RB_GETROWCOUNT expected %d got %d\n", res->iNumRows, value); \ if (res->heightNotify) { \ RECT rcClient; \ @@ -860,7 +861,7 @@ static void test_resize(void) comment("style %08x", dwStyles[i]); SetRect(&height_change_notify_rect, -1, -1, -1, -1); - hRebar = CreateWindow(REBARCLASSNAME, "A", dwStyles[i] | WS_CHILD | WS_VISIBLE, 10, 5, 500, 15, hMainWnd, NULL, GetModuleHandle(NULL), 0); + hRebar = CreateWindowA(REBARCLASSNAMEA, "A", dwStyles[i] | WS_CHILD | WS_VISIBLE, 10, 5, 500, 15, hMainWnd, NULL, GetModuleHandleA(NULL), 0); check_client(); add_band_w(hRebar, NULL, 70, 100, 0); if (dwStyles[i] & CCS_NOPARENTALIGN) /* the window drifts downward for CCS_NOPARENTALIGN without CCS_NODIVIDER */ @@ -882,15 +883,15 @@ static void test_resize(void) pos.x = 10; pos.y = 10; pos.flags = 0; - SendMessage(hRebar, WM_WINDOWPOSCHANGING, 0, (LPARAM)&pos); - SendMessage(hRebar, WM_WINDOWPOSCHANGED, 0, (LPARAM)&pos); + SendMessageA(hRebar, WM_WINDOWPOSCHANGING, 0, (LPARAM)&pos); + SendMessageA(hRebar, WM_WINDOWPOSCHANGED, 0, (LPARAM)&pos); check_client(); - SendMessage(hRebar, WM_SIZE, SIZE_RESTORED, MAKELONG(500, 500)); + SendMessageA(hRebar, WM_SIZE, SIZE_RESTORED, MAKELONG(500, 500)); check_client(); } - SendMessage(hRebar, RB_DELETEBAND, 0, 0); + SendMessageA(hRebar, RB_DELETEBAND, 0, 0); check_client(); - SendMessage(hRebar, RB_DELETEBAND, 0, 0); + SendMessageA(hRebar, RB_DELETEBAND, 0, 0); MoveWindow(hRebar, 0, 0, 100, 100, TRUE); check_client(); DestroyWindow(hRebar); @@ -913,7 +914,7 @@ static void expect_band_content_(int line, HWND hRebar, UINT uBand, INT fStyle, | RBBIM_SIZE | RBBIM_STYLE | RBBIM_TEXT; rb.lpText = buf; rb.cch = MAX_PATH; - ok(SendMessageA(hRebar, RB_GETBANDINFOA, uBand, (LPARAM)&rb), "RB_GETBANDINFO failed from line %d\n", line); + ok(SendMessageA(hRebar, RB_GETBANDINFOA, uBand, (LPARAM)&rb), "RB_GETBANDINFOA failed from line %d\n", line); expect_eq(line, rb.fStyle, fStyle, int, "%x"); expect_eq(line, rb.clrFore, clrFore, COLORREF, "%x"); expect_eq(line, rb.clrBack, clrBack, COLORREF, "%x"); @@ -966,37 +967,37 @@ static void test_bandinfo(void) rb.cyChild = 30; rb.cyMaxChild = 20; rb.cyIntegral = 10; - ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFO failed\n"); + ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFOA failed\n"); expect_band_content(hRebar, 0, 0, 0, GetSysColor(COLOR_3DFACE), "", -1, NULL, 15, 20, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 0, -1); rb.fMask = RBBIM_TEXT; rb.lpText = szABC; - ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFO failed\n"); + ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFOA failed\n"); expect_band_content(hRebar, 0, 0, 0, GetSysColor(COLOR_3DFACE), "ABC", -1, NULL, 15, 20, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 3 + 2*system_font_height, -1); rb.cbSize = REBARBANDINFOA_V6_SIZE; rb.fMask = 0; - ok(SendMessageA(hRebar, RB_INSERTBANDA, 1, (LPARAM)&rb), "RB_INSERTBAND failed\n"); + ok(SendMessageA(hRebar, RB_INSERTBANDA, 1, (LPARAM)&rb), "RB_INSERTBANDA failed\n"); expect_band_content(hRebar, 1, 0, 0, GetSysColor(COLOR_3DFACE), "", -1, NULL, 0, 0, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 9, -1); expect_band_content(hRebar, 0, 0, 0, GetSysColor(COLOR_3DFACE), "ABC", -1, NULL, 15, 20, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 8 + 2*system_font_height, -1); rb.fMask = RBBIM_HEADERSIZE; rb.cxHeader = 50; - ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFO failed\n"); + ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFOA failed\n"); expect_band_content(hRebar, 0, 0x40000000, 0, GetSysColor(COLOR_3DFACE), "ABC", -1, NULL, 15, 20, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 50, -1); rb.cxHeader = 5; - ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFO failed\n"); + ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFOA failed\n"); expect_band_content(hRebar, 0, 0x40000000, 0, GetSysColor(COLOR_3DFACE), "ABC", -1, NULL, 15, 20, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 5, -1); rb.fMask = RBBIM_TEXT; rb.lpText = szABCD; - ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFO failed\n"); + ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFOA failed\n"); expect_band_content(hRebar, 0, 0x40000000, 0, GetSysColor(COLOR_3DFACE), "ABCD", -1, NULL, 15, 20, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 5, -1); rb.fMask = RBBIM_STYLE | RBBIM_TEXT; rb.fStyle = RBBS_VARIABLEHEIGHT; rb.lpText = szABC; - ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFO failed\n"); + ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFOA failed\n"); expect_band_content(hRebar, 0, RBBS_VARIABLEHEIGHT, 0, GetSysColor(COLOR_3DFACE), "ABC", -1, NULL, 15, 20, 0, NULL, 0, 20, 0x7fffffff, 0, 0, 0, 8 + 2*system_font_height, 5); DestroyWindow(hRebar); @@ -1013,15 +1014,15 @@ static void test_colors(void) hRebar = create_rebar_control(); /* test default colors */ - clr = SendMessage(hRebar, RB_GETTEXTCOLOR, 0, 0); + clr = SendMessageA(hRebar, RB_GETTEXTCOLOR, 0, 0); compare(clr, CLR_NONE, "%x"); - clr = SendMessage(hRebar, RB_GETBKCOLOR, 0, 0); + clr = SendMessageA(hRebar, RB_GETBKCOLOR, 0, 0); compare(clr, CLR_NONE, "%x"); scheme.dwSize = sizeof(scheme); scheme.clrBtnHighlight = 0; scheme.clrBtnShadow = 0; - ret = SendMessage(hRebar, RB_GETCOLORSCHEME, 0, (LPARAM)&scheme); + ret = SendMessageA(hRebar, RB_GETCOLORSCHEME, 0, (LPARAM)&scheme); if (ret) { compare(scheme.clrBtnHighlight, CLR_DEFAULT, "%x"); @@ -1035,15 +1036,15 @@ static void test_colors(void) bi.cbSize = REBARBANDINFOA_V6_SIZE; bi.fMask = RBBIM_COLORS; bi.clrFore = bi.clrBack = 0xc0ffe; - ret = SendMessage(hRebar, RB_GETBANDINFO, 0, (LPARAM)&bi); - ok(ret, "RB_GETBANDINFO failed\n"); + ret = SendMessageA(hRebar, RB_GETBANDINFOA, 0, (LPARAM)&bi); + ok(ret, "RB_GETBANDINFOA failed\n"); compare(bi.clrFore, RGB(0, 0, 0), "%x"); compare(bi.clrBack, GetSysColor(COLOR_3DFACE), "%x"); - SendMessage(hRebar, RB_SETTEXTCOLOR, 0, RGB(255, 0, 0)); + SendMessageA(hRebar, RB_SETTEXTCOLOR, 0, RGB(255, 0, 0)); bi.clrFore = bi.clrBack = 0xc0ffe; - ret = SendMessage(hRebar, RB_GETBANDINFO, 0, (LPARAM)&bi); - ok(ret, "RB_GETBANDINFO failed\n"); + ret = SendMessageA(hRebar, RB_GETBANDINFOA, 0, (LPARAM)&bi); + ok(ret, "RB_GETBANDINFOA failed\n"); compare(bi.clrFore, RGB(0, 0, 0), "%x"); DestroyWindow(hRebar); @@ -1059,7 +1060,7 @@ static BOOL register_parent_wnd_class(void) wc.cbWndExtra = 0; wc.hInstance = GetModuleHandleA(NULL); wc.hIcon = NULL; - wc.hCursor = LoadCursorA(NULL, IDC_IBEAM); + wc.hCursor = LoadCursorA(NULL, (LPCSTR)IDC_IBEAM); wc.hbrBackground = GetSysColorBrush(COLOR_WINDOW); wc.lpszMenuName = NULL; wc.lpszClassName = "MyTestWnd"; @@ -1101,7 +1102,7 @@ static void test_showband(void) rbi.cxMinChild = 100; rbi.cyMinChild = 30; rbi.hwndChild = NULL; - SendMessageA(hRebar, RB_INSERTBAND, -1, (LPARAM)&rbi); + SendMessageA(hRebar, RB_INSERTBANDA, -1, (LPARAM)&rbi); /* index out of range */ ret = SendMessageA(hRebar, RB_SHOWBAND, 1, TRUE); diff --git a/rostests/winetests/comctl32/status.c b/rostests/winetests/comctl32/status.c index 69c3d9623e1..5605df0205f 100644 --- a/rostests/winetests/comctl32/status.c +++ b/rostests/winetests/comctl32/status.c @@ -20,7 +20,6 @@ #include -#include //#include #include #include @@ -52,12 +51,12 @@ static HWND create_status_control(DWORD style, DWORD exstyle) HWND hWndStatus; /* make the control */ - hWndStatus = CreateWindowEx(exstyle, STATUSCLASSNAME, NULL, style, + hWndStatus = CreateWindowExA(exstyle, STATUSCLASSNAMEA, NULL, style, /* placement */ 0, 0, 300, 20, /* parent, etc */ NULL, NULL, hinst, NULL); - assert (hWndStatus); + ok(hWndStatus != NULL, "failed to create status wnd\n"); return hWndStatus; } @@ -67,8 +66,8 @@ static LRESULT WINAPI create_test_wndproc(HWND hwnd, UINT msg, WPARAM wParam, LP if (msg == WM_CREATE) { - CREATESTRUCT *cs = (CREATESTRUCT *)lParam; - ret = CallWindowProc(g_status_wndproc, hwnd, msg, wParam, lParam); + CREATESTRUCTA *cs = (CREATESTRUCTA *)lParam; + ret = CallWindowProcA(g_status_wndproc, hwnd, msg, wParam, lParam); GetWindowRect(hwnd, &g_rcCreated); MapWindowPoints(HWND_DESKTOP, g_hMainWnd, (LPPOINT)&g_rcCreated, 2); ok(cs->x == g_rcCreated.left, "CREATESTRUCT.x modified\n"); @@ -76,25 +75,25 @@ static LRESULT WINAPI create_test_wndproc(HWND hwnd, UINT msg, WPARAM wParam, LP } else if (msg == WM_SIZE) { g_wmsize_count++; - ret = CallWindowProc(g_status_wndproc, hwnd, msg, wParam, lParam); + ret = CallWindowProcA(g_status_wndproc, hwnd, msg, wParam, lParam); } else - ret = CallWindowProc(g_status_wndproc, hwnd, msg, wParam, lParam); + ret = CallWindowProcA(g_status_wndproc, hwnd, msg, wParam, lParam); return ret; } static void register_subclass(void) { - WNDCLASSEX cls; + WNDCLASSEXA cls; - cls.cbSize = sizeof(WNDCLASSEX); - GetClassInfoEx(NULL, STATUSCLASSNAME, &cls); + cls.cbSize = sizeof(WNDCLASSEXA); + GetClassInfoExA(NULL, STATUSCLASSNAMEA, &cls); g_status_wndproc = cls.lpfnWndProc; cls.lpfnWndProc = create_test_wndproc; cls.lpszClassName = SUBCLASS_NAME; cls.hInstance = NULL; - ok(RegisterClassEx(&cls), "RegisterClassEx failed\n"); + ok(RegisterClassExA(&cls), "RegisterClassEx failed\n"); } static void test_create(void) @@ -115,7 +114,7 @@ static void test_create(void) DestroyWindow(hwnd); } -static int CALLBACK check_height_font_enumproc(ENUMLOGFONTEX *enumlf, NEWTEXTMETRICEX *ntm, DWORD type, LPARAM lParam) +static int CALLBACK check_height_font_enumproc(ENUMLOGFONTEXA *enumlf, NEWTEXTMETRICEXA *ntm, DWORD type, LPARAM lParam) { HWND hwndStatus = (HWND)lParam; HDC hdc = GetDC(NULL); @@ -132,18 +131,18 @@ static int CALLBACK check_height_font_enumproc(ENUMLOGFONTEX *enumlf, NEWTEXTMET for (i = 0; i < sizeof(sizes)/sizeof(sizes[0]); i++) { HFONT hFont; - TEXTMETRIC tm; + TEXTMETRICA tm; HFONT hCtrlFont; HFONT hOldFont; RECT rcCtrl; enumlf->elfLogFont.lfHeight = sizes[i]; - hFont = CreateFontIndirect(&enumlf->elfLogFont); - hCtrlFont = (HFONT)SendMessage(hwndStatus, WM_SETFONT, (WPARAM)hFont, TRUE); + hFont = CreateFontIndirectA(&enumlf->elfLogFont); + hCtrlFont = (HFONT)SendMessageA(hwndStatus, WM_SETFONT, (WPARAM)hFont, TRUE); hOldFont = SelectObject(hdc, hFont); GetClientRect(hwndStatus, &rcCtrl); - GetTextMetrics(hdc, &tm); + GetTextMetricsA(hdc, &tm); y = tm.tmHeight + (tm.tmInternalLeading ? tm.tmInternalLeading : 2) + 4; ok( (rcCtrl.bottom == max(y, g_ysize)) || (rcCtrl.bottom == max(y, g_dpisize)), @@ -151,37 +150,37 @@ static int CALLBACK check_height_font_enumproc(ENUMLOGFONTEX *enumlf, NEWTEXTMET rcCtrl.bottom, max(y, g_ysize), max(y, g_dpisize), facename, sizes[i]); SelectObject(hdc, hOldFont); - SendMessage(hwndStatus, WM_SETFONT, (WPARAM)hCtrlFont, TRUE); + SendMessageA(hwndStatus, WM_SETFONT, (WPARAM)hCtrlFont, TRUE); DeleteObject(hFont); } ReleaseDC(NULL, hdc); return 1; } -static int CALLBACK check_height_family_enumproc(ENUMLOGFONTEX *enumlf, NEWTEXTMETRICEX *ntm, DWORD type, LPARAM lParam) +static int CALLBACK check_height_family_enumproc(ENUMLOGFONTEXA *enumlf, NEWTEXTMETRICEXA *ntm, DWORD type, LPARAM lParam) { HDC hdc = GetDC(NULL); enumlf->elfLogFont.lfHeight = 0; - EnumFontFamiliesEx(hdc, &enumlf->elfLogFont, (FONTENUMPROC)check_height_font_enumproc, lParam, 0); + EnumFontFamiliesExA(hdc, &enumlf->elfLogFont, (FONTENUMPROCA)check_height_font_enumproc, lParam, 0); ReleaseDC(NULL, hdc); return 1; } static void test_height(void) { - LOGFONT lf; + LOGFONTA lf; HFONT hFont, hFontSm; RECT rc1, rc2; - HWND hwndStatus = CreateWindow(SUBCLASS_NAME, NULL, WS_CHILD|WS_VISIBLE, + HWND hwndStatus = CreateWindowA(SUBCLASS_NAME, NULL, WS_CHILD|WS_VISIBLE, 0, 0, 300, 20, g_hMainWnd, NULL, NULL, NULL); HDC hdc; GetClientRect(hwndStatus, &rc1); - hFont = CreateFont(32, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, ANSI_CHARSET, + hFont = CreateFontA(32, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FF_DONTCARE, "Tahoma"); g_wmsize_count = 0; - SendMessage(hwndStatus, WM_SETFONT, (WPARAM)hFont, TRUE); + SendMessageA(hwndStatus, WM_SETFONT, (WPARAM)hFont, TRUE); if (!g_wmsize_count) { skip("Status control not resized in win95, skipping broken tests.\n"); @@ -193,41 +192,41 @@ static void test_height(void) expect_rect(0, 0, 672, 42, rc2); /* GetTextMetrics returns invalid tmInternalLeading for this font */ g_wmsize_count = 0; - SendMessage(hwndStatus, WM_SETFONT, (WPARAM)hFont, TRUE); + SendMessageA(hwndStatus, WM_SETFONT, (WPARAM)hFont, TRUE); ok(g_wmsize_count > 0, "WM_SETFONT should issue WM_SIZE\n"); GetClientRect(hwndStatus, &rc2); expect_rect(0, 0, 672, 42, rc2); /* minheight < fontsize - no effects*/ - SendMessage(hwndStatus, SB_SETMINHEIGHT, 12, 0); - SendMessage(hwndStatus, WM_SIZE, 0, 0); + SendMessageA(hwndStatus, SB_SETMINHEIGHT, 12, 0); + SendMessageA(hwndStatus, WM_SIZE, 0, 0); GetClientRect(hwndStatus, &rc2); expect_rect(0, 0, 672, 42, rc2); /* minheight > fontsize - has an effect after WM_SIZE */ - SendMessage(hwndStatus, SB_SETMINHEIGHT, 60, 0); + SendMessageA(hwndStatus, SB_SETMINHEIGHT, 60, 0); GetClientRect(hwndStatus, &rc2); expect_rect(0, 0, 672, 42, rc2); - SendMessage(hwndStatus, WM_SIZE, 0, 0); + SendMessageA(hwndStatus, WM_SIZE, 0, 0); GetClientRect(hwndStatus, &rc2); expect_rect(0, 0, 672, 62, rc2); /* font changed to smaller than minheight - has an effect */ - SendMessage(hwndStatus, SB_SETMINHEIGHT, 30, 0); + SendMessageA(hwndStatus, SB_SETMINHEIGHT, 30, 0); expect_rect(0, 0, 672, 62, rc2); - SendMessage(hwndStatus, WM_SIZE, 0, 0); + SendMessageA(hwndStatus, WM_SIZE, 0, 0); GetClientRect(hwndStatus, &rc2); expect_rect(0, 0, 672, 42, rc2); - hFontSm = CreateFont(9, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, ANSI_CHARSET, + hFontSm = CreateFontA(9, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FF_DONTCARE, "Tahoma"); - SendMessage(hwndStatus, WM_SETFONT, (WPARAM)hFontSm, TRUE); + SendMessageA(hwndStatus, WM_SETFONT, (WPARAM)hFontSm, TRUE); GetClientRect(hwndStatus, &rc2); expect_rect(0, 0, 672, 32, rc2); /* test the height formula */ ZeroMemory(&lf, sizeof(lf)); - SendMessage(hwndStatus, SB_SETMINHEIGHT, 0, 0); + SendMessageA(hwndStatus, SB_SETMINHEIGHT, 0, 0); hdc = GetDC(NULL); /* used only for some fonts (tahoma as example) */ @@ -242,7 +241,7 @@ static void test_height(void) GetDeviceCaps(hdc, LOGPIXELSY), g_ysize, g_dpisize, GetSystemMetrics(SM_CYSIZE)); - EnumFontFamiliesEx(hdc, &lf, (FONTENUMPROC)check_height_family_enumproc, (LPARAM)hwndStatus, 0); + EnumFontFamiliesExA(hdc, &lf, (FONTENUMPROCA)check_height_family_enumproc, (LPARAM)hwndStatus, 0); ReleaseDC(NULL, hdc); DestroyWindow(hwndStatus); @@ -267,75 +266,75 @@ static void test_status_control(void) hWndStatus = create_status_control(WS_VISIBLE | SBT_TOOLTIPS, 0); /* Divide into parts and set text */ - r = SendMessage(hWndStatus, SB_SETPARTS, 3, (LPARAM)nParts); + r = SendMessageA(hWndStatus, SB_SETPARTS, 3, (LPARAM)nParts); expect(TRUE,r); - r = SendMessage(hWndStatus, SB_SETTEXT, SBT_POPOUT|0, (LPARAM)"First"); + r = SendMessageA(hWndStatus, SB_SETTEXTA, SBT_POPOUT|0, (LPARAM)"First"); expect(TRUE,r); - r = SendMessage(hWndStatus, SB_SETTEXT, SBT_OWNERDRAW|1, (LPARAM)"Second"); + r = SendMessageA(hWndStatus, SB_SETTEXTA, SBT_OWNERDRAW|1, (LPARAM)"Second"); expect(TRUE,r); - r = SendMessage(hWndStatus, SB_SETTEXT, SBT_NOBORDERS|2, (LPARAM)"Third"); + r = SendMessageA(hWndStatus, SB_SETTEXTA, SBT_NOBORDERS|2, (LPARAM)"Third"); expect(TRUE,r); /* Get RECT Information */ - r = SendMessage(hWndStatus, SB_GETRECT, 0, (LPARAM)&rc); + r = SendMessageA(hWndStatus, SB_GETRECT, 0, (LPARAM)&rc); expect(TRUE,r); expect(2,rc.top); /* The rc.bottom test is system dependent expect(22,rc.bottom); */ expect(0,rc.left); expect(50,rc.right); - r = SendMessage(hWndStatus, SB_GETRECT, -1, (LPARAM)&rc); + r = SendMessageA(hWndStatus, SB_GETRECT, -1, (LPARAM)&rc); expect(FALSE,r); - r = SendMessage(hWndStatus, SB_GETRECT, 3, (LPARAM)&rc); + r = SendMessageA(hWndStatus, SB_GETRECT, 3, (LPARAM)&rc); expect(FALSE,r); /* Get text length and text */ - r = SendMessage(hWndStatus, SB_GETTEXTLENGTH, 0, 0); + r = SendMessageA(hWndStatus, SB_GETTEXTLENGTHA, 0, 0); expect(5,LOWORD(r)); expect(SBT_POPOUT,HIWORD(r)); r = SendMessageW(hWndStatus, WM_GETTEXTLENGTH, 0, 0); ok(r == 5 || broken(0x02000005 /* NT4 */), "Expected 5, got %d\n", r); - r = SendMessage(hWndStatus, SB_GETTEXTLENGTH, 1, 0); + r = SendMessageA(hWndStatus, SB_GETTEXTLENGTHA, 1, 0); expect(0,LOWORD(r)); expect(SBT_OWNERDRAW,HIWORD(r)); - r = SendMessage(hWndStatus, SB_GETTEXTLENGTH, 2, 0); + r = SendMessageA(hWndStatus, SB_GETTEXTLENGTHA, 2, 0); expect(5,LOWORD(r)); expect(SBT_NOBORDERS,HIWORD(r)); - r = SendMessage(hWndStatus, SB_GETTEXT, 2, (LPARAM) charArray); + r = SendMessageA(hWndStatus, SB_GETTEXTA, 2, (LPARAM) charArray); ok(strcmp(charArray,"Third") == 0, "Expected Third, got %s\n", charArray); expect(5,LOWORD(r)); expect(SBT_NOBORDERS,HIWORD(r)); /* Get parts and borders */ - r = SendMessage(hWndStatus, SB_GETPARTS, 3, (LPARAM)checkParts); + r = SendMessageA(hWndStatus, SB_GETPARTS, 3, (LPARAM)checkParts); ok(r == 3, "Expected 3, got %d\n", r); expect(50,checkParts[0]); expect(150,checkParts[1]); expect(-1,checkParts[2]); - r = SendMessage(hWndStatus, SB_GETBORDERS, 0, (LPARAM)borders); + r = SendMessageA(hWndStatus, SB_GETBORDERS, 0, (LPARAM)borders); ok(r == TRUE, "Expected TRUE, got %d\n", r); expect(0,borders[0]); expect(2,borders[1]); expect(2,borders[2]); /* Test resetting text with different characters */ - r = SendMessage(hWndStatus, SB_SETTEXT, 0, (LPARAM)"First@Again"); + r = SendMessageA(hWndStatus, SB_SETTEXTA, 0, (LPARAM)"First@Again"); expect(TRUE,r); - r = SendMessage(hWndStatus, SB_SETTEXT, 1, (LPARAM)"Invalid\tChars\\7\7"); + r = SendMessageA(hWndStatus, SB_SETTEXTA, 1, (LPARAM)"Invalid\tChars\\7\7"); expect(TRUE,r); - r = SendMessage(hWndStatus, SB_SETTEXT, 2, (LPARAM)"InvalidChars\\n\n"); + r = SendMessageA(hWndStatus, SB_SETTEXTA, 2, (LPARAM)"InvalidChars\\n\n"); expect(TRUE,r); /* Get text again */ - r = SendMessage(hWndStatus, SB_GETTEXT, 0, (LPARAM) charArray); + r = SendMessageA(hWndStatus, SB_GETTEXTA, 0, (LPARAM) charArray); ok(strcmp(charArray,"First@Again") == 0, "Expected First@Again, got %s\n", charArray); expect(11,LOWORD(r)); expect(0,HIWORD(r)); - r = SendMessage(hWndStatus, SB_GETTEXT, 1, (LPARAM) charArray); + r = SendMessageA(hWndStatus, SB_GETTEXTA, 1, (LPARAM) charArray); ok(strcmp(charArray,"Invalid\tChars\\7 ") == 0, "Expected Invalid\tChars\\7 , got %s\n", charArray); expect(16,LOWORD(r)); expect(0,HIWORD(r)); - r = SendMessage(hWndStatus, SB_GETTEXT, 2, (LPARAM) charArray); + r = SendMessageA(hWndStatus, SB_GETTEXTA, 2, (LPARAM) charArray); ok(strcmp(charArray,"InvalidChars\\n ") == 0, "Expected InvalidChars\\n , got %s\n", charArray); expect(15,LOWORD(r)); @@ -344,9 +343,9 @@ static void test_status_control(void) /* test more nonprintable chars */ for(ch = 0x00; ch < 0x7F; ch++) { chstr[5] = ch; - r = SendMessage(hWndStatus, SB_SETTEXT, 0, (LPARAM)chstr); + r = SendMessageA(hWndStatus, SB_SETTEXTA, 0, (LPARAM)chstr); expect(TRUE,r); - r = SendMessage(hWndStatus, SB_GETTEXT, 0, (LPARAM)charArray); + r = SendMessageA(hWndStatus, SB_GETTEXTA, 0, (LPARAM)charArray); /* substitution with single space */ if (ch > 0x00 && ch < 0x20 && ch != '\t') chstr[5] = ' '; @@ -354,79 +353,79 @@ static void test_status_control(void) } /* Set background color */ - crColor = SendMessage(hWndStatus, SB_SETBKCOLOR , 0, RGB(255,0,0)); + crColor = SendMessageA(hWndStatus, SB_SETBKCOLOR , 0, RGB(255,0,0)); ok(crColor == CLR_DEFAULT || broken(crColor == RGB(0,0,0)), /* win95 */ "Expected 0x%.8x, got 0x%.8x\n", CLR_DEFAULT, crColor); - crColor = SendMessage(hWndStatus, SB_SETBKCOLOR , 0, CLR_DEFAULT); + crColor = SendMessageA(hWndStatus, SB_SETBKCOLOR , 0, CLR_DEFAULT); ok(crColor == RGB(255,0,0) || broken(crColor == RGB(0,0,0)), /* win95 */ "Expected 0x%.8x, got 0x%.8x\n", RGB(255,0,0), crColor); /* Add an icon to the status bar */ - hIcon = LoadIcon(NULL, IDI_QUESTION); - r = SendMessage(hWndStatus, SB_SETICON, 1, 0); + hIcon = LoadIconA(NULL, (LPCSTR)IDI_QUESTION); + r = SendMessageA(hWndStatus, SB_SETICON, 1, 0); ok(r != 0 || broken(r == 0), /* win95 */ "Expected non-zero, got %d\n", r); - r = SendMessage(hWndStatus, SB_SETICON, 1, (LPARAM) hIcon); + r = SendMessageA(hWndStatus, SB_SETICON, 1, (LPARAM) hIcon); ok(r != 0 || broken(r == 0), /* win95 */ "Expected non-zero, got %d\n", r); - r = SendMessage(hWndStatus, SB_SETICON, 1, 0); + r = SendMessageA(hWndStatus, SB_SETICON, 1, 0); ok(r != 0 || broken(r == 0), /* win95 */ "Expected non-zero, got %d\n", r); /* Set the Unicode format */ - r = SendMessage(hWndStatus, SB_SETUNICODEFORMAT, FALSE, 0); + r = SendMessageA(hWndStatus, SB_SETUNICODEFORMAT, FALSE, 0); expect(FALSE,r); - r = SendMessage(hWndStatus, SB_GETUNICODEFORMAT, 0, 0); + r = SendMessageA(hWndStatus, SB_GETUNICODEFORMAT, 0, 0); expect(FALSE,r); - r = SendMessage(hWndStatus, SB_SETUNICODEFORMAT, TRUE, 0); + r = SendMessageA(hWndStatus, SB_SETUNICODEFORMAT, TRUE, 0); expect(FALSE,r); - r = SendMessage(hWndStatus, SB_GETUNICODEFORMAT, 0, 0); + r = SendMessageA(hWndStatus, SB_GETUNICODEFORMAT, 0, 0); ok(r == TRUE || broken(r == FALSE), /* win95 */ "Expected TRUE, got %d\n", r); /* Reset number of parts */ - r = SendMessage(hWndStatus, SB_SETPARTS, 2, (LPARAM)nParts); + r = SendMessageA(hWndStatus, SB_SETPARTS, 2, (LPARAM)nParts); expect(TRUE,r); - r = SendMessage(hWndStatus, SB_GETPARTS, 0, 0); + r = SendMessageA(hWndStatus, SB_GETPARTS, 0, 0); ok(r == 2, "Expected 2, got %d\n", r); - r = SendMessage(hWndStatus, SB_SETPARTS, 0, 0); + r = SendMessageA(hWndStatus, SB_SETPARTS, 0, 0); expect(FALSE,r); - r = SendMessage(hWndStatus, SB_GETPARTS, 0, 0); + r = SendMessageA(hWndStatus, SB_GETPARTS, 0, 0); ok(r == 2, "Expected 2, got %d\n", r); /* Set the minimum height and get rectangle information again */ - SendMessage(hWndStatus, SB_SETMINHEIGHT, 50, 0); - r = SendMessage(hWndStatus, WM_SIZE, 0, 0); + SendMessageA(hWndStatus, SB_SETMINHEIGHT, 50, 0); + r = SendMessageA(hWndStatus, WM_SIZE, 0, 0); expect(0,r); - r = SendMessage(hWndStatus, SB_GETRECT, 0, (LPARAM)&rc); + r = SendMessageA(hWndStatus, SB_GETRECT, 0, (LPARAM)&rc); expect(TRUE,r); expect(2,rc.top); /* The rc.bottom test is system dependent expect(22,rc.bottom); */ expect(0,rc.left); expect(50,rc.right); - r = SendMessage(hWndStatus, SB_GETRECT, -1, (LPARAM)&rc); + r = SendMessageA(hWndStatus, SB_GETRECT, -1, (LPARAM)&rc); expect(FALSE,r); - r = SendMessage(hWndStatus, SB_GETRECT, 3, (LPARAM)&rc); + r = SendMessageA(hWndStatus, SB_GETRECT, 3, (LPARAM)&rc); expect(FALSE,r); /* Set the ToolTip text */ - SendMessage(hWndStatus, SB_SETTIPTEXT, 0,(LPARAM) "Tooltip Text"); + SendMessageA(hWndStatus, SB_SETTIPTEXTA, 0,(LPARAM) "Tooltip Text"); lstrcpyA(charArray, "apple"); - SendMessage(hWndStatus, SB_GETTIPTEXT, MAKEWPARAM (0, 20),(LPARAM) charArray); + SendMessageA(hWndStatus, SB_GETTIPTEXTA, MAKEWPARAM (0, 20),(LPARAM) charArray); ok(strcmp(charArray,"Tooltip Text") == 0 || broken(!strcmp(charArray, "apple")), /* win95 */ "Expected Tooltip Text, got %s\n", charArray); /* Make simple */ - SendMessage(hWndStatus, SB_SIMPLE, TRUE, 0); - r = SendMessage(hWndStatus, SB_ISSIMPLE, 0, 0); + SendMessageA(hWndStatus, SB_SIMPLE, TRUE, 0); + r = SendMessageA(hWndStatus, SB_ISSIMPLE, 0, 0); ok(r == TRUE || broken(r == FALSE), /* win95 */ "Expected TRUE, got %d\n", r); @@ -439,7 +438,7 @@ static LRESULT WINAPI ownerdraw_test_wndproc(HWND hwnd, UINT msg, WPARAM wParam, LRESULT ret; if (msg == WM_DRAWITEM) g_wmdrawitm_ctr++; - ret = CallWindowProc(g_wndproc_saved, hwnd, msg, wParam, lParam); + ret = CallWindowProcA(g_wndproc_saved, hwnd, msg, wParam, lParam); return ret; } @@ -451,59 +450,59 @@ static void test_status_ownerdraw(void) LONG oldstyle; /* subclass the main window and make sure it is visible */ - g_wndproc_saved = (WNDPROC) SetWindowLongPtr( g_hMainWnd, GWLP_WNDPROC, + g_wndproc_saved = (WNDPROC) SetWindowLongPtrA( g_hMainWnd, GWLP_WNDPROC, (LONG_PTR)ownerdraw_test_wndproc ); ok( g_wndproc_saved != 0, "failed to set the WndProc\n"); SetWindowPos( g_hMainWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE); - oldstyle = GetWindowLong( g_hMainWnd, GWL_STYLE); - SetWindowLong( g_hMainWnd, GWL_STYLE, oldstyle | WS_VISIBLE); + oldstyle = GetWindowLongA( g_hMainWnd, GWL_STYLE); + SetWindowLongA( g_hMainWnd, GWL_STYLE, oldstyle | WS_VISIBLE); /* create a status child window */ ok((hWndStatus = CreateWindowA(SUBCLASS_NAME, "", WS_CHILD|WS_VISIBLE, 0, 0, 100, 100, g_hMainWnd, NULL, NULL, 0)) != NULL, "CreateWindowA failed\n"); /* set text */ g_wmdrawitm_ctr = 0; - r = SendMessage(hWndStatus, SB_SETTEXT, 0, (LPARAM)statustext); + r = SendMessageA(hWndStatus, SB_SETTEXTA, 0, (LPARAM)statustext); ok( r == TRUE, "Sendmessage returned %d, expected 1\n", r); ok( 0 == g_wmdrawitm_ctr, "got %d drawitem messages expected none\n", g_wmdrawitm_ctr); /* set same text, with ownerdraw flag */ g_wmdrawitm_ctr = 0; - r = SendMessage(hWndStatus, SB_SETTEXT, SBT_OWNERDRAW, (LPARAM)statustext); + r = SendMessageA(hWndStatus, SB_SETTEXTA, SBT_OWNERDRAW, (LPARAM)statustext); ok( r == TRUE, "Sendmessage returned %d, expected 1\n", r); ok( 1 == g_wmdrawitm_ctr, "got %d drawitem messages expected 1\n", g_wmdrawitm_ctr); /* and again */ g_wmdrawitm_ctr = 0; - r = SendMessage(hWndStatus, SB_SETTEXT, SBT_OWNERDRAW, (LPARAM)statustext); + r = SendMessageA(hWndStatus, SB_SETTEXTA, SBT_OWNERDRAW, (LPARAM)statustext); ok( r == TRUE, "Sendmessage returned %d, expected 1\n", r); ok( 1 == g_wmdrawitm_ctr, "got %d drawitem messages expected 1\n", g_wmdrawitm_ctr); /* clean up */ DestroyWindow(hWndStatus); - SetWindowLong( g_hMainWnd, GWL_STYLE, oldstyle); - SetWindowLongPtr( g_hMainWnd, GWLP_WNDPROC, (LONG_PTR)g_wndproc_saved ); + SetWindowLongA( g_hMainWnd, GWL_STYLE, oldstyle); + SetWindowLongPtrA( g_hMainWnd, GWLP_WNDPROC, (LONG_PTR)g_wndproc_saved ); } static void test_gettext(void) { - HWND hwndStatus = CreateWindow(SUBCLASS_NAME, NULL, WS_CHILD|WS_VISIBLE, + HWND hwndStatus = CreateWindowA(SUBCLASS_NAME, NULL, WS_CHILD|WS_VISIBLE, 0, 0, 300, 20, g_hMainWnd, NULL, NULL, NULL); char buf[5]; int r; - r = SendMessage(hwndStatus, SB_SETTEXT, 0, (LPARAM)"Text"); + r = SendMessageA(hwndStatus, SB_SETTEXTA, 0, (LPARAM)"Text"); expect(TRUE, r); - r = SendMessage(hwndStatus, WM_GETTEXTLENGTH, 0, 0); + r = SendMessageA(hwndStatus, WM_GETTEXTLENGTH, 0, 0); expect(4, r); /* A size of 0 returns the length of the text */ - r = SendMessage(hwndStatus, WM_GETTEXT, 0, 0); + r = SendMessageA(hwndStatus, WM_GETTEXT, 0, 0); ok( r == 4 || broken(r == 2) /* win8 */, "Expected 4 got %d\n", r ); /* A size of 1 only stores the NULL terminator */ buf[0] = 0xa; - r = SendMessage(hwndStatus, WM_GETTEXT, 1, (LPARAM)buf); + r = SendMessageA(hwndStatus, WM_GETTEXT, 1, (LPARAM)buf); ok( r == 0 || broken(r == 4), "Expected 0 got %d\n", r ); if (!r) ok(!buf[0], "expected empty buffer\n"); /* A size of 2 returns a length 1 */ - r = SendMessage(hwndStatus, WM_GETTEXT, 2, (LPARAM)buf); + r = SendMessageA(hwndStatus, WM_GETTEXT, 2, (LPARAM)buf); ok( r == 1 || broken(r == 4), "Expected 1 got %d\n", r ); - r = SendMessage(hwndStatus, WM_GETTEXT, sizeof(buf), (LPARAM)buf); + r = SendMessageA(hwndStatus, WM_GETTEXT, sizeof(buf), (LPARAM)buf); expect(4, r); ok(!strcmp(buf, "Text"), "expected Text, got %s\n", buf); DestroyWindow(hwndStatus); @@ -559,30 +558,30 @@ static void test_notify(void) ok(atom, "RegisterClass failed\n"); /* create parent */ - hwndParent = CreateWindow(wclass.lpszClassName, "parent", WS_OVERLAPPEDWINDOW, + hwndParent = CreateWindowA(wclass.lpszClassName, "parent", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, 300, 20, NULL, NULL, NULL, NULL); ok(hwndParent != NULL, "Parent creation failed!\n"); /* create status bar */ - hwndStatus = CreateWindow(STATUSCLASSNAME, NULL, WS_VISIBLE | WS_CHILD, + hwndStatus = CreateWindowA(STATUSCLASSNAMEA, NULL, WS_VISIBLE | WS_CHILD, 0, 0, 300, 20, hwndParent, NULL, NULL, NULL); ok(hwndStatus != NULL, "Status creation failed!\n"); /* Send various mouse event, and check that we get them */ g_got_dblclk = FALSE; - SendMessage(hwndStatus, WM_LBUTTONDBLCLK, 0, 0); + SendMessageA(hwndStatus, WM_LBUTTONDBLCLK, 0, 0); ok(g_got_dblclk, "WM_LBUTTONDBLCLK was not processed correctly!\n"); g_got_rdblclk = FALSE; - SendMessage(hwndStatus, WM_RBUTTONDBLCLK, 0, 0); + SendMessageA(hwndStatus, WM_RBUTTONDBLCLK, 0, 0); ok(g_got_rdblclk, "WM_RBUTTONDBLCLK was not processed correctly!\n"); g_got_click = FALSE; - SendMessage(hwndStatus, WM_LBUTTONUP, 0, 0); + SendMessageA(hwndStatus, WM_LBUTTONUP, 0, 0); ok(g_got_click, "WM_LBUTTONUP was not processed correctly!\n"); /* For R-UP, check that we also get the context menu from the default processing */ g_got_contextmenu = FALSE; g_got_rclick = FALSE; - SendMessage(hwndStatus, WM_RBUTTONUP, 0, 0); + SendMessageA(hwndStatus, WM_RBUTTONUP, 0, 0); ok(g_got_rclick, "WM_RBUTTONUP was not processed correctly!\n"); ok(g_got_contextmenu, "WM_RBUTTONUP did not activate the context menu!\n"); } diff --git a/rostests/winetests/comctl32/subclass.c b/rostests/winetests/comctl32/subclass.c index 8511275c8f9..720c68e28d5 100644 --- a/rostests/winetests/comctl32/subclass.c +++ b/rostests/winetests/comctl32/subclass.c @@ -166,7 +166,7 @@ static void ok_sequence(const struct message *expected, const char *context) flush_sequence(); } -static LRESULT WINAPI WndProc1(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +static LRESULT WINAPI wnd_proc_1(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { struct message msg; @@ -175,12 +175,12 @@ static LRESULT WINAPI WndProc1(HWND hwnd, UINT message, WPARAM wParam, LPARAM lP msg.procnum = 1; add_message(&msg); } - return DefWindowProc(hwnd, message, wParam, lParam); + return DefWindowProcA(hwnd, message, wParam, lParam); } -static WNDPROC origProc3; -static LRESULT WINAPI WndProc3(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +static WNDPROC orig_proc_3; +static LRESULT WINAPI wnd_proc_3(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { struct message msg; @@ -189,10 +189,10 @@ static LRESULT WINAPI WndProc3(HWND hwnd, UINT message, WPARAM wParam, LPARAM lP msg.procnum = 3; add_message(&msg); } - return CallWindowProc(origProc3, hwnd, message, wParam, lParam); + return CallWindowProcA(orig_proc_3, hwnd, message, wParam, lParam); } -static LRESULT WINAPI WndProcSub(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, UINT_PTR uldSubclass, DWORD_PTR dwRefData) +static LRESULT WINAPI wnd_proc_sub(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, UINT_PTR uldSubclass, DWORD_PTR dwRefData) { struct message msg; @@ -203,13 +203,13 @@ static LRESULT WINAPI WndProcSub(HWND hwnd, UINT message, WPARAM wParam, LPARAM if(lParam) { if(dwRefData & DELETE_SELF) { - pRemoveWindowSubclass(hwnd, WndProcSub, uldSubclass); - pRemoveWindowSubclass(hwnd, WndProcSub, uldSubclass); + pRemoveWindowSubclass(hwnd, wnd_proc_sub, uldSubclass); + pRemoveWindowSubclass(hwnd, wnd_proc_sub, uldSubclass); } if(dwRefData & DELETE_PREV) - pRemoveWindowSubclass(hwnd, WndProcSub, uldSubclass-1); + pRemoveWindowSubclass(hwnd, wnd_proc_sub, uldSubclass-1); if(dwRefData & SEND_NEST) - SendMessage(hwnd, WM_USER, wParam+1, 0); + SendMessageA(hwnd, WM_USER, wParam+1, 0); } } return pDefSubclassProc(hwnd, message, wParam, lParam); @@ -219,53 +219,54 @@ static void test_subclass(void) { HWND hwnd = CreateWindowExA(0, "TestSubclass", "Test subclass", WS_OVERLAPPEDWINDOW, 100, 100, 200, 200, 0, 0, 0, NULL); - assert(hwnd); + ok(hwnd != NULL, "failed to create test subclass wnd\n"); - pSetWindowSubclass(hwnd, WndProcSub, 2, 0); - SendMessage(hwnd, WM_USER, 1, 0); - SendMessage(hwnd, WM_USER, 2, 0); + pSetWindowSubclass(hwnd, wnd_proc_sub, 2, 0); + SendMessageA(hwnd, WM_USER, 1, 0); + SendMessageA(hwnd, WM_USER, 2, 0); ok_sequence(Sub_BasicTest, "Basic"); - pSetWindowSubclass(hwnd, WndProcSub, 2, DELETE_SELF); - SendMessage(hwnd, WM_USER, 1, 1); + pSetWindowSubclass(hwnd, wnd_proc_sub, 2, DELETE_SELF); + SendMessageA(hwnd, WM_USER, 1, 1); ok_sequence(Sub_DeletedTest, "Deleted"); - SendMessage(hwnd, WM_USER, 1, 0); + SendMessageA(hwnd, WM_USER, 1, 0); ok_sequence(Sub_AfterDeletedTest, "After Deleted"); - pSetWindowSubclass(hwnd, WndProcSub, 2, 0); - origProc3 = (WNDPROC)SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)WndProc3); - SendMessage(hwnd, WM_USER, 1, 0); - SendMessage(hwnd, WM_USER, 2, 0); + pSetWindowSubclass(hwnd, wnd_proc_sub, 2, 0); + orig_proc_3 = (WNDPROC)SetWindowLongPtrA(hwnd, GWLP_WNDPROC, (LONG_PTR)wnd_proc_3); + SendMessageA(hwnd, WM_USER, 1, 0); + SendMessageA(hwnd, WM_USER, 2, 0); ok_sequence(Sub_OldAfterNewTest, "Old after New"); - pSetWindowSubclass(hwnd, WndProcSub, 4, 0); - SendMessage(hwnd, WM_USER, 1, 0); + pSetWindowSubclass(hwnd, wnd_proc_sub, 4, 0); + SendMessageA(hwnd, WM_USER, 1, 0); ok_sequence(Sub_MixTest, "Mix"); /* Now the fun starts */ - pSetWindowSubclass(hwnd, WndProcSub, 4, SEND_NEST); - SendMessage(hwnd, WM_USER, 1, 1); + pSetWindowSubclass(hwnd, wnd_proc_sub, 4, SEND_NEST); + SendMessageA(hwnd, WM_USER, 1, 1); ok_sequence(Sub_MixAndNestTest, "Mix and nest"); - pSetWindowSubclass(hwnd, WndProcSub, 4, SEND_NEST | DELETE_SELF); - SendMessage(hwnd, WM_USER, 1, 1); + pSetWindowSubclass(hwnd, wnd_proc_sub, 4, SEND_NEST | DELETE_SELF); + SendMessageA(hwnd, WM_USER, 1, 1); ok_sequence(Sub_MixNestDelTest, "Mix, nest, del"); - pSetWindowSubclass(hwnd, WndProcSub, 4, 0); - pSetWindowSubclass(hwnd, WndProcSub, 5, DELETE_PREV); - SendMessage(hwnd, WM_USER, 1, 1); + pSetWindowSubclass(hwnd, wnd_proc_sub, 4, 0); + pSetWindowSubclass(hwnd, wnd_proc_sub, 5, DELETE_PREV); + SendMessageA(hwnd, WM_USER, 1, 1); ok_sequence(Sub_MixDelPrevTest, "Mix and del prev"); DestroyWindow(hwnd); } -static BOOL RegisterWindowClasses(void) +static BOOL register_window_classes(void) { WNDCLASSA cls; + ATOM atom; cls.style = 0; - cls.lpfnWndProc = WndProc1; + cls.lpfnWndProc = wnd_proc_1; cls.cbClsExtra = 0; cls.cbWndExtra = 0; cls.hInstance = GetModuleHandleA(0); @@ -274,18 +275,19 @@ static BOOL RegisterWindowClasses(void) cls.hbrBackground = NULL; cls.lpszMenuName = NULL; cls.lpszClassName = "TestSubclass"; - if(!RegisterClassA(&cls)) return FALSE; - - return TRUE; + atom = RegisterClassA(&cls); + ok(atom, "failed to register test class\n"); + + return atom != 0; } -static int init_function_pointers(void) +static BOOL init_function_pointers(void) { HMODULE hmod; void *ptr; hmod = GetModuleHandleA("comctl32.dll"); - assert(hmod); + ok(hmod != NULL, "got %p\n", hmod); /* Functions have to be loaded by ordinal. Only XP and W2K3 export * them by name. @@ -299,7 +301,7 @@ static int init_function_pointers(void) if(!pSetWindowSubclass || !pRemoveWindowSubclass || !pDefSubclassProc) { win_skip("SetWindowSubclass and friends are not available\n"); - return 0; + return FALSE; } /* test named exports */ @@ -316,14 +318,14 @@ static int init_function_pointers(void) #undef TESTNAMED } - return 1; + return TRUE; } START_TEST(subclass) { if(!init_function_pointers()) return; - if(!RegisterWindowClasses()) assert(0); + if(!register_window_classes()) return; test_subclass(); } diff --git a/rostests/winetests/comctl32/syslink.c b/rostests/winetests/comctl32/syslink.c index 039577f2048..0516a1d2582 100644 --- a/rostests/winetests/comctl32/syslink.c +++ b/rostests/winetests/comctl32/syslink.c @@ -73,7 +73,7 @@ static void flush_events(void) while (diff > 0) { if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min_timeout, QS_ALLINPUT ) == WAIT_TIMEOUT) break; - while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg ); + while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); diff = time - GetTickCount(); } } @@ -248,8 +248,8 @@ START_TEST(syslink) /* Make the SysLink control visible */ flush_sequences(sequences, NUM_MSG_SEQUENCE); - oldstyle = GetWindowLong(hWndSysLink, GWL_STYLE); - SetWindowLong(hWndSysLink, GWL_STYLE, oldstyle | WS_VISIBLE); + oldstyle = GetWindowLongA(hWndSysLink, GWL_STYLE); + SetWindowLongA(hWndSysLink, GWL_STYLE, oldstyle | WS_VISIBLE); RedrawWindow(hWndSysLink, NULL, NULL, RDW_INVALIDATE); flush_events(); ok_sequence(sequences, SYSLINK_SEQ_INDEX, visible_syslink_wnd_seq, "visible SysLink", TRUE); diff --git a/rostests/winetests/comctl32/tab.c b/rostests/winetests/comctl32/tab.c index adebcfdea46..eb36579fdb5 100644 --- a/rostests/winetests/comctl32/tab.c +++ b/rostests/winetests/comctl32/tab.c @@ -48,7 +48,7 @@ static void CheckSize(HWND hwnd, INT width, INT height, const char *msg, int lin { RECT r; - SendMessage(hwnd, TCM_GETITEMRECT, 0, (LPARAM)&r); + SendMessageA(hwnd, TCM_GETITEMRECT, 0, (LPARAM)&r); if (width >= 0 && height < 0) ok_(__FILE__,line) (width == r.right - r.left, "%s: Expected width [%d] got [%d]\n", msg, width, r.right - r.left); @@ -66,8 +66,8 @@ static void CheckSize(HWND hwnd, INT width, INT height, const char *msg, int lin static void TabCheckSetSize(HWND hwnd, INT set_width, INT set_height, INT exp_width, INT exp_height, const char *msg, int line) { - SendMessage(hwnd, TCM_SETITEMSIZE, 0, - (LPARAM) MAKELPARAM((set_width >= 0) ? set_width : 0, (set_height >= 0) ? set_height : 0)); + SendMessageA(hwnd, TCM_SETITEMSIZE, 0, + MAKELPARAM((set_width >= 0) ? set_width : 0, (set_height >= 0) ? set_height : 0)); if (winetest_interactive) RedrawWindow (hwnd, NULL, 0, RDW_UPDATENOW); CheckSize(hwnd, exp_width, exp_height, msg, line); } @@ -252,13 +252,13 @@ static const struct message getset_tooltip_parent_seq[] = { static const struct message insert_focus_seq[] = { { TCM_GETITEMCOUNT, sent|wparam|lparam, 0, 0 }, { TCM_GETCURFOCUS, sent|wparam|lparam, 0, 0 }, - { TCM_INSERTITEM, sent|wparam, 1 }, + { TCM_INSERTITEMA, sent|wparam, 1 }, { WM_NOTIFYFORMAT, sent|defwinproc|optional }, { WM_QUERYUISTATE, sent|defwinproc|optional }, { WM_PARENTNOTIFY, sent|defwinproc|optional }, { TCM_GETITEMCOUNT, sent|wparam|lparam, 0, 0 }, { TCM_GETCURFOCUS, sent|wparam|lparam, 0, 0 }, - { TCM_INSERTITEM, sent|wparam, 2 }, + { TCM_INSERTITEMA, sent|wparam, 2 }, { WM_NOTIFYFORMAT, sent|defwinproc|optional }, { WM_QUERYUISTATE, sent|defwinproc|optional, }, { WM_PARENTNOTIFY, sent|defwinproc|optional }, @@ -266,7 +266,7 @@ static const struct message insert_focus_seq[] = { { TCM_GETCURFOCUS, sent|wparam|lparam, 0, 0 }, { TCM_SETCURFOCUS, sent|wparam|lparam, -1, 0 }, { TCM_GETCURFOCUS, sent|wparam|lparam, 0, 0 }, - { TCM_INSERTITEM, sent|wparam, 3 }, + { TCM_INSERTITEMA, sent|wparam, 3 }, { TCM_GETCURFOCUS, sent|wparam|lparam, 0, 0 }, { 0 } }; @@ -295,33 +295,29 @@ static HWND create_tabcontrol (DWORD style, DWORD mask) { HWND handle; - TCITEM tcNewTab; + TCITEMA tcNewTab; static char text1[] = "Tab 1", text2[] = "Wide Tab 2", text3[] = "T 3"; - handle = CreateWindow ( - WC_TABCONTROLA, - "TestTab", - WS_CLIPSIBLINGS | WS_CLIPCHILDREN | TCS_FOCUSNEVER | style, - 10, 10, 300, 100, - NULL, NULL, NULL, 0); + handle = CreateWindowA(WC_TABCONTROLA, "TestTab", + WS_CLIPSIBLINGS | WS_CLIPCHILDREN | TCS_FOCUSNEVER | style, 10, 10, 300, 100, NULL, + NULL, NULL, 0); + ok(handle != NULL, "failed to create tab wnd\n"); - assert (handle); - - SetWindowLong(handle, GWL_STYLE, WS_CLIPSIBLINGS | WS_CLIPCHILDREN | TCS_FOCUSNEVER | style); - SendMessage (handle, WM_SETFONT, 0, (LPARAM) hFont); + SetWindowLongA(handle, GWL_STYLE, WS_CLIPSIBLINGS | WS_CLIPCHILDREN | TCS_FOCUSNEVER | style); + SendMessageA(handle, WM_SETFONT, 0, (LPARAM)hFont); tcNewTab.mask = mask; tcNewTab.pszText = text1; tcNewTab.iImage = 0; - SendMessage (handle, TCM_INSERTITEM, 0, (LPARAM) &tcNewTab); + SendMessageA(handle, TCM_INSERTITEMA, 0, (LPARAM)&tcNewTab); tcNewTab.pszText = text2; tcNewTab.iImage = 1; - SendMessage (handle, TCM_INSERTITEM, 1, (LPARAM) &tcNewTab); + SendMessageA(handle, TCM_INSERTITEMA, 1, (LPARAM)&tcNewTab); tcNewTab.pszText = text3; tcNewTab.iImage = 2; - SendMessage (handle, TCM_INSERTITEM, 2, (LPARAM) &tcNewTab); + SendMessageA(handle, TCM_INSERTITEMA, 2, (LPARAM)&tcNewTab); if (winetest_interactive) { @@ -380,7 +376,7 @@ static BOOL registerParentWindowClass(void) cls.cbWndExtra = 0; cls.hInstance = GetModuleHandleA(NULL); cls.hIcon = 0; - cls.hCursor = LoadCursorA(0, IDC_ARROW); + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); cls.hbrBackground = GetStockObject(WHITE_BRUSH); cls.lpszMenuName = NULL; cls.lpszClassName = "Tab test parent class"; @@ -392,12 +388,9 @@ static HWND createParentWindow(void) if (!registerParentWindowClass()) return NULL; - return CreateWindowEx(0, "Tab test parent class", - "Tab test parent window", - WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | - WS_MAXIMIZEBOX | WS_VISIBLE, - 0, 0, 100, 100, - GetDesktopWindow(), NULL, GetModuleHandleA(NULL), NULL); + return CreateWindowExA(0, "Tab test parent class", "Tab test parent window", + WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_VISIBLE, 0, 0, 100, 100, + GetDesktopWindow(), NULL, GetModuleHandleA(NULL), NULL); } static LRESULT WINAPI tabSubclassProcess(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) @@ -437,21 +430,17 @@ static LRESULT WINAPI tabSubclassProcess(HWND hwnd, UINT message, WPARAM wParam, static HWND createFilledTabControl(HWND parent_wnd, DWORD style, DWORD mask, INT nTabs) { HWND tabHandle; - TCITEM tcNewTab; + TCITEMA tcNewTab; WNDPROC oldproc; RECT rect; INT i; GetClientRect(parent_wnd, &rect); - tabHandle = CreateWindow ( - WC_TABCONTROLA, - "TestTab", - WS_CLIPSIBLINGS | WS_CLIPCHILDREN | TCS_FOCUSNEVER | style, - 0, 0, rect.right, rect.bottom, - parent_wnd, NULL, NULL, 0); - - assert(tabHandle); + tabHandle = CreateWindowA(WC_TABCONTROLA, "TestTab", + WS_CLIPSIBLINGS | WS_CLIPCHILDREN | TCS_FOCUSNEVER | style, 0, 0, rect.right, + rect.bottom, parent_wnd, NULL, NULL, 0); + ok(tabHandle != NULL, "failed to create tab wnd\n"); oldproc = (WNDPROC)SetWindowLongPtrA(tabHandle, GWLP_WNDPROC, (LONG_PTR)tabSubclassProcess); SetWindowLongPtrA(tabHandle, GWLP_USERDATA, (LONG_PTR)oldproc); @@ -465,7 +454,7 @@ static HWND createFilledTabControl(HWND parent_wnd, DWORD style, DWORD mask, INT sprintf(tabName, "Tab %d", i+1); tcNewTab.pszText = tabName; tcNewTab.iImage = i; - SendMessage (tabHandle, TCM_INSERTITEM, i, (LPARAM) &tcNewTab); + SendMessageA(tabHandle, TCM_INSERTITEMA, i, (LPARAM)&tcNewTab); } if (winetest_interactive) @@ -482,18 +471,14 @@ static HWND create_tooltip (HWND hTab, char toolTipText[]) { HWND hwndTT; - TOOLINFO ti; - LPTSTR lptstr = toolTipText; + TTTOOLINFOA ti; + LPSTR lptstr = toolTipText; RECT rect; /* Creating a tooltip window*/ - hwndTT = CreateWindowEx( - WS_EX_TOPMOST, - TOOLTIPS_CLASS, - NULL, - WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP, - CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - hTab, NULL, 0, NULL); + hwndTT = CreateWindowExA(WS_EX_TOPMOST, TOOLTIPS_CLASSA, NULL, + WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, + CW_USEDEFAULT, hTab, NULL, 0, NULL); SetWindowPos( hwndTT, @@ -504,7 +489,7 @@ static HWND create_tooltip (HWND hTab, char toolTipText[]) GetClientRect (hTab, &rect); /* Initialize members of toolinfo*/ - ti.cbSize = sizeof(TOOLINFO); + ti.cbSize = sizeof(TTTOOLINFOA); ti.uFlags = TTF_SUBCLASS; ti.hwnd = hTab; ti.hinst = 0; @@ -514,7 +499,7 @@ static HWND create_tooltip (HWND hTab, char toolTipText[]) ti.rect = rect; /* Add toolinfo structure to the tooltip control */ - SendMessage(hwndTT, TTM_ADDTOOL, 0, (LPARAM) &ti); + SendMessageA(hwndTT, TTM_ADDTOOLA, 0, (LPARAM)&ti); return hwndTT; } @@ -530,14 +515,14 @@ static void test_tab(INT nMinTabWidth) INT i, dpi, exp; hwTab = create_tabcontrol(TCS_FIXEDWIDTH, TCIF_TEXT|TCIF_IMAGE); - SendMessage(hwTab, TCM_SETMINTABWIDTH, 0, nMinTabWidth); + SendMessageA(hwTab, TCM_SETMINTABWIDTH, 0, nMinTabWidth); /* Get System default MinTabWidth */ if (nMinTabWidth < 0) - nMinTabWidth = SendMessage(hwTab, TCM_SETMINTABWIDTH, 0, nMinTabWidth); + nMinTabWidth = SendMessageA(hwTab, TCM_SETMINTABWIDTH, 0, nMinTabWidth); hdc = GetDC(hwTab); dpi = GetDeviceCaps(hdc, LOGPIXELSX); - hOldFont = SelectObject(hdc, (HFONT)SendMessage(hwTab, WM_GETFONT, 0, 0)); + hOldFont = SelectObject(hdc, (HFONT)SendMessageA(hwTab, WM_GETFONT, 0, 0)); GetTextExtentPoint32A(hdc, "Tab 1", strlen("Tab 1"), &size); trace("Tab1 text size: size.cx=%d size.cy=%d\n", size.cx, size.cy); SelectObject(hdc, hOldFont); @@ -548,7 +533,7 @@ static void test_tab(INT nMinTabWidth) TABCHECKSETSIZE(hwTab, 50, 20, 50, 20, "set size"); TABCHECKSETSIZE(hwTab, 0, 1, 0, 1, "min size"); - SendMessage(hwTab, TCM_SETIMAGELIST, 0, (LPARAM)himl); + SendMessageA(hwTab, TCM_SETIMAGELIST, 0, (LPARAM)himl); trace (" TCS_FIXEDWIDTH tabs with icon...\n"); TABCHECKSETSIZE(hwTab, 50, 30, 50, 30, "set size > icon"); @@ -558,7 +543,7 @@ static void test_tab(INT nMinTabWidth) DestroyWindow (hwTab); hwTab = create_tabcontrol(TCS_FIXEDWIDTH | TCS_BUTTONS, TCIF_TEXT|TCIF_IMAGE); - SendMessage(hwTab, TCM_SETMINTABWIDTH, 0, nMinTabWidth); + SendMessageA(hwTab, TCM_SETMINTABWIDTH, 0, nMinTabWidth); hdc = GetDC(hwTab); dpi = GetDeviceCaps(hdc, LOGPIXELSX); @@ -569,19 +554,19 @@ static void test_tab(INT nMinTabWidth) TABCHECKSETSIZE(hwTab, 10, 50, 10, 50, "set size 2"); TABCHECKSETSIZE(hwTab, 0, 1, 0, 1, "min size"); - SendMessage(hwTab, TCM_SETIMAGELIST, 0, (LPARAM)himl); + SendMessageA(hwTab, TCM_SETIMAGELIST, 0, (LPARAM)himl); trace (" TCS_FIXEDWIDTH buttons with icon...\n"); TABCHECKSETSIZE(hwTab, 50, 30, 50, 30, "set size > icon"); TABCHECKSETSIZE(hwTab, 20, 20, 25, 20, "set size < icon"); TABCHECKSETSIZE(hwTab, 0, 1, 25, 1, "min size"); - SendMessage(hwTab, TCM_SETPADDING, 0, MAKELPARAM(4,4)); + SendMessageA(hwTab, TCM_SETPADDING, 0, MAKELPARAM(4, 4)); TABCHECKSETSIZE(hwTab, 0, 1, 25, 1, "set padding, min size"); DestroyWindow (hwTab); hwTab = create_tabcontrol(TCS_FIXEDWIDTH | TCS_BOTTOM, TCIF_TEXT|TCIF_IMAGE); - SendMessage(hwTab, TCM_SETMINTABWIDTH, 0, nMinTabWidth); + SendMessageA(hwTab, TCM_SETMINTABWIDTH, 0, nMinTabWidth); hdc = GetDC(hwTab); dpi = GetDeviceCaps(hdc, LOGPIXELSX); @@ -593,22 +578,22 @@ static void test_tab(INT nMinTabWidth) TABCHECKSETSIZE(hwTab, 10, 50, 10, 50, "no icon, set size 2"); TABCHECKSETSIZE(hwTab, 0, 1, 0, 1, "no icon, min size"); - SendMessage(hwTab, TCM_SETIMAGELIST, 0, (LPARAM)himl); + SendMessageA(hwTab, TCM_SETIMAGELIST, 0, (LPARAM)himl); TABCHECKSETSIZE(hwTab, 50, 30, 50, 30, "with icon, set size > icon"); TABCHECKSETSIZE(hwTab, 20, 20, 25, 20, "with icon, set size < icon"); TABCHECKSETSIZE(hwTab, 0, 1, 25, 1, "with icon, min size"); - SendMessage(hwTab, TCM_SETPADDING, 0, MAKELPARAM(4,4)); + SendMessageA(hwTab, TCM_SETPADDING, 0, MAKELPARAM(4, 4)); TABCHECKSETSIZE(hwTab, 0, 1, 25, 1, "set padding, min size"); DestroyWindow (hwTab); hwTab = create_tabcontrol(0, TCIF_TEXT|TCIF_IMAGE); - SendMessage(hwTab, TCM_SETMINTABWIDTH, 0, nMinTabWidth); + SendMessageA(hwTab, TCM_SETMINTABWIDTH, 0, nMinTabWidth); trace (" non fixed width, with text...\n"); exp = max(size.cx +TAB_PADDING_X*2, (nMinTabWidth < 0) ? DEFAULT_MIN_TAB_WIDTH : nMinTabWidth); - SendMessage( hwTab, TCM_GETITEMRECT, 0, (LPARAM)&rTab ); + SendMessageA( hwTab, TCM_GETITEMRECT, 0, (LPARAM)&rTab ); ok( rTab.right - rTab.left == exp || broken(rTab.right - rTab.left == DEFAULT_MIN_TAB_WIDTH), "no icon, default width: Expected width [%d] got [%d]\n", exp, rTab.right - rTab.left ); @@ -616,13 +601,13 @@ static void test_tab(INT nMinTabWidth) { INT nTabWidth = (nMinTabWidth < 0) ? TabWidthPadded(i, 2) : nMinTabWidth; - SendMessage(hwTab, TCM_SETIMAGELIST, 0, 0); - SendMessage(hwTab, TCM_SETPADDING, 0, MAKELPARAM(i,i)); + SendMessageA(hwTab, TCM_SETIMAGELIST, 0, 0); + SendMessageA(hwTab, TCM_SETPADDING, 0, MAKELPARAM(i, i)); TABCHECKSETSIZE(hwTab, 50, 20, max(size.cx + i*2, nTabWidth), 20, "no icon, set size"); TABCHECKSETSIZE(hwTab, 0, 1, max(size.cx + i*2, nTabWidth), 1, "no icon, min size"); - SendMessage(hwTab, TCM_SETIMAGELIST, 0, (LPARAM)himl); + SendMessageA(hwTab, TCM_SETIMAGELIST, 0, (LPARAM)himl); nTabWidth = (nMinTabWidth < 0) ? TabWidthPadded(i, 3) : nMinTabWidth; TABCHECKSETSIZE(hwTab, 50, 30, max(size.cx + 21 + i*3, nTabWidth), 30, "with icon, set size > icon"); @@ -632,11 +617,11 @@ static void test_tab(INT nMinTabWidth) DestroyWindow (hwTab); hwTab = create_tabcontrol(0, TCIF_IMAGE); - SendMessage(hwTab, TCM_SETMINTABWIDTH, 0, nMinTabWidth); + SendMessageA(hwTab, TCM_SETMINTABWIDTH, 0, nMinTabWidth); trace (" non fixed width, no text...\n"); exp = (nMinTabWidth < 0) ? DEFAULT_MIN_TAB_WIDTH : nMinTabWidth; - SendMessage( hwTab, TCM_GETITEMRECT, 0, (LPARAM)&rTab ); + SendMessageA( hwTab, TCM_GETITEMRECT, 0, (LPARAM)&rTab ); ok( rTab.right - rTab.left == exp || broken(rTab.right - rTab.left == DEFAULT_MIN_TAB_WIDTH), "no icon, default width: Expected width [%d] got [%d]\n", exp, rTab.right - rTab.left ); @@ -644,13 +629,13 @@ static void test_tab(INT nMinTabWidth) { INT nTabWidth = (nMinTabWidth < 0) ? TabWidthPadded(i, 2) : nMinTabWidth; - SendMessage(hwTab, TCM_SETIMAGELIST, 0, 0); - SendMessage(hwTab, TCM_SETPADDING, 0, MAKELPARAM(i,i)); + SendMessageA(hwTab, TCM_SETIMAGELIST, 0, 0); + SendMessageA(hwTab, TCM_SETPADDING, 0, MAKELPARAM(i, i)); TABCHECKSETSIZE(hwTab, 50, 20, nTabWidth, 20, "no icon, set size"); TABCHECKSETSIZE(hwTab, 0, 1, nTabWidth, 1, "no icon, min size"); - SendMessage(hwTab, TCM_SETIMAGELIST, 0, (LPARAM)himl); + SendMessageA(hwTab, TCM_SETIMAGELIST, 0, (LPARAM)himl); if (i > 1 && nMinTabWidth > 0 && nMinTabWidth < DEFAULT_MIN_TAB_WIDTH) nTabWidth += EXTRA_ICON_PADDING *(i-1); @@ -690,21 +675,21 @@ static void test_curfocus(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); /* Testing CurFocus with largest appropriate value */ - SendMessage(hTab, TCM_SETCURFOCUS, nTabs-1, 0); - focusIndex = SendMessage(hTab, TCM_GETCURFOCUS, 0, 0); + SendMessageA(hTab, TCM_SETCURFOCUS, nTabs - 1, 0); + focusIndex = SendMessageA(hTab, TCM_GETCURFOCUS, 0, 0); expect(nTabs-1, focusIndex); /* Testing CurFocus with negative value */ - SendMessage(hTab, TCM_SETCURFOCUS, -10, 0); - focusIndex = SendMessage(hTab, TCM_GETCURFOCUS, 0, 0); + SendMessageA(hTab, TCM_SETCURFOCUS, -10, 0); + focusIndex = SendMessageA(hTab, TCM_GETCURFOCUS, 0, 0); expect(-1, focusIndex); /* Testing CurFocus with value larger than number of tabs */ - focusIndex = SendMessage(hTab, TCM_SETCURSEL, 1, 0); + focusIndex = SendMessageA(hTab, TCM_SETCURSEL, 1, 0); expect(-1, focusIndex); - SendMessage(hTab, TCM_SETCURFOCUS, nTabs+1, 0); - focusIndex = SendMessage(hTab, TCM_GETCURFOCUS, 0, 0); + SendMessageA(hTab, TCM_SETCURFOCUS, nTabs + 1, 0); + focusIndex = SendMessageA(hTab, TCM_GETCURFOCUS, 0, 0); expect(1, focusIndex); ok_sequence(sequences, TAB_SEQ_INDEX, getset_cur_focus_seq, "Getset curFoc test sequence", FALSE); @@ -717,7 +702,7 @@ static void test_cursel(void) const INT nTabs = 5; INT selectionIndex; INT focusIndex; - TCITEM tcItem; + TCITEMA tcItem; HWND hTab; hTab = createFilledTabControl(parent_wnd, TCS_FIXEDWIDTH, TCIF_TEXT|TCIF_IMAGE, nTabs); @@ -726,27 +711,27 @@ static void test_cursel(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); /* Testing CurSel with largest appropriate value */ - selectionIndex = SendMessage(hTab, TCM_SETCURSEL, nTabs-1, 0); + selectionIndex = SendMessageA(hTab, TCM_SETCURSEL, nTabs - 1, 0); expect(0, selectionIndex); - selectionIndex = SendMessage(hTab, TCM_GETCURSEL, 0, 0); + selectionIndex = SendMessageA(hTab, TCM_GETCURSEL, 0, 0); expect(nTabs-1, selectionIndex); /* Focus should switch with selection */ - focusIndex = SendMessage(hTab, TCM_GETCURFOCUS, 0, 0); + focusIndex = SendMessageA(hTab, TCM_GETCURFOCUS, 0, 0); expect(nTabs-1, focusIndex); /* Testing CurSel with negative value */ - SendMessage(hTab, TCM_SETCURSEL, -10, 0); - selectionIndex = SendMessage(hTab, TCM_GETCURSEL, 0, 0); + SendMessageA(hTab, TCM_SETCURSEL, -10, 0); + selectionIndex = SendMessageA(hTab, TCM_GETCURSEL, 0, 0); expect(-1, selectionIndex); /* Testing CurSel with value larger than number of tabs */ - selectionIndex = SendMessage(hTab, TCM_SETCURSEL, 1, 0); + selectionIndex = SendMessageA(hTab, TCM_SETCURSEL, 1, 0); expect(-1, selectionIndex); - selectionIndex = SendMessage(hTab, TCM_SETCURSEL, nTabs+1, 0); + selectionIndex = SendMessageA(hTab, TCM_SETCURSEL, nTabs + 1, 0); expect(-1, selectionIndex); - selectionIndex = SendMessage(hTab, TCM_GETCURFOCUS, 0, 0); + selectionIndex = SendMessageA(hTab, TCM_GETCURFOCUS, 0, 0); expect(1, selectionIndex); ok_sequence(sequences, TAB_SEQ_INDEX, getset_cur_sel_seq, "Getset curSel test sequence", FALSE); @@ -754,14 +739,32 @@ static void test_cursel(void) /* selected item should have TCIS_BUTTONPRESSED state It doesn't depend on button state */ - memset(&tcItem, 0, sizeof(TCITEM)); + memset(&tcItem, 0, sizeof(TCITEMA)); tcItem.mask = TCIF_STATE; tcItem.dwStateMask = TCIS_BUTTONPRESSED; - selectionIndex = SendMessage(hTab, TCM_GETCURSEL, 0, 0); - SendMessage(hTab, TCM_GETITEM, selectionIndex, (LPARAM) &tcItem); + selectionIndex = SendMessageA(hTab, TCM_GETCURSEL, 0, 0); + SendMessageA(hTab, TCM_GETITEMA, selectionIndex, (LPARAM)&tcItem); ok (tcItem.dwState & TCIS_BUTTONPRESSED || broken(tcItem.dwState == 0), /* older comctl32 */ "Selected item should have TCIS_BUTTONPRESSED\n"); + /* now deselect all and check previously selected item state */ + focusIndex = SendMessageA(hTab, TCM_GETCURFOCUS, 0, 0); + ok(focusIndex == 1, "got %d\n", focusIndex); + + selectionIndex = SendMessageA(hTab, TCM_SETCURSEL, -1, 0); + ok(selectionIndex == 1, "got %d\n", selectionIndex); + + memset(&tcItem, 0, sizeof(TCITEMA)); + + /* focus is reset too */ + focusIndex = SendMessageA(hTab, TCM_GETCURFOCUS, 0, 0); + ok(focusIndex == -1, "got %d\n", focusIndex); + + tcItem.mask = TCIF_STATE; + tcItem.dwStateMask = TCIS_BUTTONPRESSED; + SendMessageA(hTab, TCM_GETITEMA, selectionIndex, (LPARAM)&tcItem); + ok(tcItem.dwState == 0, "got state %d\n", tcItem.dwState); + DestroyWindow(hTab); } @@ -778,18 +781,18 @@ static void test_extendedstyle(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); /* Testing Flat Separators */ - extendedStyle = SendMessage(hTab, TCM_GETEXTENDEDSTYLE, 0, 0); - prevExtendedStyle = SendMessage(hTab, TCM_SETEXTENDEDSTYLE, 0, TCS_EX_FLATSEPARATORS); + extendedStyle = SendMessageA(hTab, TCM_GETEXTENDEDSTYLE, 0, 0); + prevExtendedStyle = SendMessageA(hTab, TCM_SETEXTENDEDSTYLE, 0, TCS_EX_FLATSEPARATORS); expect(extendedStyle, prevExtendedStyle); - extendedStyle = SendMessage(hTab, TCM_GETEXTENDEDSTYLE, 0, 0); + extendedStyle = SendMessageA(hTab, TCM_GETEXTENDEDSTYLE, 0, 0); expect(TCS_EX_FLATSEPARATORS, extendedStyle); /* Testing Register Drop */ - prevExtendedStyle = SendMessage(hTab, TCM_SETEXTENDEDSTYLE, 0, TCS_EX_REGISTERDROP); + prevExtendedStyle = SendMessageA(hTab, TCM_SETEXTENDEDSTYLE, 0, TCS_EX_REGISTERDROP); expect(extendedStyle, prevExtendedStyle); - extendedStyle = SendMessage(hTab, TCM_GETEXTENDEDSTYLE, 0, 0); + extendedStyle = SendMessageA(hTab, TCM_GETEXTENDEDSTYLE, 0, 0); todo_wine{ expect(TCS_EX_REGISTERDROP, extendedStyle); } @@ -811,19 +814,19 @@ static void test_unicodeformat(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); - unicodeFormat = SendMessage(hTab, TCM_SETUNICODEFORMAT, TRUE, 0); + unicodeFormat = SendMessageA(hTab, TCM_SETUNICODEFORMAT, TRUE, 0); todo_wine{ expect(0, unicodeFormat); } - unicodeFormat = SendMessage(hTab, TCM_GETUNICODEFORMAT, 0, 0); + unicodeFormat = SendMessageA(hTab, TCM_GETUNICODEFORMAT, 0, 0); expect(1, unicodeFormat); - unicodeFormat = SendMessage(hTab, TCM_SETUNICODEFORMAT, FALSE, 0); + unicodeFormat = SendMessageA(hTab, TCM_SETUNICODEFORMAT, FALSE, 0); expect(1, unicodeFormat); - unicodeFormat = SendMessage(hTab, TCM_GETUNICODEFORMAT, 0, 0); + unicodeFormat = SendMessageA(hTab, TCM_GETUNICODEFORMAT, 0, 0); expect(0, unicodeFormat); - unicodeFormat = SendMessage(hTab, TCM_SETUNICODEFORMAT, TRUE, 0); + unicodeFormat = SendMessageA(hTab, TCM_SETUNICODEFORMAT, TRUE, 0); expect(0, unicodeFormat); ok_sequence(sequences, TAB_SEQ_INDEX, getset_unicode_format_seq, "Getset unicodeFormat test sequence", FALSE); @@ -836,7 +839,7 @@ static void test_getset_item(void) { char szText[32] = "New Label"; const INT nTabs = 5; - TCITEM tcItem; + TCITEMA tcItem; LPARAM lparam; DWORD ret; HWND hTab; @@ -864,7 +867,7 @@ static void test_getset_item(void) memset(&lparam, 0xaa, sizeof(lparam)); tcItem.lParam = lparam; tcItem.mask = TCIF_PARAM; - ret = SendMessage(hTab, TCM_GETITEM, 0, (LPARAM)&tcItem); + ret = SendMessageA(hTab, TCM_GETITEMA, 0, (LPARAM)&tcItem); expect(TRUE, ret); /* everything higher specified size is preserved */ memset(&lparam, 0xff, sizeof(lparam)-1); @@ -881,13 +884,13 @@ static void test_getset_item(void) /* valid range here is [0,4] */ memset(&tcItem, 0xcc, sizeof(tcItem)); tcItem.mask = TCIF_PARAM; - ret = SendMessage(hTab, TCM_GETITEM, 5, (LPARAM)&tcItem); + ret = SendMessageA(hTab, TCM_GETITEMA, 5, (LPARAM)&tcItem); expect(FALSE, ret); ok(tcItem.lParam == 0, "Expected zero lParam, got %lu\n", tcItem.lParam); memset(&tcItem, 0xcc, sizeof(tcItem)); tcItem.mask = TCIF_IMAGE; - ret = SendMessage(hTab, TCM_GETITEM, 5, (LPARAM)&tcItem); + ret = SendMessageA(hTab, TCM_GETITEMA, 5, (LPARAM)&tcItem); expect(FALSE, ret); expect(0, tcItem.iImage); @@ -895,7 +898,7 @@ static void test_getset_item(void) tcItem.mask = TCIF_TEXT; tcItem.pszText = szText; szText[0] = 'a'; - ret = SendMessage(hTab, TCM_GETITEM, 5, (LPARAM)&tcItem); + ret = SendMessageA(hTab, TCM_GETITEMA, 5, (LPARAM)&tcItem); expect(FALSE, ret); expect('a', szText[0]); @@ -903,7 +906,7 @@ static void test_getset_item(void) tcItem.mask = TCIF_STATE; tcItem.dwStateMask = 0; tcItem.dwState = TCIS_BUTTONPRESSED; - ret = SendMessage(hTab, TCM_GETITEM, 5, (LPARAM)&tcItem); + ret = SendMessageA(hTab, TCM_GETITEMA, 5, (LPARAM)&tcItem); expect(FALSE, ret); ok(tcItem.dwState == 0, "Expected zero dwState, got %u\n", tcItem.dwState); @@ -911,20 +914,20 @@ static void test_getset_item(void) tcItem.mask = TCIF_STATE; tcItem.dwStateMask = TCIS_BUTTONPRESSED; tcItem.dwState = TCIS_BUTTONPRESSED; - ret = SendMessage(hTab, TCM_GETITEM, 5, (LPARAM)&tcItem); + ret = SendMessageA(hTab, TCM_GETITEMA, 5, (LPARAM)&tcItem); expect(FALSE, ret); ok(tcItem.dwState == 0, "Expected zero dwState\n"); /* check with negative index to be sure */ memset(&tcItem, 0xcc, sizeof(tcItem)); tcItem.mask = TCIF_PARAM; - ret = SendMessage(hTab, TCM_GETITEM, -1, (LPARAM)&tcItem); + ret = SendMessageA(hTab, TCM_GETITEMA, -1, (LPARAM)&tcItem); expect(FALSE, ret); ok(tcItem.lParam == 0, "Expected zero lParam, got %lu\n", tcItem.lParam); memset(&tcItem, 0xcc, sizeof(tcItem)); tcItem.mask = TCIF_PARAM; - ret = SendMessage(hTab, TCM_GETITEM, -2, (LPARAM)&tcItem); + ret = SendMessageA(hTab, TCM_GETITEMA, -2, (LPARAM)&tcItem); expect(FALSE, ret); ok(tcItem.lParam == 0, "Expected zero lParam, got %lu\n", tcItem.lParam); @@ -935,11 +938,11 @@ static void test_getset_item(void) tcItem.cchTextMax = sizeof(szText); strcpy(szText, "New Label"); - ok ( SendMessage(hTab, TCM_SETITEM, 0, (LPARAM) &tcItem), "Setting new item failed.\n"); - ok ( SendMessage(hTab, TCM_GETITEM, 0, (LPARAM) &tcItem), "Getting item failed.\n"); + ok(SendMessageA(hTab, TCM_SETITEMA, 0, (LPARAM)&tcItem), "Setting new item failed.\n"); + ok(SendMessageA(hTab, TCM_GETITEMA, 0, (LPARAM)&tcItem), "Getting item failed.\n"); expect_str("New Label", tcItem.pszText); - ok ( SendMessage(hTab, TCM_GETITEM, 1, (LPARAM) &tcItem), "Getting item failed.\n"); + ok(SendMessageA(hTab, TCM_GETITEMA, 1, (LPARAM)&tcItem), "Getting item failed.\n"); expect_str("Tab 2", tcItem.pszText); ok_sequence(sequences, TAB_SEQ_INDEX, getset_item_seq, "Getset item test sequence", FALSE); @@ -950,9 +953,9 @@ static void test_getset_item(void) tcItem.mask = TCIF_STATE; tcItem.dwStateMask = TCIS_BUTTONPRESSED; tcItem.dwState = TCIS_BUTTONPRESSED; - ok ( SendMessage(hTab, TCM_SETITEM, 0, (LPARAM) &tcItem), "Setting new item failed.\n"); + ok(SendMessageA(hTab, TCM_SETITEMA, 0, (LPARAM)&tcItem), "Setting new item failed.\n"); tcItem.dwState = 0; - ok ( SendMessage(hTab, TCM_GETITEM, 0, (LPARAM) &tcItem), "Getting item failed.\n"); + ok(SendMessageA(hTab, TCM_GETITEMA, 0, (LPARAM)&tcItem), "Getting item failed.\n"); if (tcItem.dwState) { ok (tcItem.dwState == TCIS_BUTTONPRESSED, "TCIS_BUTTONPRESSED should be set.\n"); @@ -960,14 +963,14 @@ static void test_getset_item(void) tcItem.mask = TCIF_STATE; tcItem.dwStateMask = TCIS_HIGHLIGHTED; tcItem.dwState = TCIS_HIGHLIGHTED; - ok ( SendMessage(hTab, TCM_SETITEM, 0, (LPARAM) &tcItem), "Setting new item failed.\n"); + ok(SendMessageA(hTab, TCM_SETITEMA, 0, (LPARAM)&tcItem), "Setting new item failed.\n"); tcItem.dwState = 0; - ok ( SendMessage(hTab, TCM_GETITEM, 0, (LPARAM) &tcItem), "Getting item failed.\n"); + ok(SendMessageA(hTab, TCM_GETITEMA, 0, (LPARAM)&tcItem), "Getting item failed.\n"); ok (tcItem.dwState == TCIS_HIGHLIGHTED, "TCIS_HIGHLIGHTED should be set.\n"); tcItem.mask = TCIF_STATE; tcItem.dwStateMask = TCIS_BUTTONPRESSED; tcItem.dwState = 0; - ok ( SendMessage(hTab, TCM_GETITEM, 0, (LPARAM) &tcItem), "Getting item failed.\n"); + ok(SendMessageA(hTab, TCM_GETITEMA, 0, (LPARAM)&tcItem), "Getting item failed.\n"); ok (tcItem.dwState == TCIS_BUTTONPRESSED, "TCIS_BUTTONPRESSED should be set.\n"); } else win_skip( "Item state mask not supported\n" ); @@ -987,11 +990,11 @@ static void test_getset_tooltips(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); toolTip = create_tooltip(hTab, toolTipText); - SendMessage(hTab, TCM_SETTOOLTIPS, (LPARAM) toolTip, 0); - ok (toolTip == (HWND) SendMessage(hTab,TCM_GETTOOLTIPS,0,0), "ToolTip was set incorrectly.\n"); + SendMessageA(hTab, TCM_SETTOOLTIPS, (LPARAM)toolTip, 0); + ok(toolTip == (HWND)SendMessageA(hTab, TCM_GETTOOLTIPS, 0,0), "ToolTip was set incorrectly.\n"); - SendMessage(hTab, TCM_SETTOOLTIPS, 0, 0); - ok (NULL == (HWND) SendMessage(hTab,TCM_GETTOOLTIPS,0,0), "ToolTip was set incorrectly.\n"); + SendMessageA(hTab, TCM_SETTOOLTIPS, 0, 0); + ok(!SendMessageA(hTab, TCM_GETTOOLTIPS, 0,0), "ToolTip was set incorrectly.\n"); ok_sequence(sequences, TAB_SEQ_INDEX, getset_tooltip_seq, "Getset tooltip test sequence", TRUE); ok_sequence(sequences, PARENT_SEQ_INDEX, getset_tooltip_parent_seq, "Getset tooltip test parent sequence", TRUE); @@ -1030,26 +1033,26 @@ static void test_misc(void) "Parent after sequence, adding tab control to parent", TRUE); flush_sequences(sequences, NUM_MSG_SEQUENCES); - ok(SendMessage(hTab, TCM_SETMINTABWIDTH, 0, -1) > 0,"TCM_SETMINTABWIDTH returned < 0\n"); + ok(SendMessageA(hTab, TCM_SETMINTABWIDTH, 0, -1) > 0, "TCM_SETMINTABWIDTH returned < 0\n"); ok_sequence(sequences, PARENT_SEQ_INDEX, empty_sequence, "Set minTabWidth test parent sequence", FALSE); /* Testing GetItemCount */ flush_sequences(sequences, NUM_MSG_SEQUENCES); - nTabsRetrieved = SendMessage(hTab, TCM_GETITEMCOUNT, 0, 0); + nTabsRetrieved = SendMessageA(hTab, TCM_GETITEMCOUNT, 0, 0); expect(nTabs, nTabsRetrieved); ok_sequence(sequences, TAB_SEQ_INDEX, get_item_count_seq, "Get itemCount test sequence", FALSE); ok_sequence(sequences, PARENT_SEQ_INDEX, empty_sequence, "Getset itemCount test parent sequence", FALSE); /* Testing GetRowCount */ flush_sequences(sequences, NUM_MSG_SEQUENCES); - rowCount = SendMessage(hTab, TCM_GETROWCOUNT, 0, 0); + rowCount = SendMessageA(hTab, TCM_GETROWCOUNT, 0, 0); expect(1, rowCount); ok_sequence(sequences, TAB_SEQ_INDEX, get_row_count_seq, "Get rowCount test sequence", FALSE); ok_sequence(sequences, PARENT_SEQ_INDEX, empty_sequence, "Get rowCount test parent sequence", FALSE); /* Testing GetItemRect */ flush_sequences(sequences, NUM_MSG_SEQUENCES); - ok(SendMessage(hTab, TCM_GETITEMRECT, 0, (LPARAM) &rTab), "GetItemRect failed.\n"); + ok(SendMessageA(hTab, TCM_GETITEMRECT, 0, (LPARAM)&rTab), "GetItemRect failed.\n"); hdc = GetDC(hTab); dpi = GetDeviceCaps(hdc, LOGPIXELSX); @@ -1071,10 +1074,10 @@ static void test_adjustrect(void) hTab = createFilledTabControl(parent_wnd, TCS_FIXEDWIDTH, 0, 0); ok(hTab != NULL, "Failed to create tab control\n"); - r = SendMessage(hTab, TCM_ADJUSTRECT, FALSE, 0); + r = SendMessageA(hTab, TCM_ADJUSTRECT, FALSE, 0); expect(-1, r); - r = SendMessage(hTab, TCM_ADJUSTRECT, TRUE, 0); + r = SendMessageA(hTab, TCM_ADJUSTRECT, TRUE, 0); expect(-1, r); } @@ -1083,7 +1086,7 @@ static void test_insert_focus(void) HWND hTab; INT nTabsRetrieved; INT r; - TCITEM tcNewTab; + TCITEMA tcNewTab; DWORD mask = TCIF_TEXT|TCIF_IMAGE; static char tabName[] = "TAB"; tcNewTab.mask = mask; @@ -1094,48 +1097,48 @@ static void test_insert_focus(void) hTab = createFilledTabControl(parent_wnd, TCS_FIXEDWIDTH, mask, 0); ok(hTab != NULL, "Failed to create tab control\n"); - r = SendMessage(hTab, TCM_GETCURSEL, 0, 0); + r = SendMessageA(hTab, TCM_GETCURSEL, 0, 0); expect(-1, r); flush_sequences(sequences, NUM_MSG_SEQUENCES); - nTabsRetrieved = SendMessage(hTab, TCM_GETITEMCOUNT, 0, 0); + nTabsRetrieved = SendMessageA(hTab, TCM_GETITEMCOUNT, 0, 0); expect(0, nTabsRetrieved); - r = SendMessage(hTab, TCM_GETCURFOCUS, 0, 0); + r = SendMessageA(hTab, TCM_GETCURFOCUS, 0, 0); expect(-1, r); tcNewTab.iImage = 1; - r = SendMessage(hTab, TCM_INSERTITEM, 1, (LPARAM) &tcNewTab); + r = SendMessageA(hTab, TCM_INSERTITEMA, 1, (LPARAM)&tcNewTab); expect(0, r); - nTabsRetrieved = SendMessage(hTab, TCM_GETITEMCOUNT, 0, 0); + nTabsRetrieved = SendMessageA(hTab, TCM_GETITEMCOUNT, 0, 0); expect(1, nTabsRetrieved); - r = SendMessage(hTab, TCM_GETCURFOCUS, 0, 0); + r = SendMessageA(hTab, TCM_GETCURFOCUS, 0, 0); expect(0, r); tcNewTab.iImage = 2; - r = SendMessage(hTab, TCM_INSERTITEM, 2, (LPARAM) &tcNewTab); + r = SendMessageA(hTab, TCM_INSERTITEMA, 2, (LPARAM)&tcNewTab); expect(1, r); - nTabsRetrieved = SendMessage(hTab, TCM_GETITEMCOUNT, 0, 0); + nTabsRetrieved = SendMessageA(hTab, TCM_GETITEMCOUNT, 0, 0); expect(2, nTabsRetrieved); - r = SendMessage(hTab, TCM_GETCURFOCUS, 0, 0); + r = SendMessageA(hTab, TCM_GETCURFOCUS, 0, 0); expect(0, r); - r = SendMessage(hTab, TCM_SETCURFOCUS, -1, 0); + r = SendMessageA(hTab, TCM_SETCURFOCUS, -1, 0); expect(0, r); - r = SendMessage(hTab, TCM_GETCURFOCUS, 0, 0); + r = SendMessageA(hTab, TCM_GETCURFOCUS, 0, 0); expect(-1, r); tcNewTab.iImage = 3; - r = SendMessage(hTab, TCM_INSERTITEM, 3, (LPARAM) &tcNewTab); + r = SendMessageA(hTab, TCM_INSERTITEMA, 3, (LPARAM)&tcNewTab); expect(2, r); - r = SendMessage(hTab, TCM_GETCURFOCUS, 0, 0); + r = SendMessageA(hTab, TCM_GETCURFOCUS, 0, 0); expect(2, r); ok_sequence(sequences, TAB_SEQ_INDEX, insert_focus_seq, "insert_focus test sequence", FALSE); @@ -1157,34 +1160,34 @@ static void test_delete_focus(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); - nTabsRetrieved = SendMessage(hTab, TCM_GETITEMCOUNT, 0, 0); + nTabsRetrieved = SendMessageA(hTab, TCM_GETITEMCOUNT, 0, 0); expect(2, nTabsRetrieved); - r = SendMessage(hTab, TCM_GETCURFOCUS, 0, 0); + r = SendMessageA(hTab, TCM_GETCURFOCUS, 0, 0); expect(0, r); - r = SendMessage(hTab, TCM_DELETEITEM, 1, 0); + r = SendMessageA(hTab, TCM_DELETEITEM, 1, 0); expect(1, r); - nTabsRetrieved = SendMessage(hTab, TCM_GETITEMCOUNT, 0, 0); + nTabsRetrieved = SendMessageA(hTab, TCM_GETITEMCOUNT, 0, 0); expect(1, nTabsRetrieved); - r = SendMessage(hTab, TCM_GETCURFOCUS, 0, 0); + r = SendMessageA(hTab, TCM_GETCURFOCUS, 0, 0); expect(0, r); - r = SendMessage(hTab, TCM_SETCURFOCUS, -1, 0); + r = SendMessageA(hTab, TCM_SETCURFOCUS, -1, 0); expect(0, r); - r = SendMessage(hTab, TCM_GETCURFOCUS, 0, 0); + r = SendMessageA(hTab, TCM_GETCURFOCUS, 0, 0); expect(-1, r); - r = SendMessage(hTab, TCM_DELETEITEM, 0, 0); + r = SendMessageA(hTab, TCM_DELETEITEM, 0, 0); expect(1, r); - nTabsRetrieved = SendMessage(hTab, TCM_GETITEMCOUNT, 0, 0); + nTabsRetrieved = SendMessageA(hTab, TCM_GETITEMCOUNT, 0, 0); expect(0, nTabsRetrieved); - r = SendMessage(hTab, TCM_GETCURFOCUS, 0, 0); + r = SendMessageA(hTab, TCM_GETCURFOCUS, 0, 0); expect(-1, r); ok_sequence(sequences, TAB_SEQ_INDEX, delete_focus_seq, "delete_focus test sequence", FALSE); @@ -1198,7 +1201,7 @@ static void test_removeimage(void) static const BYTE bits[32]; HWND hwTab; INT i; - TCITEM item; + TCITEMA item; HICON hicon; HIMAGELIST himl = ImageList_Create(16, 16, ILC_COLOR, 3, 4); @@ -1208,46 +1211,46 @@ static void test_removeimage(void) ImageList_AddIcon(himl, hicon); hwTab = create_tabcontrol(TCS_FIXEDWIDTH, TCIF_TEXT|TCIF_IMAGE); - SendMessage(hwTab, TCM_SETIMAGELIST, 0, (LPARAM)himl); + SendMessageA(hwTab, TCM_SETIMAGELIST, 0, (LPARAM)himl); - memset(&item, 0, sizeof(TCITEM)); + memset(&item, 0, sizeof(TCITEMA)); item.mask = TCIF_IMAGE; for(i = 0; i < 3; i++) { - SendMessage(hwTab, TCM_GETITEM, i, (LPARAM)&item); + SendMessageA(hwTab, TCM_GETITEMA, i, (LPARAM)&item); expect(i, item.iImage); } /* remove image middle image */ - SendMessage(hwTab, TCM_REMOVEIMAGE, 1, 0); + SendMessageA(hwTab, TCM_REMOVEIMAGE, 1, 0); expect(2, ImageList_GetImageCount(himl)); item.iImage = -1; - SendMessage(hwTab, TCM_GETITEM, 0, (LPARAM)&item); + SendMessageA(hwTab, TCM_GETITEMA, 0, (LPARAM)&item); expect(0, item.iImage); item.iImage = 0; - SendMessage(hwTab, TCM_GETITEM, 1, (LPARAM)&item); + SendMessageA(hwTab, TCM_GETITEMA, 1, (LPARAM)&item); expect(-1, item.iImage); item.iImage = 0; - SendMessage(hwTab, TCM_GETITEM, 2, (LPARAM)&item); + SendMessageA(hwTab, TCM_GETITEMA, 2, (LPARAM)&item); expect(1, item.iImage); /* remove first image */ - SendMessage(hwTab, TCM_REMOVEIMAGE, 0, 0); + SendMessageA(hwTab, TCM_REMOVEIMAGE, 0, 0); expect(1, ImageList_GetImageCount(himl)); item.iImage = 0; - SendMessage(hwTab, TCM_GETITEM, 0, (LPARAM)&item); + SendMessageA(hwTab, TCM_GETITEMA, 0, (LPARAM)&item); expect(-1, item.iImage); item.iImage = 0; - SendMessage(hwTab, TCM_GETITEM, 1, (LPARAM)&item); + SendMessageA(hwTab, TCM_GETITEMA, 1, (LPARAM)&item); expect(-1, item.iImage); item.iImage = -1; - SendMessage(hwTab, TCM_GETITEM, 2, (LPARAM)&item); + SendMessageA(hwTab, TCM_GETITEMA, 2, (LPARAM)&item); expect(0, item.iImage); /* remove the last one */ - SendMessage(hwTab, TCM_REMOVEIMAGE, 0, 0); + SendMessageA(hwTab, TCM_REMOVEIMAGE, 0, 0); expect(0, ImageList_GetImageCount(himl)); for(i = 0; i < 3; i++) { item.iImage = 0; - SendMessage(hwTab, TCM_GETITEM, i, (LPARAM)&item); + SendMessageA(hwTab, TCM_GETITEMA, i, (LPARAM)&item); expect(-1, item.iImage); } @@ -1264,15 +1267,15 @@ static void test_delete_selection(void) hTab = createFilledTabControl(parent_wnd, TCS_FIXEDWIDTH, TCIF_TEXT|TCIF_IMAGE, 4); ok(hTab != NULL, "Failed to create tab control\n"); - ret = SendMessage(hTab, TCM_SETCURSEL, 3, 0); + ret = SendMessageA(hTab, TCM_SETCURSEL, 3, 0); expect(0, ret); - ret = SendMessage(hTab, TCM_GETCURSEL, 0, 0); + ret = SendMessageA(hTab, TCM_GETCURSEL, 0, 0); expect(3, ret); /* delete selected item - selection goes to -1 */ - ret = SendMessage(hTab, TCM_DELETEITEM, 3, 0); + ret = SendMessageA(hTab, TCM_DELETEITEM, 3, 0); expect(TRUE, ret); - ret = SendMessage(hTab, TCM_GETCURSEL, 0, 0); + ret = SendMessageA(hTab, TCM_GETCURSEL, 0, 0); expect(-1, ret); DestroyWindow(hTab); diff --git a/rostests/winetests/comctl32/testlist.c b/rostests/winetests/comctl32/testlist.c index d3990f77768..dd1c5ce8f23 100644 --- a/rostests/winetests/comctl32/testlist.c +++ b/rostests/winetests/comctl32/testlist.c @@ -3,6 +3,7 @@ #define STANDALONE #include +extern void func_button(void); extern void func_comboex(void); extern void func_datetime(void); extern void func_dpa(void); @@ -29,6 +30,7 @@ extern void func_updown(void); const struct test winetest_testlist[] = { + { "button", func_button }, { "comboex", func_comboex }, { "datetime", func_datetime }, { "dpa", func_dpa }, diff --git a/rostests/winetests/comctl32/toolbar.c b/rostests/winetests/comctl32/toolbar.c index 9de319f10e7..c492763a8f6 100644 --- a/rostests/winetests/comctl32/toolbar.c +++ b/rostests/winetests/comctl32/toolbar.c @@ -97,7 +97,7 @@ static LRESULT parent_wnd_notify(LPARAM lParam) { NMHDR *hdr = (NMHDR *)lParam; NMTBHOTITEM *nmhi; - NMTBDISPINFO *nmdisp; + NMTBDISPINFOA *nmdisp; switch (hdr->code) { case TBN_HOTITEMCHANGE: @@ -196,45 +196,45 @@ static void basic_test(void) buttons, sizeof(buttons)/sizeof(buttons[0]), 0, 0, 20, 16, sizeof(TBBUTTON)); ok(hToolbar != NULL, "Toolbar creation\n"); - SendMessage(hToolbar, TB_ADDSTRINGA, 0, (LPARAM)"test\000"); + SendMessageA(hToolbar, TB_ADDSTRINGA, 0, (LPARAM)"test\000"); /* test for exclusion working inside a separator-separated :-) group */ - SendMessage(hToolbar, TB_CHECKBUTTON, 1000, 1); /* press A1 */ - ok(SendMessage(hToolbar, TB_ISBUTTONCHECKED, 1000, 0), "A1 pressed\n"); - ok(!SendMessage(hToolbar, TB_ISBUTTONCHECKED, 1001, 0), "A2 not pressed\n"); + SendMessageA(hToolbar, TB_CHECKBUTTON, 1000, 1); /* press A1 */ + ok(SendMessageA(hToolbar, TB_ISBUTTONCHECKED, 1000, 0), "A1 pressed\n"); + ok(!SendMessageA(hToolbar, TB_ISBUTTONCHECKED, 1001, 0), "A2 not pressed\n"); - SendMessage(hToolbar, TB_CHECKBUTTON, 1004, 1); /* press A5, release A1 */ - ok(SendMessage(hToolbar, TB_ISBUTTONCHECKED, 1004, 0), "A5 pressed\n"); - ok(!SendMessage(hToolbar, TB_ISBUTTONCHECKED, 1000, 0), "A1 not pressed anymore\n"); + SendMessageA(hToolbar, TB_CHECKBUTTON, 1004, 1); /* press A5, release A1 */ + ok(SendMessageA(hToolbar, TB_ISBUTTONCHECKED, 1004, 0), "A5 pressed\n"); + ok(!SendMessageA(hToolbar, TB_ISBUTTONCHECKED, 1000, 0), "A1 not pressed anymore\n"); - SendMessage(hToolbar, TB_CHECKBUTTON, 1005, 1); /* press A6, release A5 */ - ok(SendMessage(hToolbar, TB_ISBUTTONCHECKED, 1005, 0), "A6 pressed\n"); - ok(!SendMessage(hToolbar, TB_ISBUTTONCHECKED, 1004, 0), "A5 not pressed anymore\n"); + SendMessageA(hToolbar, TB_CHECKBUTTON, 1005, 1); /* press A6, release A5 */ + ok(SendMessageA(hToolbar, TB_ISBUTTONCHECKED, 1005, 0), "A6 pressed\n"); + ok(!SendMessageA(hToolbar, TB_ISBUTTONCHECKED, 1004, 0), "A5 not pressed anymore\n"); /* test for inter-group crosstalk, ie. two radio groups interfering with each other */ - SendMessage(hToolbar, TB_CHECKBUTTON, 1007, 1); /* press B2 */ - ok(SendMessage(hToolbar, TB_ISBUTTONCHECKED, 1005, 0), "A6 still pressed, no inter-group crosstalk\n"); - ok(!SendMessage(hToolbar, TB_ISBUTTONCHECKED, 1000, 0), "A1 still not pressed\n"); - ok(SendMessage(hToolbar, TB_ISBUTTONCHECKED, 1007, 0), "B2 pressed\n"); + SendMessageA(hToolbar, TB_CHECKBUTTON, 1007, 1); /* press B2 */ + ok(SendMessageA(hToolbar, TB_ISBUTTONCHECKED, 1005, 0), "A6 still pressed, no inter-group crosstalk\n"); + ok(!SendMessageA(hToolbar, TB_ISBUTTONCHECKED, 1000, 0), "A1 still not pressed\n"); + ok(SendMessageA(hToolbar, TB_ISBUTTONCHECKED, 1007, 0), "B2 pressed\n"); - SendMessage(hToolbar, TB_CHECKBUTTON, 1000, 1); /* press A1 and ensure B group didn't suffer */ - ok(!SendMessage(hToolbar, TB_ISBUTTONCHECKED, 1005, 0), "A6 not pressed anymore\n"); - ok(SendMessage(hToolbar, TB_ISBUTTONCHECKED, 1000, 0), "A1 pressed\n"); - ok(SendMessage(hToolbar, TB_ISBUTTONCHECKED, 1007, 0), "B2 still pressed\n"); + SendMessageA(hToolbar, TB_CHECKBUTTON, 1000, 1); /* press A1 and ensure B group didn't suffer */ + ok(!SendMessageA(hToolbar, TB_ISBUTTONCHECKED, 1005, 0), "A6 not pressed anymore\n"); + ok(SendMessageA(hToolbar, TB_ISBUTTONCHECKED, 1000, 0), "A1 pressed\n"); + ok(SendMessageA(hToolbar, TB_ISBUTTONCHECKED, 1007, 0), "B2 still pressed\n"); - SendMessage(hToolbar, TB_CHECKBUTTON, 1008, 1); /* press B3, and ensure A group didn't suffer */ - ok(!SendMessage(hToolbar, TB_ISBUTTONCHECKED, 1005, 0), "A6 pressed\n"); - ok(SendMessage(hToolbar, TB_ISBUTTONCHECKED, 1000, 0), "A1 pressed\n"); - ok(!SendMessage(hToolbar, TB_ISBUTTONCHECKED, 1007, 0), "B2 not pressed\n"); - ok(SendMessage(hToolbar, TB_ISBUTTONCHECKED, 1008, 0), "B3 pressed\n"); + SendMessageA(hToolbar, TB_CHECKBUTTON, 1008, 1); /* press B3, and ensure A group didn't suffer */ + ok(!SendMessageA(hToolbar, TB_ISBUTTONCHECKED, 1005, 0), "A6 pressed\n"); + ok(SendMessageA(hToolbar, TB_ISBUTTONCHECKED, 1000, 0), "A1 pressed\n"); + ok(!SendMessageA(hToolbar, TB_ISBUTTONCHECKED, 1007, 0), "B2 not pressed\n"); + ok(SendMessageA(hToolbar, TB_ISBUTTONCHECKED, 1008, 0), "B3 pressed\n"); /* tests with invalid index */ - compare(SendMessage(hToolbar, TB_ISBUTTONCHECKED, 0xdeadbeef, 0), -1L, "%ld"); - compare(SendMessage(hToolbar, TB_ISBUTTONPRESSED, 0xdeadbeef, 0), -1L, "%ld"); - compare(SendMessage(hToolbar, TB_ISBUTTONENABLED, 0xdeadbeef, 0), -1L, "%ld"); - compare(SendMessage(hToolbar, TB_ISBUTTONINDETERMINATE, 0xdeadbeef, 0), -1L, "%ld"); - compare(SendMessage(hToolbar, TB_ISBUTTONHIGHLIGHTED, 0xdeadbeef, 0), -1L, "%ld"); - compare(SendMessage(hToolbar, TB_ISBUTTONHIDDEN, 0xdeadbeef, 0), -1L, "%ld"); + compare(SendMessageA(hToolbar, TB_ISBUTTONCHECKED, 0xdeadbeef, 0), -1L, "%ld"); + compare(SendMessageA(hToolbar, TB_ISBUTTONPRESSED, 0xdeadbeef, 0), -1L, "%ld"); + compare(SendMessageA(hToolbar, TB_ISBUTTONENABLED, 0xdeadbeef, 0), -1L, "%ld"); + compare(SendMessageA(hToolbar, TB_ISBUTTONINDETERMINATE, 0xdeadbeef, 0), -1L, "%ld"); + compare(SendMessageA(hToolbar, TB_ISBUTTONHIGHLIGHTED, 0xdeadbeef, 0), -1L, "%ld"); + compare(SendMessageA(hToolbar, TB_ISBUTTONHIDDEN, 0xdeadbeef, 0), -1L, "%ld"); DestroyWindow(hToolbar); } @@ -243,12 +243,12 @@ static void rebuild_toolbar(HWND *hToolbar) { if (*hToolbar) DestroyWindow(*hToolbar); - *hToolbar = CreateWindowEx(0, TOOLBARCLASSNAME, NULL, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, - hMainWnd, (HMENU)5, GetModuleHandle(NULL), NULL); + *hToolbar = CreateWindowExA(0, TOOLBARCLASSNAMEA, NULL, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, + hMainWnd, (HMENU)5, GetModuleHandleA(NULL), NULL); ok(*hToolbar != NULL, "Toolbar creation problem\n"); - ok(SendMessage(*hToolbar, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0) == 0, "TB_BUTTONSTRUCTSIZE failed\n"); - ok(SendMessage(*hToolbar, TB_AUTOSIZE, 0, 0) == 0, "TB_AUTOSIZE failed\n"); - ok(SendMessage(*hToolbar, WM_SETFONT, (WPARAM)GetStockObject(SYSTEM_FONT), 0)==1, "WM_SETFONT\n"); + ok(SendMessageA(*hToolbar, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0) == 0, "TB_BUTTONSTRUCTSIZE failed\n"); + ok(SendMessageA(*hToolbar, TB_AUTOSIZE, 0, 0) == 0, "TB_AUTOSIZE failed\n"); + ok(SendMessageA(*hToolbar, WM_SETFONT, (WPARAM)GetStockObject(SYSTEM_FONT), 0)==1, "WM_SETFONT\n"); } static void rebuild_toolbar_with_buttons(HWND *hToolbar) @@ -277,14 +277,14 @@ static void rebuild_toolbar_with_buttons(HWND *hToolbar) buttons[4].fsStyle = BTNS_BUTTON; buttons[4].fsState = 0; /* disabled */ buttons[4].iString = -1; - ok(SendMessage(*hToolbar, TB_ADDBUTTONS, 5, (LPARAM)buttons) == 1, "TB_ADDBUTTONS failed\n"); - ok(SendMessage(*hToolbar, TB_AUTOSIZE, 0, 0) == 0, "TB_AUTOSIZE failed\n"); + ok(SendMessageA(*hToolbar, TB_ADDBUTTONSA, 5, (LPARAM)buttons) == 1, "TB_ADDBUTTONSA failed\n"); + ok(SendMessageA(*hToolbar, TB_AUTOSIZE, 0, 0) == 0, "TB_AUTOSIZE failed\n"); } static void add_128x15_bitmap(HWND hToolbar, int nCmds) { TBADDBITMAP bmp128; - bmp128.hInst = GetModuleHandle(NULL); + bmp128.hInst = GetModuleHandleA(NULL); bmp128.nID = IDB_BITMAP_128x15; ok(SendMessageA(hToolbar, TB_ADDBITMAP, nCmds, (LPARAM)&bmp128) == 0, "TB_ADDBITMAP - unexpected return\n"); } @@ -311,11 +311,11 @@ static void test_add_bitmap(void) INT ret; /* empty 128x15 bitmap */ - bmp128.hInst = GetModuleHandle(NULL); + bmp128.hInst = GetModuleHandleA(NULL); bmp128.nID = IDB_BITMAP_128x15; /* empty 80x15 bitmap */ - bmp80.hInst = GetModuleHandle(NULL); + bmp80.hInst = GetModuleHandleA(NULL); bmp80.nID = IDB_BITMAP_80x15; /* standard bitmap - 240x15 pixels */ @@ -432,7 +432,8 @@ static void test_add_bitmap(void) /* the control can add bitmaps to an existing image list */ rebuild_toolbar(&hToolbar); - himl = ImageList_LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_BITMAP_80x15), 20, 2, CLR_NONE, IMAGE_BITMAP, LR_DEFAULTCOLOR); + himl = ImageList_LoadImageA(GetModuleHandleA(NULL), (LPCSTR)MAKEINTRESOURCE(IDB_BITMAP_80x15), + 20, 2, CLR_NONE, IMAGE_BITMAP, LR_DEFAULTCOLOR); ok(himl != NULL, "failed to create imagelist\n"); ok(SendMessageA(hToolbar, TB_SETIMAGELIST, 0, (LPARAM)himl) == 0, "TB_SETIMAGELIST failed\n"); CHECK_IMAGELIST(4, 20, 15); @@ -489,12 +490,12 @@ static void test_add_bitmap(void) INT _i; \ CHAR _buf[260]; \ for (_i = 0; _i < (count); _i++) {\ - ret = SendMessageA(hToolbar, TB_GETSTRING, MAKEWPARAM(260, _i), (LPARAM)_buf); \ - ok(ret >= 0, "TB_GETSTRING - unexpected return %d while checking string %d\n", ret, _i); \ + ret = SendMessageA(hToolbar, TB_GETSTRINGA, MAKEWPARAM(260, _i), (LPARAM)_buf); \ + ok(ret >= 0, "TB_GETSTRINGA - unexpected return %d while checking string %d\n", ret, _i); \ if (ret >= 0) \ ok(strcmp(_buf, (tab)[_i]) == 0, "Invalid string #%d - '%s' vs '%s'\n", _i, (tab)[_i], _buf); \ } \ - ok(SendMessageA(hToolbar, TB_GETSTRING, MAKEWPARAM(260, (count)), (LPARAM)_buf) == -1, \ + ok(SendMessageA(hToolbar, TB_GETSTRINGA, MAKEWPARAM(260, (count)), (LPARAM)_buf) == -1, \ "Too many strings in table\n"); \ } @@ -517,10 +518,10 @@ static void test_add_string(void) rebuild_toolbar(&hToolbar); ret = SendMessageA(hToolbar, TB_ADDSTRINGA, 0, (LPARAM)test1); ok(ret == 0, "TB_ADDSTRINGA - unexpected return %d\n", ret); - ret = SendMessageA(hToolbar, TB_GETSTRING, MAKEWPARAM(260, 1), (LPARAM)buf); + ret = SendMessageA(hToolbar, TB_GETSTRINGA, MAKEWPARAM(260, 1), (LPARAM)buf); if (ret == 0) { - win_skip("TB_GETSTRING needs 5.80\n"); + win_skip("TB_GETSTRINGA needs 5.80\n"); return; } CHECK_STRING_TABLE(2, ret1); @@ -536,22 +537,22 @@ static void test_add_string(void) ret = SendMessageA(hToolbar, TB_ADDSTRINGA, 0xdeadbeef, IDS_TBADD1); ok(ret == -1, "TB_ADDSTRINGA - unexpected return %d\n", ret); - ret = SendMessageA(hToolbar, TB_ADDSTRINGA, (WPARAM)GetModuleHandle(NULL), IDS_TBADD1); + ret = SendMessageA(hToolbar, TB_ADDSTRINGA, (WPARAM)GetModuleHandleA(NULL), IDS_TBADD1); ok(ret == 3, "TB_ADDSTRINGA - unexpected return %d\n", ret); CHECK_STRING_TABLE(3, ret2); - ret = SendMessageA(hToolbar, TB_ADDSTRINGA, (WPARAM)GetModuleHandle(NULL), IDS_TBADD2); + ret = SendMessageA(hToolbar, TB_ADDSTRINGA, (WPARAM)GetModuleHandleA(NULL), IDS_TBADD2); ok(ret == 3, "TB_ADDSTRINGA - unexpected return %d\n", ret); CHECK_STRING_TABLE(5, ret3); - ret = SendMessageA(hToolbar, TB_ADDSTRINGA, (WPARAM)GetModuleHandle(NULL), IDS_TBADD3); + ret = SendMessageA(hToolbar, TB_ADDSTRINGA, (WPARAM)GetModuleHandleA(NULL), IDS_TBADD3); ok(ret == 5, "TB_ADDSTRINGA - unexpected return %d\n", ret); CHECK_STRING_TABLE(6, ret4); - ret = SendMessageA(hToolbar, TB_ADDSTRINGA, (WPARAM)GetModuleHandle(NULL), IDS_TBADD4); + ret = SendMessageA(hToolbar, TB_ADDSTRINGA, (WPARAM)GetModuleHandleA(NULL), IDS_TBADD4); ok(ret == 6, "TB_ADDSTRINGA - unexpected return %d\n", ret); CHECK_STRING_TABLE(8, ret5); - ret = SendMessageA(hToolbar, TB_ADDSTRINGA, (WPARAM)GetModuleHandle(NULL), IDS_TBADD5); + ret = SendMessageA(hToolbar, TB_ADDSTRINGA, (WPARAM)GetModuleHandleA(NULL), IDS_TBADD5); ok(ret == 8, "TB_ADDSTRINGA - unexpected return %d\n", ret); CHECK_STRING_TABLE(11, ret6); - ret = SendMessageA(hToolbar, TB_ADDSTRINGA, (WPARAM)GetModuleHandle(NULL), IDS_TBADD7); + ret = SendMessageA(hToolbar, TB_ADDSTRINGA, (WPARAM)GetModuleHandleA(NULL), IDS_TBADD7); ok(ret == 11, "TB_ADDSTRINGA - unexpected return %d\n", ret); CHECK_STRING_TABLE(14, ret7); @@ -579,7 +580,7 @@ static void expect_hot_notify(int idold, int idnew) static void test_hotitem(void) { HWND hToolbar = NULL; - TBBUTTONINFO tbinfo; + TBBUTTONINFOA tbinfo; LRESULT ret; g_fBlockHotItemChange = FALSE; @@ -587,82 +588,82 @@ static void test_hotitem(void) rebuild_toolbar_with_buttons(&hToolbar); /* set TBSTYLE_FLAT. comctl5 allows hot items only for such toolbars. * comctl6 doesn't have this requirement even when theme == NULL */ - SetWindowLong(hToolbar, GWL_STYLE, TBSTYLE_FLAT | GetWindowLong(hToolbar, GWL_STYLE)); - ret = SendMessage(hToolbar, TB_GETHOTITEM, 0, 0); + SetWindowLongA(hToolbar, GWL_STYLE, TBSTYLE_FLAT | GetWindowLongA(hToolbar, GWL_STYLE)); + ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0); ok(ret == -1, "Hot item: %ld, expected -1\n", ret); - ret = SendMessage(hToolbar, TB_SETHOTITEM, 1, 0); + ret = SendMessageA(hToolbar, TB_SETHOTITEM, 1, 0); ok(ret == -1, "TB_SETHOTITEM returned %ld, expected -1\n", ret); - ret = SendMessage(hToolbar, TB_GETHOTITEM, 0, 0); + ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0); ok(ret == 1, "Hot item: %ld, expected 1\n", ret); - ret = SendMessage(hToolbar, TB_SETHOTITEM, 2, 0); + ret = SendMessageA(hToolbar, TB_SETHOTITEM, 2, 0); ok(ret == 1, "TB_SETHOTITEM returned %ld, expected 1\n", ret); - ret = SendMessage(hToolbar, TB_SETHOTITEM, 0xbeef, 0); + ret = SendMessageA(hToolbar, TB_SETHOTITEM, 0xbeef, 0); ok(ret == 2, "TB_SETHOTITEM returned %ld, expected 2\n", ret); - ret = SendMessage(hToolbar, TB_GETHOTITEM, 0, 0); + ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0); ok(ret == 2, "Hot item: %lx, expected 2\n", ret); - ret = SendMessage(hToolbar, TB_SETHOTITEM, -0xbeef, 0); + ret = SendMessageA(hToolbar, TB_SETHOTITEM, -0xbeef, 0); ok(ret == 2, "TB_SETHOTITEM returned %ld, expected 2\n", ret); - ret = SendMessage(hToolbar, TB_GETHOTITEM, 0, 0); + ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0); ok(ret == -1, "Hot item: %lx, expected -1\n", ret); expect_hot_notify(0, 7); - ret = SendMessage(hToolbar, TB_SETHOTITEM, 3, 0); + ret = SendMessageA(hToolbar, TB_SETHOTITEM, 3, 0); ok(ret == -1, "TB_SETHOTITEM returned %ld, expected -1\n", ret); check_hot_notify(); - ret = SendMessage(hToolbar, TB_GETHOTITEM, 0, 0); + ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0); ok(ret == 3, "Hot item: %lx, expected 3\n", ret); g_fBlockHotItemChange = TRUE; - ret = SendMessage(hToolbar, TB_SETHOTITEM, 2, 0); + ret = SendMessageA(hToolbar, TB_SETHOTITEM, 2, 0); ok(ret == 3, "TB_SETHOTITEM returned %ld, expected 2\n", ret); - ret = SendMessage(hToolbar, TB_GETHOTITEM, 0, 0); + ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0); ok(ret == 3, "Hot item: %lx, expected 3\n", ret); g_fBlockHotItemChange = FALSE; g_fReceivedHotItemChange = FALSE; - ret = SendMessage(hToolbar, TB_SETHOTITEM, 0xbeaf, 0); + ret = SendMessageA(hToolbar, TB_SETHOTITEM, 0xbeaf, 0); ok(ret == 3, "TB_SETHOTITEM returned %ld, expected 3\n", ret); ok(g_fReceivedHotItemChange == FALSE, "TBN_HOTITEMCHANGE received for invalid parameter\n"); g_fReceivedHotItemChange = FALSE; - ret = SendMessage(hToolbar, TB_SETHOTITEM, 3, 0); + ret = SendMessageA(hToolbar, TB_SETHOTITEM, 3, 0); ok(ret == 3, "TB_SETHOTITEM returned %ld, expected 3\n", ret); ok(g_fReceivedHotItemChange == FALSE, "TBN_HOTITEMCHANGE received after a duplication\n"); expect_hot_notify(7, 0); - ret = SendMessage(hToolbar, TB_SETHOTITEM, -0xbeaf, 0); + ret = SendMessageA(hToolbar, TB_SETHOTITEM, -0xbeaf, 0); ok(ret == 3, "TB_SETHOTITEM returned %ld, expected 3\n", ret); check_hot_notify(); - SendMessage(hToolbar, TB_SETHOTITEM, 3, 0); + SendMessageA(hToolbar, TB_SETHOTITEM, 3, 0); /* setting disabled buttons will generate a notify with the button id but no button will be hot */ expect_hot_notify(7, 9); - ret = SendMessage(hToolbar, TB_SETHOTITEM, 4, 0); + ret = SendMessageA(hToolbar, TB_SETHOTITEM, 4, 0); ok(ret == 3, "TB_SETHOTITEM returned %ld, expected 3\n", ret); check_hot_notify(); - ret = SendMessage(hToolbar, TB_GETHOTITEM, 0, 0); + ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0); ok(ret == -1, "Hot item: %lx, expected -1\n", ret); /* enabling the button won't change that */ - SendMessage(hToolbar, TB_ENABLEBUTTON, 9, TRUE); - ret = SendMessage(hToolbar, TB_GETHOTITEM, 0, 0); + SendMessageA(hToolbar, TB_ENABLEBUTTON, 9, TRUE); + ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0); ok(ret == -1, "TB_SETHOTITEM returned %ld, expected -1\n", ret); /* disabling a hot button works */ - ret = SendMessage(hToolbar, TB_SETHOTITEM, 3, 0); + ret = SendMessageA(hToolbar, TB_SETHOTITEM, 3, 0); ok(ret == -1, "TB_SETHOTITEM returned %ld, expected -1\n", ret); g_fReceivedHotItemChange = FALSE; - SendMessage(hToolbar, TB_ENABLEBUTTON, 7, FALSE); - ret = SendMessage(hToolbar, TB_GETHOTITEM, 0, 0); + SendMessageA(hToolbar, TB_ENABLEBUTTON, 7, FALSE); + ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0); ok(ret == 3, "TB_SETHOTITEM returned %ld, expected 3\n", ret); ok(g_fReceivedHotItemChange == FALSE, "Unexpected TBN_HOTITEMCHANGE\n"); - SendMessage(hToolbar, TB_SETHOTITEM, 1, 0); - tbinfo.cbSize = sizeof(TBBUTTONINFO); + SendMessageA(hToolbar, TB_SETHOTITEM, 1, 0); + tbinfo.cbSize = sizeof(TBBUTTONINFOA); tbinfo.dwMask = TBIF_STATE; tbinfo.fsState = 0; /* disabled */ g_fReceivedHotItemChange = FALSE; - ok(SendMessage(hToolbar, TB_SETBUTTONINFO, 1, (LPARAM)&tbinfo) == TRUE, "TB_SETBUTTONINFO failed\n"); - ret = SendMessage(hToolbar, TB_GETHOTITEM, 0, 0); + ok(SendMessageA(hToolbar, TB_SETBUTTONINFOA, 1, (LPARAM)&tbinfo) == TRUE, "TB_SETBUTTONINFOA failed\n"); + ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0); ok(ret == 1, "TB_SETHOTITEM returned %ld, expected 1\n", ret); ok(g_fReceivedHotItemChange == FALSE, "Unexpected TBN_HOTITEMCHANGE\n"); @@ -675,7 +676,7 @@ static void dump_sizes(HWND hToolbar) { SIZE sz; RECT r; - int count = SendMessage(hToolbar, TB_BUTTONCOUNT, 0, 0); + int count = SendMessageA(hToolbar, TB_BUTTONCOUNT, 0, 0); int i; GetClientRect(hToolbar, &r); @@ -697,10 +698,10 @@ static void dump_sizes(HWND hToolbar) static int system_font_height(void) { HDC hDC; - TEXTMETRIC tm; + TEXTMETRICA tm; hDC = CreateCompatibleDC(NULL); - GetTextMetrics(hDC, &tm); + GetTextMetricsA(hDC, &tm); DeleteDC(NULL); return tm.tmHeight; @@ -1026,7 +1027,7 @@ static DWORD tbsize_alt_numtests = 0; tbsize_result_t *res = &tbsize_results[tbsize_numtests]; \ GetClientRect(hToolbar, &rc); \ /*check_rect("client", rc, res->rcClient);*/ \ - buttonCount = SendMessage(hToolbar, TB_BUTTONCOUNT, 0, 0); \ + buttonCount = SendMessageA(hToolbar, TB_BUTTONCOUNT, 0, 0); \ compare(buttonCount, res->nButtons, "%d"); \ for (i=0; inButtons); i++) { \ ok(SendMessageA(hToolbar, TB_GETITEMRECT, i, (LPARAM)&rc) == 1, "TB_GETITEMRECT\n"); \ @@ -1067,7 +1068,7 @@ static void test_sizes(void) { HWND hToolbar = NULL; HIMAGELIST himl, himl2; - TBBUTTONINFO tbinfo; + TBBUTTONINFOA tbinfo; int style; int i; int fontheight = system_font_height(); @@ -1075,45 +1076,45 @@ static void test_sizes(void) init_tbsize_results(); rebuild_toolbar_with_buttons(&hToolbar); - style = GetWindowLong(hToolbar, GWL_STYLE); + style = GetWindowLongA(hToolbar, GWL_STYLE); ok(style == (WS_CHILD|WS_VISIBLE|CCS_TOP), "Invalid style %x\n", style); check_sizes(); /* the TBSTATE_WRAP makes a second row */ - SendMessageA(hToolbar, TB_ADDBUTTONS, 2, (LPARAM)buttons1); + SendMessageA(hToolbar, TB_ADDBUTTONSA, 2, (LPARAM)buttons1); check_sizes(); SendMessageA(hToolbar, TB_AUTOSIZE, 0, 0); check_sizes(); /* after setting the TBSTYLE_WRAPABLE the TBSTATE_WRAP is ignored */ - SetWindowLong(hToolbar, GWL_STYLE, style|TBSTYLE_WRAPABLE); + SetWindowLongA(hToolbar, GWL_STYLE, style|TBSTYLE_WRAPABLE); check_sizes(); /* adding new buttons with TBSTYLE_WRAPABLE doesn't add a new row */ - SendMessageA(hToolbar, TB_ADDBUTTONS, 2, (LPARAM)buttons1); + SendMessageA(hToolbar, TB_ADDBUTTONSA, 2, (LPARAM)buttons1); check_sizes(); /* only after adding enough buttons the bar will be wrapped on a * separator and then on the first button */ for (i=0; i<15; i++) - SendMessageA(hToolbar, TB_ADDBUTTONS, 2, (LPARAM)buttons1); + SendMessageA(hToolbar, TB_ADDBUTTONSA, 2, (LPARAM)buttons1); check_sizes_todo(0x4); rebuild_toolbar_with_buttons(&hToolbar); - SendMessageA(hToolbar, TB_ADDBUTTONS, 2, (LPARAM)buttons1); + SendMessageA(hToolbar, TB_ADDBUTTONSA, 2, (LPARAM)buttons1); /* setting the buttons vertical will only change the window client size */ - SetWindowLong(hToolbar, GWL_STYLE, style | CCS_VERT); - SendMessage(hToolbar, TB_AUTOSIZE, 0, 0); + SetWindowLongA(hToolbar, GWL_STYLE, style | CCS_VERT); + SendMessageA(hToolbar, TB_AUTOSIZE, 0, 0); check_sizes_todo(0x3c); /* with a TBSTYLE_WRAPABLE a wrapping will occur on the separator */ - SetWindowLong(hToolbar, GWL_STYLE, style | TBSTYLE_WRAPABLE | CCS_VERT); - SendMessage(hToolbar, TB_AUTOSIZE, 0, 0); + SetWindowLongA(hToolbar, GWL_STYLE, style | TBSTYLE_WRAPABLE | CCS_VERT); + SendMessageA(hToolbar, TB_AUTOSIZE, 0, 0); check_sizes_todo(0x7c); rebuild_toolbar_with_buttons(&hToolbar); - SendMessageA(hToolbar, TB_ADDBUTTONS, 2, (LPARAM)buttons1); + SendMessageA(hToolbar, TB_ADDBUTTONSA, 2, (LPARAM)buttons1); /* a TB_SETBITMAPSIZE changes button sizes*/ SendMessageA(hToolbar, TB_SETBITMAPSIZE, 0, MAKELONG(24, 24)); check_sizes(); /* setting a TBSTYLE_FLAT doesn't change anything - even after a TB_AUTOSIZE */ - SetWindowLong(hToolbar, GWL_STYLE, style | TBSTYLE_FLAT); + SetWindowLongA(hToolbar, GWL_STYLE, style | TBSTYLE_FLAT); SendMessageA(hToolbar, TB_AUTOSIZE, 0, 0); check_sizes(); /* but after a TB_SETBITMAPSIZE the top margins is changed */ @@ -1121,13 +1122,13 @@ static void test_sizes(void) SendMessageA(hToolbar, TB_SETBITMAPSIZE, 0, MAKELONG(24, 24)); check_sizes(); /* some vertical toolbar sizes */ - SetWindowLong(hToolbar, GWL_STYLE, style | TBSTYLE_FLAT | TBSTYLE_WRAPABLE | CCS_VERT); + SetWindowLongA(hToolbar, GWL_STYLE, style | TBSTYLE_FLAT | TBSTYLE_WRAPABLE | CCS_VERT); check_sizes_todo(0x7c); rebuild_toolbar_with_buttons(&hToolbar); - SetWindowLong(hToolbar, GWL_STYLE, style | TBSTYLE_FLAT); + SetWindowLongA(hToolbar, GWL_STYLE, style | TBSTYLE_FLAT); /* newly added buttons will be use the previous margin */ - SendMessageA(hToolbar, TB_ADDBUTTONS, 2, (LPARAM)buttons2); + SendMessageA(hToolbar, TB_ADDBUTTONSA, 2, (LPARAM)buttons2); check_sizes(); /* TB_SETBUTTONSIZE can't be used to reduce the size of a button below the default */ check_button_size(hToolbar, 23, 22); @@ -1141,12 +1142,12 @@ static void test_sizes(void) check_button_size(hToolbar, 23, 100); check_sizes(); /* add some buttons with non-default sizes */ - SendMessageA(hToolbar, TB_ADDBUTTONS, 2, (LPARAM)buttons2); - SendMessageA(hToolbar, TB_INSERTBUTTON, -1, (LPARAM)&buttons2[0]); + SendMessageA(hToolbar, TB_ADDBUTTONSA, 2, (LPARAM)buttons2); + SendMessageA(hToolbar, TB_INSERTBUTTONA, -1, (LPARAM)&buttons2[0]); check_sizes(); - SendMessageA(hToolbar, TB_ADDBUTTONS, 1, (LPARAM)&buttons3[0]); - /* TB_ADDSTRING resets the size */ - SendMessageA(hToolbar, TB_ADDSTRING, 0, (LPARAM) STRING0 "\0" STRING1 "\0"); + SendMessageA(hToolbar, TB_ADDBUTTONSA, 1, (LPARAM)&buttons3[0]); + /* TB_ADDSTRINGA resets the size */ + SendMessageA(hToolbar, TB_ADDSTRINGA, 0, (LPARAM) STRING0 "\0" STRING1 "\0"); check_button_size(hToolbar, 23, 23 + fontheight); check_sizes(); /* TB_SETBUTTONSIZE can be used to crop the text */ @@ -1181,24 +1182,24 @@ static void test_sizes(void) rebuild_toolbar(&hToolbar); SendMessageA(hToolbar, TB_ADDSTRINGA, 0, (LPARAM)STRING0 "\0" STRING1 "\0"); - /* the height is increased after a TB_ADDSTRING */ + /* the height is increased after a TB_ADDSTRINGA */ check_button_size(hToolbar, 23, 23 + fontheight); SendMessageA(hToolbar, TB_SETBUTTONSIZE, 0, MAKELONG(100, 100)); /* if a string is in the pool, even adding a button without a string resets the size */ - SendMessageA(hToolbar, TB_ADDBUTTONS, 1, (LPARAM)&buttons2[0]); + SendMessageA(hToolbar, TB_ADDBUTTONSA, 1, (LPARAM)&buttons2[0]); check_button_size(hToolbar, 23, 22); SendMessageA(hToolbar, TB_SETBUTTONSIZE, 0, MAKELONG(100, 100)); /* an BTNS_AUTOSIZE button is also considered when computing the new size */ - SendMessageA(hToolbar, TB_ADDBUTTONS, 1, (LPARAM)&buttons3[2]); + SendMessageA(hToolbar, TB_ADDBUTTONSA, 1, (LPARAM)&buttons3[2]); check_button_size(hToolbar, 7 + string_width(STRING1), 23 + fontheight); - SendMessageA(hToolbar, TB_ADDBUTTONS, 1, (LPARAM)&buttons3[0]); + SendMessageA(hToolbar, TB_ADDBUTTONSA, 1, (LPARAM)&buttons3[0]); check_sizes(); /* delete button doesn't change the buttons size */ SendMessageA(hToolbar, TB_DELETEBUTTON, 2, 0); SendMessageA(hToolbar, TB_DELETEBUTTON, 1, 0); check_button_size(hToolbar, 7 + string_width(STRING1), 23 + fontheight); - /* TB_INSERTBUTTONS will */ - SendMessageA(hToolbar, TB_INSERTBUTTON, 1, (LPARAM)&buttons2[0]); + /* TB_INSERTBUTTONAS will */ + SendMessageA(hToolbar, TB_INSERTBUTTONA, 1, (LPARAM)&buttons2[0]); check_button_size(hToolbar, 23, 22); /* TB_HIDEBUTTON and TB_MOVEBUTTON doesn't force a recalc */ @@ -1215,13 +1216,15 @@ static void test_sizes(void) /* TB_SETIMAGELIST always changes the height but the width only if necessary */ SendMessageA(hToolbar, TB_SETBUTTONSIZE, 0, MAKELONG(100, 100)); - himl = ImageList_LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_BITMAP_80x15), 20, 2, CLR_NONE, IMAGE_BITMAP, LR_DEFAULTCOLOR); + himl = ImageList_LoadImageA(GetModuleHandleA(NULL), (LPCSTR)MAKEINTRESOURCE(IDB_BITMAP_80x15), + 20, 2, CLR_NONE, IMAGE_BITMAP, LR_DEFAULTCOLOR); ok(SendMessageA(hToolbar, TB_SETIMAGELIST, 0, (LPARAM)himl) == 0, "TB_SETIMAGELIST failed\n"); check_button_size(hToolbar, 100, 21); SendMessageA(hToolbar, TB_SETBUTTONSIZE, 0, MAKELONG(100, 100)); check_button_size(hToolbar, 100, 100); /* But there are no update when we change imagelist, and image sizes are the same */ - himl2 = ImageList_LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_BITMAP_128x15), 20, 2, CLR_NONE, IMAGE_BITMAP, LR_DEFAULTCOLOR); + himl2 = ImageList_LoadImageA(GetModuleHandleA(NULL), (LPCSTR)MAKEINTRESOURCE(IDB_BITMAP_128x15), + 20, 2, CLR_NONE, IMAGE_BITMAP, LR_DEFAULTCOLOR); ok(SendMessageA(hToolbar, TB_SETIMAGELIST, 0, (LRESULT)himl2) == (LRESULT)himl, "TB_SETIMAGELIST failed\n"); check_button_size(hToolbar, 100, 100); SendMessageA(hToolbar, TB_SETBUTTONSIZE, 0, MAKELONG(1, 1)); @@ -1234,13 +1237,13 @@ static void test_sizes(void) check_button_size(hToolbar, 27, 21) /* the text is taken into account */ SendMessageA(hToolbar, TB_ADDSTRINGA, 0, (LPARAM)STRING0 "\0" STRING1 "\0"); - SendMessageA(hToolbar, TB_ADDBUTTONS, 4, (LPARAM)buttons3); + SendMessageA(hToolbar, TB_ADDBUTTONSA, 4, (LPARAM)buttons3); check_button_size(hToolbar, 7 + string_width(STRING1), 22 + fontheight); ok(SendMessageA(hToolbar, TB_SETIMAGELIST, 0, 0) == (LRESULT)himl, "TB_SETIMAGELIST failed\n"); check_button_size(hToolbar, 7 + string_width(STRING1), 8 + fontheight); /* the style change also comes into effect */ check_sizes(); - SetWindowLong(hToolbar, GWL_STYLE, GetWindowLong(hToolbar, GWL_STYLE) | TBSTYLE_FLAT); + SetWindowLongA(hToolbar, GWL_STYLE, GetWindowLongA(hToolbar, GWL_STYLE) | TBSTYLE_FLAT); ok(SendMessageA(hToolbar, TB_SETIMAGELIST, 0, (LPARAM)himl) == 0, "TB_SETIMAGELIST failed\n"); check_sizes_todo(0x30); /* some small problems with BTNS_AUTOSIZE button sizes */ @@ -1248,7 +1251,7 @@ static void test_sizes(void) ImageList_Destroy(himl); ImageList_Destroy(himl2); - SendMessageA(hToolbar, TB_ADDBUTTONS, 1, (LPARAM)&buttons3[3]); + SendMessageA(hToolbar, TB_ADDBUTTONSA, 1, (LPARAM)&buttons3[3]); check_button_size(hToolbar, 7 + string_width(STRING2), 23 + fontheight); SendMessageA(hToolbar, TB_DELETEBUTTON, 0, 0); check_button_size(hToolbar, 7 + string_width(STRING2), 23 + fontheight); @@ -1257,47 +1260,47 @@ static void test_sizes(void) ok(SendMessageA(hToolbar, TB_SETBITMAPSIZE, 0, MAKELPARAM(32, 32)) == 1, "TB_SETBITMAPSIZE failed\n"); ok(SendMessageA(hToolbar, TB_SETBUTTONSIZE, 0, MAKELPARAM(100, 100)) == 1, "TB_SETBUTTONSIZE failed\n"); - ok(SendMessageA(hToolbar, TB_ADDBUTTONS, 1, (LPARAM)&buttons2[0]) == 1, "TB_ADDBUTTONS failed\n"); - ok(SendMessageA(hToolbar, TB_ADDBUTTONS, 1, (LPARAM)&buttons3[2]) == 1, "TB_ADDBUTTONS failed\n"); - ok(SendMessageA(hToolbar, TB_ADDBUTTONS, 1, (LPARAM)&buttons3[0]) == 1, "TB_ADDBUTTONS failed\n"); + ok(SendMessageA(hToolbar, TB_ADDBUTTONSA, 1, (LPARAM)&buttons2[0]) == 1, "TB_ADDBUTTONSA failed\n"); + ok(SendMessageA(hToolbar, TB_ADDBUTTONSA, 1, (LPARAM)&buttons3[2]) == 1, "TB_ADDBUTTONSA failed\n"); + ok(SendMessageA(hToolbar, TB_ADDBUTTONSA, 1, (LPARAM)&buttons3[0]) == 1, "TB_ADDBUTTONSA failed\n"); SendMessageA(hToolbar, TB_AUTOSIZE, 0, 0 ); check_sizes(); rebuild_toolbar(&hToolbar); - SetWindowLong(hToolbar, GWL_STYLE, TBSTYLE_LIST | GetWindowLong(hToolbar, GWL_STYLE)); + SetWindowLongA(hToolbar, GWL_STYLE, TBSTYLE_LIST | GetWindowLongA(hToolbar, GWL_STYLE)); ok(SendMessageA(hToolbar, TB_SETBITMAPSIZE, 0, MAKELPARAM(32, 32)) == 1, "TB_SETBITMAPSIZE failed\n"); ok(SendMessageA(hToolbar, TB_SETBUTTONSIZE, 0, MAKELPARAM(100, 100)) == 1, "TB_SETBUTTONSIZE failed\n"); - ok(SendMessageA(hToolbar, TB_ADDBUTTONS, 1, (LPARAM)&buttons2[0]) == 1, "TB_ADDBUTTONS failed\n"); - ok(SendMessageA(hToolbar, TB_ADDBUTTONS, 1, (LPARAM)&buttons3[2]) == 1, "TB_ADDBUTTONS failed\n"); - ok(SendMessageA(hToolbar, TB_ADDBUTTONS, 1, (LPARAM)&buttons3[3]) == 1, "TB_ADDBUTTONS failed\n"); + ok(SendMessageA(hToolbar, TB_ADDBUTTONSA, 1, (LPARAM)&buttons2[0]) == 1, "TB_ADDBUTTONSA failed\n"); + ok(SendMessageA(hToolbar, TB_ADDBUTTONSA, 1, (LPARAM)&buttons3[2]) == 1, "TB_ADDBUTTONSA failed\n"); + ok(SendMessageA(hToolbar, TB_ADDBUTTONSA, 1, (LPARAM)&buttons3[3]) == 1, "TB_ADDBUTTONSA failed\n"); SendMessageA(hToolbar, TB_AUTOSIZE, 0, 0 ); check_sizes_todo(0xff); rebuild_toolbar(&hToolbar); - SetWindowLong(hToolbar, GWL_STYLE, TBSTYLE_LIST | GetWindowLong(hToolbar, GWL_STYLE)); + SetWindowLongA(hToolbar, GWL_STYLE, TBSTYLE_LIST | GetWindowLongA(hToolbar, GWL_STYLE)); ok(SendMessageA(hToolbar, TB_SETBITMAPSIZE, 0, MAKELPARAM(32, 32)) == 1, "TB_SETBITMAPSIZE failed\n"); ok(SendMessageA(hToolbar, TB_SETBUTTONSIZE, 0, MAKELPARAM(100, 100)) == 1, "TB_SETBUTTONSIZE failed\n"); - ok(SendMessageA(hToolbar, TB_ADDBUTTONS, 1, (LPARAM)&buttons3[3]) == 1, "TB_ADDBUTTONS failed\n"); + ok(SendMessageA(hToolbar, TB_ADDBUTTONSA, 1, (LPARAM)&buttons3[3]) == 1, "TB_ADDBUTTONSA failed\n"); SendMessageA(hToolbar, TB_AUTOSIZE, 0, 0 ); check_sizes(); rebuild_toolbar(&hToolbar); - SetWindowLong(hToolbar, GWL_STYLE, TBSTYLE_WRAPABLE | GetWindowLong(hToolbar, GWL_STYLE)); - ok(SendMessageA(hToolbar, TB_ADDBUTTONS, 1, (LPARAM)&buttons3[3]) == 1, "TB_ADDBUTTONS failed\n"); - ok(SendMessageA(hToolbar, TB_ADDBUTTONS, 1, (LPARAM)&buttons3[3]) == 1, "TB_ADDBUTTONS failed\n"); + SetWindowLongA(hToolbar, GWL_STYLE, TBSTYLE_WRAPABLE | GetWindowLongA(hToolbar, GWL_STYLE)); + ok(SendMessageA(hToolbar, TB_ADDBUTTONSA, 1, (LPARAM)&buttons3[3]) == 1, "TB_ADDBUTTONSA failed\n"); + ok(SendMessageA(hToolbar, TB_ADDBUTTONSA, 1, (LPARAM)&buttons3[3]) == 1, "TB_ADDBUTTONSA failed\n"); tbinfo.cx = 672; - tbinfo.cbSize = sizeof(TBBUTTONINFO); + tbinfo.cbSize = sizeof(TBBUTTONINFOA); tbinfo.dwMask = TBIF_SIZE | TBIF_BYINDEX; - if (SendMessageA(hToolbar, TB_SETBUTTONINFO, 0, (LPARAM)&tbinfo)) + if (SendMessageA(hToolbar, TB_SETBUTTONINFOA, 0, (LPARAM)&tbinfo)) { - ok(SendMessageA(hToolbar, TB_SETBUTTONINFO, 1, (LPARAM)&tbinfo) != 0, "TB_SETBUTTONINFO failed\n"); + ok(SendMessageA(hToolbar, TB_SETBUTTONINFOA, 1, (LPARAM)&tbinfo) != 0, "TB_SETBUTTONINFOA failed\n"); SendMessageA(hToolbar, TB_AUTOSIZE, 0, 0); check_sizes(); } else /* TBIF_BYINDEX probably not supported, confirm that this was the reason for the failure */ { tbinfo.dwMask = TBIF_SIZE; - ok(SendMessageA(hToolbar, TB_SETBUTTONINFO, 33, (LPARAM)&tbinfo) != 0, "TB_SETBUTTONINFO failed\n"); + ok(SendMessageA(hToolbar, TB_SETBUTTONINFOA, 33, (LPARAM)&tbinfo) != 0, "TB_SETBUTTONINFOA failed\n"); } free_tbsize_results(); @@ -1314,9 +1317,9 @@ static void prepare_recalc_test(HWND *phToolbar) { RECT rect; rebuild_toolbar_with_buttons(phToolbar); - SetWindowLong(*phToolbar, GWL_STYLE, - GetWindowLong(*phToolbar, GWL_STYLE) | TBSTYLE_FLAT); - SendMessage(*phToolbar, TB_GETITEMRECT, 1, (LPARAM)&rect); + SetWindowLongA(*phToolbar, GWL_STYLE, + GetWindowLongA(*phToolbar, GWL_STYLE) | TBSTYLE_FLAT); + SendMessageA(*phToolbar, TB_GETITEMRECT, 1, (LPARAM)&rect); ok(rect.top == 2, "Test will make no sense because initial top is %d instead of 2\n", rect.top); } @@ -1324,7 +1327,7 @@ static void prepare_recalc_test(HWND *phToolbar) static BOOL did_recalc(HWND hToolbar) { RECT rect; - SendMessage(hToolbar, TB_GETITEMRECT, 1, (LPARAM)&rect); + SendMessageA(hToolbar, TB_GETITEMRECT, 1, (LPARAM)&rect); ok(rect.top == 2 || rect.top == 0, "Unexpected top margin %d in recalc test\n", rect.top); return (rect.top == 0); @@ -1335,15 +1338,15 @@ static void restore_recalc_state(HWND hToolbar) { RECT rect; /* return to style with a 2px top margin */ - SetWindowLong(hToolbar, GWL_STYLE, - GetWindowLong(hToolbar, GWL_STYLE) & ~TBSTYLE_FLAT); + SetWindowLongA(hToolbar, GWL_STYLE, + GetWindowLongA(hToolbar, GWL_STYLE) & ~TBSTYLE_FLAT); /* recalc */ - SendMessage(hToolbar, TB_ADDBUTTONS, 1, (LPARAM)&buttons3[3]); + SendMessageA(hToolbar, TB_ADDBUTTONSA, 1, (LPARAM)&buttons3[3]); /* top margin will be 0px if a recalc occurs */ - SetWindowLong(hToolbar, GWL_STYLE, - GetWindowLong(hToolbar, GWL_STYLE) | TBSTYLE_FLAT); + SetWindowLongA(hToolbar, GWL_STYLE, + GetWindowLongA(hToolbar, GWL_STYLE) | TBSTYLE_FLAT); /* safety check */ - SendMessage(hToolbar, TB_GETITEMRECT, 1, (LPARAM)&rect); + SendMessageA(hToolbar, TB_GETITEMRECT, 1, (LPARAM)&rect); ok(rect.top == 2, "Test will make no sense because initial top is %d instead of 2\n", rect.top); } @@ -1351,30 +1354,30 @@ static void restore_recalc_state(HWND hToolbar) static void test_recalc(void) { HWND hToolbar = NULL; - TBBUTTONINFO bi; + TBBUTTONINFOA bi; CHAR test[] = "Test"; const int EX_STYLES_COUNT = 5; int i; BOOL recalc; - /* Like TB_ADDBUTTONS tested in test_sized, inserting a button without text + /* Like TB_ADDBUTTONSA tested in test_sized, inserting a button without text * results in a relayout, while adding one with text forces a recalc */ prepare_recalc_test(&hToolbar); - SendMessage(hToolbar, TB_INSERTBUTTON, 1, (LPARAM)&buttons3[0]); + SendMessageA(hToolbar, TB_INSERTBUTTONA, 1, (LPARAM)&buttons3[0]); recalc = did_recalc(hToolbar); ok(!recalc, "Unexpected recalc - adding button without text\n"); prepare_recalc_test(&hToolbar); - SendMessage(hToolbar, TB_INSERTBUTTON, 1, (LPARAM)&buttons3[3]); + SendMessageA(hToolbar, TB_INSERTBUTTONA, 1, (LPARAM)&buttons3[3]); recalc = did_recalc(hToolbar); ok(recalc, "Expected a recalc - adding button with text\n"); - /* TB_SETBUTTONINFO, even when adding a text, results only in a relayout */ + /* TB_SETBUTTONINFOA, even when adding a text, results only in a relayout */ prepare_recalc_test(&hToolbar); bi.cbSize = sizeof(bi); bi.dwMask = TBIF_TEXT; bi.pszText = test; - SendMessage(hToolbar, TB_SETBUTTONINFO, 1, (LPARAM)&bi); + SendMessageA(hToolbar, TB_SETBUTTONINFOA, 1, (LPARAM)&bi); recalc = did_recalc(hToolbar); ok(!recalc, "Unexpected recalc - setting a button text\n"); @@ -1385,35 +1388,35 @@ static void test_recalc(void) if (i == 1 || i == 3) /* an undoc style and TBSTYLE_EX_MIXEDBUTTONS */ continue; prepare_recalc_test(&hToolbar); - expect(0, (int)SendMessage(hToolbar, TB_GETEXTENDEDSTYLE, 0, 0)); - SendMessage(hToolbar, TB_SETEXTENDEDSTYLE, 0, (1 << i)); + expect(0, (int)SendMessageA(hToolbar, TB_GETEXTENDEDSTYLE, 0, 0)); + SendMessageA(hToolbar, TB_SETEXTENDEDSTYLE, 0, (1 << i)); recalc = did_recalc(hToolbar); ok(!recalc, "Unexpected recalc - setting bit %d\n", i); - SendMessage(hToolbar, TB_SETEXTENDEDSTYLE, 0, 0); + SendMessageA(hToolbar, TB_SETEXTENDEDSTYLE, 0, 0); recalc = did_recalc(hToolbar); ok(!recalc, "Unexpected recalc - clearing bit %d\n", i); - expect(0, (int)SendMessage(hToolbar, TB_GETEXTENDEDSTYLE, 0, 0)); + expect(0, (int)SendMessageA(hToolbar, TB_GETEXTENDEDSTYLE, 0, 0)); } /* TBSTYLE_EX_MIXEDBUTTONS does a recalc on change */ prepare_recalc_test(&hToolbar); - SendMessage(hToolbar, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_MIXEDBUTTONS); + SendMessageA(hToolbar, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_MIXEDBUTTONS); recalc = did_recalc(hToolbar); if (recalc) { ok(recalc, "Expected a recalc - setting TBSTYLE_EX_MIXEDBUTTONS\n"); restore_recalc_state(hToolbar); - SendMessage(hToolbar, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_MIXEDBUTTONS); + SendMessageA(hToolbar, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_MIXEDBUTTONS); recalc = did_recalc(hToolbar); ok(!recalc, "Unexpected recalc - setting TBSTYLE_EX_MIXEDBUTTONS again\n"); restore_recalc_state(hToolbar); - SendMessage(hToolbar, TB_SETEXTENDEDSTYLE, 0, 0); + SendMessageA(hToolbar, TB_SETEXTENDEDSTYLE, 0, 0); recalc = did_recalc(hToolbar); ok(recalc, "Expected a recalc - clearing TBSTYLE_EX_MIXEDBUTTONS\n"); } else win_skip( "No recalc on TBSTYLE_EX_MIXEDBUTTONS\n" ); - /* undocumented exstyle 0x2 seems to changes the top margin, what + /* undocumented exstyle 0x2 seems to change the top margin, which * interferes with these tests */ DestroyWindow(hToolbar); @@ -1427,13 +1430,13 @@ static void test_getbuttoninfo(void) rebuild_toolbar_with_buttons(&hToolbar); for (i = 0; i < 128; i++) { - TBBUTTONINFO tbi; + TBBUTTONINFOA tbi; int ret; tbi.cbSize = i; tbi.dwMask = TBIF_COMMAND; - ret = (int)SendMessage(hToolbar, TB_GETBUTTONINFO, 1, (LPARAM)&tbi); - if (i == sizeof(TBBUTTONINFO)) { + ret = (int)SendMessageA(hToolbar, TB_GETBUTTONINFOA, 1, (LPARAM)&tbi); + if (i == sizeof(TBBUTTONINFOA)) { compare(ret, 0, "%d"); } else { compare(ret, -1, "%d"); @@ -1448,46 +1451,46 @@ static void test_createtoolbarex(void) TBBUTTON btns[3]; ZeroMemory(&btns, sizeof(btns)); - hToolbar = CreateToolbarEx(hMainWnd, WS_VISIBLE, 1, 16, GetModuleHandle(NULL), IDB_BITMAP_128x15, btns, + hToolbar = CreateToolbarEx(hMainWnd, WS_VISIBLE, 1, 16, GetModuleHandleA(NULL), IDB_BITMAP_128x15, btns, 3, 20, 20, 16, 16, sizeof(TBBUTTON)); CHECK_IMAGELIST(16, 20, 20); - compare((int)SendMessage(hToolbar, TB_GETBUTTONSIZE, 0, 0), 0x1a001b, "%x"); + compare((int)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), 0x1a001b, "%x"); DestroyWindow(hToolbar); - hToolbar = CreateToolbarEx(hMainWnd, WS_VISIBLE, 1, 16, GetModuleHandle(NULL), IDB_BITMAP_128x15, btns, + hToolbar = CreateToolbarEx(hMainWnd, WS_VISIBLE, 1, 16, GetModuleHandleA(NULL), IDB_BITMAP_128x15, btns, 3, 4, 4, 16, 16, sizeof(TBBUTTON)); CHECK_IMAGELIST(32, 4, 4); - compare((int)SendMessage(hToolbar, TB_GETBUTTONSIZE, 0, 0), 0xa000b, "%x"); + compare((int)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), 0xa000b, "%x"); DestroyWindow(hToolbar); - hToolbar = CreateToolbarEx(hMainWnd, WS_VISIBLE, 1, 16, GetModuleHandle(NULL), IDB_BITMAP_128x15, btns, + hToolbar = CreateToolbarEx(hMainWnd, WS_VISIBLE, 1, 16, GetModuleHandleA(NULL), IDB_BITMAP_128x15, btns, 3, 0, 8, 12, 12, sizeof(TBBUTTON)); CHECK_IMAGELIST(16, 12, 12); - compare((int)SendMessage(hToolbar, TB_GETBUTTONSIZE, 0, 0), 0x120013, "%x"); + compare((int)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), 0x120013, "%x"); DestroyWindow(hToolbar); - hToolbar = CreateToolbarEx(hMainWnd, WS_VISIBLE, 1, 16, GetModuleHandle(NULL), IDB_BITMAP_128x15, btns, + hToolbar = CreateToolbarEx(hMainWnd, WS_VISIBLE, 1, 16, GetModuleHandleA(NULL), IDB_BITMAP_128x15, btns, 3, -1, 8, 12, 12, sizeof(TBBUTTON)); CHECK_IMAGELIST(16, 12, 8); - compare((int)SendMessage(hToolbar, TB_GETBUTTONSIZE, 0, 0), 0xe0013, "%x"); + compare((int)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), 0xe0013, "%x"); DestroyWindow(hToolbar); - hToolbar = CreateToolbarEx(hMainWnd, WS_VISIBLE, 1, 16, GetModuleHandle(NULL), IDB_BITMAP_128x15, btns, + hToolbar = CreateToolbarEx(hMainWnd, WS_VISIBLE, 1, 16, GetModuleHandleA(NULL), IDB_BITMAP_128x15, btns, 3, -1, 8, -1, 12, sizeof(TBBUTTON)); CHECK_IMAGELIST(16, 16, 8); - compare((int)SendMessage(hToolbar, TB_GETBUTTONSIZE, 0, 0), 0xe0017, "%x"); + compare((int)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), 0xe0017, "%x"); DestroyWindow(hToolbar); - hToolbar = CreateToolbarEx(hMainWnd, WS_VISIBLE, 1, 16, GetModuleHandle(NULL), IDB_BITMAP_128x15, btns, + hToolbar = CreateToolbarEx(hMainWnd, WS_VISIBLE, 1, 16, GetModuleHandleA(NULL), IDB_BITMAP_128x15, btns, 3, 0, 0, 12, -1, sizeof(TBBUTTON)); CHECK_IMAGELIST(16, 12, 16); - compare((int)SendMessage(hToolbar, TB_GETBUTTONSIZE, 0, 0), 0x160013, "%x"); + compare((int)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), 0x160013, "%x"); DestroyWindow(hToolbar); - hToolbar = CreateToolbarEx(hMainWnd, WS_VISIBLE, 1, 16, GetModuleHandle(NULL), IDB_BITMAP_128x15, btns, + hToolbar = CreateToolbarEx(hMainWnd, WS_VISIBLE, 1, 16, GetModuleHandleA(NULL), IDB_BITMAP_128x15, btns, 3, 0, 0, 0, 12, sizeof(TBBUTTON)); CHECK_IMAGELIST(16, 16, 16); - compare((int)SendMessage(hToolbar, TB_GETBUTTONSIZE, 0, 0), 0x160017, "%x"); + compare((int)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), 0x160017, "%x"); DestroyWindow(hToolbar); } @@ -1502,7 +1505,7 @@ static void test_dispinfo(void) rebuild_toolbar(&hToolbar); SendMessageA(hToolbar, TB_LOADIMAGES, IDB_HIST_SMALL_COLOR, (LPARAM)HINST_COMMCTRL); - SendMessageA(hToolbar, TB_ADDBUTTONS, 2, (LPARAM)buttons_disp); + SendMessageA(hToolbar, TB_ADDBUTTONSA, 2, (LPARAM)buttons_disp); g_dwExpectedDispInfoMask = TBNF_IMAGE; /* Some TBN_GETDISPINFO tests will be done in MyWnd_Notify function. * We will receive TBN_GETDISPINFOW even if the control is ANSI */ @@ -1591,29 +1594,29 @@ static void test_getstring(void) static const WCHAR answerW[] = { 'S','T','R',0 }; INT r; - hToolbar = CreateWindowExA(0, TOOLBARCLASSNAME, NULL, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, hMainWnd, (HMENU)5, GetModuleHandle(NULL), NULL); + hToolbar = CreateWindowExA(0, TOOLBARCLASSNAMEA, NULL, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, hMainWnd, (HMENU)5, GetModuleHandleA(NULL), NULL); ok(hToolbar != NULL, "Toolbar creation problem\n"); - r = SendMessage(hToolbar, TB_GETSTRING, MAKEWPARAM(0, 0), 0); + r = SendMessageA(hToolbar, TB_GETSTRINGA, MAKEWPARAM(0, 0), 0); if (r == 0) { - win_skip("TB_GETSTRING and TB_GETSTRINGW need 5.80\n"); + win_skip("TB_GETSTRINGA and TB_GETSTRINGW need 5.80\n"); DestroyWindow(hToolbar); return; } expect(-1, r); - r = SendMessage(hToolbar, TB_GETSTRINGW, MAKEWPARAM(0, 0), 0); + r = SendMessageW(hToolbar, TB_GETSTRINGW, MAKEWPARAM(0, 0), 0); expect(-1, r); - r = SendMessage(hToolbar, TB_ADDSTRING, 0, (LPARAM)answer); + r = SendMessageA(hToolbar, TB_ADDSTRINGA, 0, (LPARAM)answer); expect(0, r); - r = SendMessage(hToolbar, TB_GETSTRING, MAKEWPARAM(0, 0), 0); + r = SendMessageA(hToolbar, TB_GETSTRINGA, MAKEWPARAM(0, 0), 0); expect(lstrlenA(answer), r); - r = SendMessage(hToolbar, TB_GETSTRINGW, MAKEWPARAM(0, 0), 0); + r = SendMessageW(hToolbar, TB_GETSTRINGW, MAKEWPARAM(0, 0), 0); expect(lstrlenA(answer), r); - r = SendMessage(hToolbar, TB_GETSTRING, MAKEWPARAM(sizeof(str), 0), (LPARAM)str); + r = SendMessageA(hToolbar, TB_GETSTRINGA, MAKEWPARAM(sizeof(str), 0), (LPARAM)str); expect(lstrlenA(answer), r); - expect(0, lstrcmp(answer, str)); - r = SendMessage(hToolbar, TB_GETSTRINGW, MAKEWPARAM(sizeof(strW), 0), (LPARAM)strW); + expect(0, lstrcmpA(answer, str)); + r = SendMessageW(hToolbar, TB_GETSTRINGW, MAKEWPARAM(sizeof(strW), 0), (LPARAM)strW); expect(lstrlenA(answer), r); expect(0, lstrcmpW(answerW, strW)); @@ -1632,7 +1635,7 @@ static void test_tooltip(void) rebuild_toolbar(&hToolbar); - SendMessageA(hToolbar, TB_ADDBUTTONS, 2, (LPARAM)buttons_disp); + SendMessageA(hToolbar, TB_ADDBUTTONSA, 2, (LPARAM)buttons_disp); /* W used to get through toolbar code that assumes tooltip is always Unicode */ memset(&nmtti, 0, sizeof(nmtti)); @@ -1653,8 +1656,8 @@ static void test_tooltip(void) DestroyWindow(hToolbar); /* TBSTYLE_TOOLTIPS */ - hToolbar = CreateWindowExA(0, TOOLBARCLASSNAME, NULL, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, - hMainWnd, (HMENU)5, GetModuleHandle(NULL), NULL); + hToolbar = CreateWindowExA(0, TOOLBARCLASSNAMEA, NULL, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, + hMainWnd, (HMENU)5, GetModuleHandleA(NULL), NULL); tooltip = (HWND)SendMessageA(hToolbar, TB_GETTOOLTIPS, 0, 0); ok(tooltip == NULL, "got %p\n", tooltip); DestroyWindow(hToolbar); @@ -1680,7 +1683,7 @@ static void test_get_set_style(void) buttons, sizeof(buttons)/sizeof(buttons[0]), 0, 0, 20, 16, sizeof(TBBUTTON)); ok(hToolbar != NULL, "Toolbar creation\n"); - SendMessage(hToolbar, TB_ADDSTRINGA, 0, (LPARAM)"test\000"); + SendMessageA(hToolbar, TB_ADDSTRINGA, 0, (LPARAM)"test\000"); style = SendMessageA(hToolbar, TB_GETSTYLE, 0, 0); style2 = GetWindowLongA(hToolbar, GWL_STYLE); @@ -1809,8 +1812,8 @@ static void test_create(void) SET_EXPECT(g_hook_WM_NCCREATE); SET_EXPECT(g_hook_WM_CREATE); - hwnd = CreateWindowExA(0, TOOLBARCLASSNAME, NULL, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, - hMainWnd, (HMENU)5, GetModuleHandle(NULL), NULL); + hwnd = CreateWindowExA(0, TOOLBARCLASSNAMEA, NULL, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, + hMainWnd, (HMENU)5, GetModuleHandleA(NULL), NULL); CHECK_CALLED(g_hook_create); CHECK_CALLED(g_hook_WM_NCCREATE); @@ -1827,9 +1830,9 @@ static void test_create(void) UnhookWindowsHook(WH_CBT, cbt_hook_proc); /* TBSTYLE_TRANSPARENT */ - hwnd = CreateWindowExA(0, TOOLBARCLASSNAME, NULL, + hwnd = CreateWindowExA(0, TOOLBARCLASSNAMEA, NULL, WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|TBSTYLE_FLAT|TBSTYLE_TOOLTIPS|TBSTYLE_GROUP, - 0, 0, 0, 0, hMainWnd, (HMENU)5, GetModuleHandle(NULL), NULL); + 0, 0, 0, 0, hMainWnd, (HMENU)5, GetModuleHandleA(NULL), NULL); style = GetWindowLongA(hwnd, GWL_STYLE); ok((style & TBSTYLE_TRANSPARENT) == TBSTYLE_TRANSPARENT, "got 0x%08x\n", style); @@ -1907,6 +1910,16 @@ static void test_TB_GET_SET_EXTENDEDSTYLE(void) ok(style == ptr->style_set, "%d: got style 0x%08x, expected 0x%08x\n", i, style, ptr->style_set); } + /* Windows sets CCS_VERT when TB_GETEXTENDEDSTYLE is set */ + oldstyle2 = SendMessageA(hwnd, TB_GETEXTENDEDSTYLE, 0, 0); + oldstyle = SendMessageA(hwnd, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_VERTICAL); + ok(oldstyle == oldstyle2, "got old style 0x%08x, expected 0x%08x\n", oldstyle, oldstyle2); + style = SendMessageA(hwnd, TB_GETEXTENDEDSTYLE, 0, 0); + ok(style == TBSTYLE_EX_VERTICAL, "got style 0x%08x, expected 0x%08x\n", style, TBSTYLE_EX_VERTICAL); + style = SendMessageA(hwnd, TB_GETSTYLE, 0, 0); + todo_wine + ok(style == CCS_VERT, "got style 0x%08x, expected 0x%08x\n", style, CCS_VERT); + DestroyWindow(hwnd); } @@ -1925,7 +1938,7 @@ START_TEST(toolbar) wc.cbWndExtra = 0; wc.hInstance = GetModuleHandleA(NULL); wc.hIcon = NULL; - wc.hCursor = LoadCursorA(NULL, IDC_IBEAM); + wc.hCursor = LoadCursorA(NULL, (LPCSTR)IDC_IBEAM); wc.hbrBackground = GetSysColorBrush(COLOR_WINDOW); wc.lpszMenuName = NULL; wc.lpszClassName = "Toolbar test parent"; diff --git a/rostests/winetests/comctl32/tooltips.c b/rostests/winetests/comctl32/tooltips.c index e17de9a2297..10d7b3f90c3 100644 --- a/rostests/winetests/comctl32/tooltips.c +++ b/rostests/winetests/comctl32/tooltips.c @@ -33,17 +33,17 @@ static void test_create_tooltip(void) HWND parent, hwnd; DWORD style, exp_style; - parent = CreateWindowEx(0, "static", NULL, WS_POPUP, + parent = CreateWindowExA(0, "static", NULL, WS_POPUP, 0, 0, 0, 0, NULL, NULL, NULL, 0); - assert(parent); + ok(parent != NULL, "failed to create parent wnd\n"); - hwnd = CreateWindowEx(0, TOOLTIPS_CLASS, NULL, 0x7fffffff | WS_POPUP, + hwnd = CreateWindowExA(0, TOOLTIPS_CLASSA, NULL, 0x7fffffff | WS_POPUP, 10, 10, 300, 100, parent, NULL, NULL, 0); - assert(hwnd); + ok(hwnd != NULL, "failed to create tooltip wnd\n"); - style = GetWindowLong(hwnd, GWL_STYLE); + style = GetWindowLongA(hwnd, GWL_STYLE); trace("style = %08x\n", style); exp_style = 0x7fffffff | WS_POPUP; exp_style &= ~(WS_CHILD | WS_MAXIMIZE | WS_BORDER | WS_DLGFRAME); @@ -52,12 +52,12 @@ static void test_create_tooltip(void) DestroyWindow(hwnd); - hwnd = CreateWindowEx(0, TOOLTIPS_CLASS, NULL, 0, + hwnd = CreateWindowExA(0, TOOLTIPS_CLASSA, NULL, 0, 10, 10, 300, 100, parent, NULL, NULL, 0); - assert(hwnd); + ok(hwnd != NULL, "failed to create tooltip wnd\n"); - style = GetWindowLong(hwnd, GWL_STYLE); + style = GetWindowLongA(hwnd, GWL_STYLE); trace("style = %08x\n", style); ok(style == (WS_POPUP | WS_CLIPSIBLINGS | WS_BORDER), "wrong style %08x\n", style); @@ -77,7 +77,7 @@ static void flush_events(int waitTime) while (diff > 0) { if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min(100,diff), QS_ALLEVENTS) == WAIT_TIMEOUT) break; - while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg ); + while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); diff = time - GetTickCount(); } } @@ -96,7 +96,7 @@ static HWND g_hwnd; #define TEST_CDDS_ITEMPOSTERASE 0x00000080 #define TEST_CDDS_SUBITEM 0x00000100 -static LRESULT CALLBACK CustomDrawWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +static LRESULT CALLBACK custom_draw_wnd_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { @@ -161,12 +161,12 @@ static void test_customdraw(void) { wc.cbWndExtra = 0; wc.hInstance = GetModuleHandleA(NULL); wc.hIcon = NULL; - wc.hCursor = LoadCursorA(NULL, IDC_ARROW); + wc.hCursor = LoadCursorA(NULL, (LPCSTR)IDC_ARROW); wc.hbrBackground = GetSysColorBrush(COLOR_WINDOW); wc.lpszMenuName = NULL; wc.lpszClassName = "CustomDrawClass"; - wc.lpfnWndProc = CustomDrawWndProc; - RegisterClass(&wc); + wc.lpfnWndProc = custom_draw_wnd_proc; + RegisterClassA(&wc); for (iterationNumber = 0; iterationNumber < sizeof(expectedResults)/sizeof(expectedResults[0]); @@ -174,10 +174,10 @@ static void test_customdraw(void) { HWND parent, hwndTip; RECT rect; - TOOLINFO toolInfo = { 0 }; + TTTOOLINFOA toolInfo = { 0 }; /* Create a main window */ - parent = CreateWindowEx(0, "CustomDrawClass", NULL, + parent = CreateWindowExA(0, "CustomDrawClass", NULL, WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_VISIBLE, 50, 50, @@ -190,7 +190,7 @@ static void test_customdraw(void) { flush_events(100); /* Create Tooltip */ - hwndTip = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, + hwndTip = CreateWindowExA(WS_EX_TOPMOST, TOOLTIPS_CLASSA, NULL, TTS_NOPREFIX | TTS_ALWAYSTIP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, @@ -207,7 +207,7 @@ static void test_customdraw(void) { SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); /* Create a tool */ - toolInfo.cbSize = TTTOOLINFO_V1_SIZE; + toolInfo.cbSize = TTTOOLINFOA_V1_SIZE; toolInfo.hwnd = parent; toolInfo.hinst = GetModuleHandleA(NULL); toolInfo.uFlags = TTF_SUBCLASS; @@ -215,11 +215,11 @@ static void test_customdraw(void) { toolInfo.lpszText = (LPSTR)"This is a test tooltip"; toolInfo.lParam = 0xdeadbeef; GetClientRect (parent, &toolInfo.rect); - lResult = SendMessage(hwndTip, TTM_ADDTOOL, 0, (LPARAM)&toolInfo); + lResult = SendMessageA(hwndTip, TTM_ADDTOOLA, 0, (LPARAM)&toolInfo); ok(lResult, "Adding the tool to the tooltip failed\n"); /* Make tooltip appear quickly */ - SendMessage(hwndTip, TTM_SETDELAYTIME, TTDT_INITIAL, MAKELPARAM(1,0)); + SendMessageA(hwndTip, TTM_SETDELAYTIME, TTDT_INITIAL, MAKELPARAM(1,0)); /* Put cursor inside window, tooltip will appear immediately */ GetWindowRect( parent, &rect ); @@ -252,7 +252,7 @@ static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LP NMTTDISPINFOA *ttnmdi = (NMTTDISPINFOA*)lParam; if (ttnmdi->hdr.code == TTN_GETDISPINFOA) - lstrcpy(ttnmdi->lpszText, testcallbackA); + lstrcpyA(ttnmdi->lpszText, testcallbackA); } return DefWindowProcA(hwnd, message, wParam, lParam); @@ -268,7 +268,7 @@ static BOOL register_parent_wnd_class(void) cls.cbWndExtra = 0; cls.hInstance = GetModuleHandleA(NULL); cls.hIcon = 0; - cls.hCursor = LoadCursorA(0, IDC_ARROW); + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); cls.hbrBackground = GetStockObject(WHITE_BRUSH); cls.lpszMenuName = NULL; cls.lpszClassName = "Tooltips test parent class"; @@ -280,7 +280,7 @@ static HWND create_parent_window(void) if (!register_parent_wnd_class()) return NULL; - return CreateWindowEx(0, "Tooltips test parent class", + return CreateWindowExA(0, "Tooltips test parent class", "Tooltips test parent window", WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_VISIBLE, @@ -305,7 +305,7 @@ static void test_gettext(void) hwnd = CreateWindowExA(0, TOOLTIPS_CLASSA, NULL, 0, 10, 10, 300, 100, NULL, NULL, NULL, 0); - assert(hwnd); + ok(hwnd != NULL, "failed to create tooltip wnd\n"); /* use sizeof(TTTOOLINFOA) instead of TTTOOLINFOA_V1_SIZE so that adding it fails on Win9x */ /* otherwise it crashes on the NULL lpszText */ @@ -317,7 +317,7 @@ static void test_gettext(void) toolinfoA.lpszText = NULL; toolinfoA.lParam = 0xdeadbeef; GetClientRect(hwnd, &toolinfoA.rect); - r = SendMessageA(hwnd, TTM_ADDTOOL, 0, (LPARAM)&toolinfoA); + r = SendMessageA(hwnd, TTM_ADDTOOLA, 0, (LPARAM)&toolinfoA); if (r) { toolinfoA.hwnd = NULL; @@ -348,13 +348,13 @@ static void test_gettext(void) toolinfoA.lpszText = bufA; toolinfoA.lParam = 0xdeadbeef; GetClientRect(hwnd, &toolinfoA.rect); - r = SendMessageA(hwnd, TTM_ADDTOOL, 0, (LPARAM)&toolinfoA); + r = SendMessageA(hwnd, TTM_ADDTOOLA, 0, (LPARAM)&toolinfoA); ok(r, "Adding the tool to the tooltip failed\n"); if (r) { DWORD length; - length = SendMessage(hwnd, WM_GETTEXTLENGTH, 0, 0); + length = SendMessageA(hwnd, WM_GETTEXTLENGTH, 0, 0); ok(length == 0, "Expected 0, got %d\n", length); toolinfoA.hwnd = NULL; @@ -369,7 +369,7 @@ static void test_gettext(void) ok(strcmp(toolinfoA.lpszText, testtipA) == 0, "expected %s, got %p\n", testtipA, toolinfoA.lpszText); - length = SendMessage(hwnd, WM_GETTEXTLENGTH, 0, 0); + length = SendMessageA(hwnd, WM_GETTEXTLENGTH, 0, 0); ok(length == 0, "Expected 0, got %d\n", length); } @@ -382,7 +382,7 @@ static void test_gettext(void) toolinfoA.lpszText = LPSTR_TEXTCALLBACKA; toolinfoA.lParam = 0xdeadbeef; GetClientRect(hwnd, &toolinfoA.rect); - r = SendMessageA(hwnd, TTM_ADDTOOL, 0, (LPARAM)&toolinfoA); + r = SendMessageA(hwnd, TTM_ADDTOOLA, 0, (LPARAM)&toolinfoA); ok(r, "Adding the tool to the tooltip failed\n"); if (r) { @@ -411,8 +411,7 @@ static void test_gettext(void) win_skip("CreateWindowExW is not implemented\n"); return; } - - assert(hwnd); + ok(hwnd != NULL, "failed to create tooltip wnd\n"); toolinfoW.cbSize = sizeof(TTTOOLINFOW); toolinfoW.hwnd = NULL; @@ -422,8 +421,8 @@ static void test_gettext(void) toolinfoW.lpszText = NULL; toolinfoW.lParam = 0xdeadbeef; GetClientRect(hwnd, &toolinfoW.rect); - r = SendMessageW(hwnd, TTM_ADDTOOL, 0, (LPARAM)&toolinfoW); - ok(r, "Adding the tool to the tooltip failed\n"); + r = SendMessageW(hwnd, TTM_ADDTOOLW, 0, (LPARAM)&toolinfoW); + ok(!r, "Adding the tool to the tooltip succeeded!\n"); if (0) /* crashes on NT4 */ { @@ -505,16 +504,16 @@ static void test_ttm_gettoolinfo(void) ti.lpszText = NULL; ti.lParam = 0xdeadbeef; GetClientRect(hwnd, &ti.rect); - r = SendMessage(hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti); + r = SendMessageA(hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti); ok(r, "Adding the tool to the tooltip failed\n"); - r = SendMessage(hwnd, TTM_GETTOOLCOUNT, 0, 0); + r = SendMessageA(hwnd, TTM_GETTOOLCOUNT, 0, 0); expect(1, r); ti.cbSize = TTTOOLINFOA_V1_SIZE - 1; ti.hwnd = NULL; ti.uId = 0x1234ABCD; - SendMessage(hwnd, TTM_DELTOOLA, 0, (LPARAM)&ti); - r = SendMessage(hwnd, TTM_GETTOOLCOUNT, 0, 0); + SendMessageA(hwnd, TTM_DELTOOLA, 0, (LPARAM)&ti); + r = SendMessageA(hwnd, TTM_GETTOOLCOUNT, 0, 0); expect(0, r); ti.cbSize = TTTOOLINFOA_V2_SIZE - 1; @@ -525,16 +524,16 @@ static void test_ttm_gettoolinfo(void) ti.lpszText = NULL; ti.lParam = 0xdeadbeef; GetClientRect(hwnd, &ti.rect); - r = SendMessage(hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti); + r = SendMessageA(hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti); ok(r, "Adding the tool to the tooltip failed\n"); - r = SendMessage(hwnd, TTM_GETTOOLCOUNT, 0, 0); + r = SendMessageA(hwnd, TTM_GETTOOLCOUNT, 0, 0); expect(1, r); ti.cbSize = TTTOOLINFOA_V2_SIZE - 1; ti.hwnd = NULL; ti.uId = 0x1234ABCD; - SendMessage(hwnd, TTM_DELTOOLA, 0, (LPARAM)&ti); - r = SendMessage(hwnd, TTM_GETTOOLCOUNT, 0, 0); + SendMessageA(hwnd, TTM_DELTOOLA, 0, (LPARAM)&ti); + r = SendMessageA(hwnd, TTM_GETTOOLCOUNT, 0, 0); expect(0, r); ti.cbSize = TTTOOLINFOA_V2_SIZE + 1; @@ -545,16 +544,16 @@ static void test_ttm_gettoolinfo(void) ti.lpszText = NULL; ti.lParam = 0xdeadbeef; GetClientRect(hwnd, &ti.rect); - r = SendMessage(hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti); + r = SendMessageA(hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti); ok(r, "Adding the tool to the tooltip failed\n"); - r = SendMessage(hwnd, TTM_GETTOOLCOUNT, 0, 0); + r = SendMessageA(hwnd, TTM_GETTOOLCOUNT, 0, 0); expect(1, r); ti.cbSize = TTTOOLINFOA_V2_SIZE + 1; ti.hwnd = NULL; ti.uId = 0x1234ABCD; - SendMessage(hwnd, TTM_DELTOOLA, 0, (LPARAM)&ti); - r = SendMessage(hwnd, TTM_GETTOOLCOUNT, 0, 0); + SendMessageA(hwnd, TTM_DELTOOLA, 0, (LPARAM)&ti); + r = SendMessageA(hwnd, TTM_GETTOOLCOUNT, 0, 0); expect(0, r); DestroyWindow(hwnd); @@ -761,6 +760,62 @@ static void test_longtextW(void) DestroyWindow(hwnd); } +static BOOL almost_eq(int a, int b) +{ + return a-5b; +} + +static void test_track(void) +{ + WCHAR textW[] = {'t','e','x','t',0}; + TTTOOLINFOW info = { 0 }; + HWND parent, tt; + LRESULT res; + RECT pos; + + parent = CreateWindowExW(0, WC_STATICW, NULL, WS_CAPTION | WS_VISIBLE, + 50, 50, 300, 300, NULL, NULL, NULL, 0); + ok(parent != NULL, "creation of parent window failed\n"); + + ShowWindow(parent, SW_SHOWNORMAL); + flush_events(100); + + tt = CreateWindowExW(WS_EX_TOPMOST, TOOLTIPS_CLASSW, NULL, TTS_NOPREFIX | TTS_ALWAYSTIP, + CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, + parent, NULL, GetModuleHandleW(NULL), 0); + ok(tt != NULL, "creation of tooltip window failed\n"); + + info.cbSize = TTTOOLINFOW_V1_SIZE; + info.uFlags = TTF_IDISHWND | TTF_TRACK | TTF_ABSOLUTE; + info.hwnd = parent; + info.hinst = GetModuleHandleW(NULL); + info.lpszText = textW; + info.uId = (UINT_PTR)parent; + GetClientRect(parent, &info.rect); + + res = SendMessageW(tt, TTM_ADDTOOLW, 0, (LPARAM)&info); + ok(res, "adding the tool to the tooltip failed\n"); + + SendMessageW(tt, TTM_SETDELAYTIME, TTDT_INITIAL, MAKELPARAM(1,0)); + SendMessageW(tt, TTM_TRACKACTIVATE, (WPARAM)TRUE, (LPARAM)&info); + SendMessageW(tt, TTM_TRACKPOSITION, 0, MAKELPARAM(10, 10)); + + GetWindowRect(tt, &pos); + ok(almost_eq(pos.left, 10), "pos.left = %d\n", pos.left); + ok(almost_eq(pos.top, 10), "pos.top = %d\n", pos.top); + + info.uFlags = TTF_IDISHWND | TTF_ABSOLUTE; + SendMessageW(tt, TTM_SETTOOLINFOW, 0, (LPARAM)&info); + SendMessageW(tt, TTM_TRACKPOSITION, 0, MAKELPARAM(10, 10)); + + GetWindowRect(tt, &pos); + ok(!almost_eq(pos.left, 10), "pos.left = %d\n", pos.left); + ok(!almost_eq(pos.top, 10), "pos.top = %d\n", pos.top); + + DestroyWindow(tt); + DestroyWindow(parent); +} + START_TEST(tooltips) { InitCommonControls(); @@ -771,4 +826,5 @@ START_TEST(tooltips) test_ttm_gettoolinfo(); test_longtextA(); test_longtextW(); + test_track(); } diff --git a/rostests/winetests/comctl32/trackbar.c b/rostests/winetests/comctl32/trackbar.c index 92d224c3f6c..0583e5f6ef5 100644 --- a/rostests/winetests/comctl32/trackbar.c +++ b/rostests/winetests/comctl32/trackbar.c @@ -414,7 +414,7 @@ static BOOL register_parent_wnd_class(void){ cls.cbWndExtra = 0; cls.hInstance = GetModuleHandleA(NULL); cls.hIcon = 0; - cls.hCursor = LoadCursorA(0, IDC_ARROW); + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); cls.hbrBackground = GetStockObject(WHITE_BRUSH); cls.lpszMenuName = NULL; cls.lpszClassName = "Trackbar test parent class"; @@ -425,12 +425,9 @@ static HWND create_parent_window(void){ if (!register_parent_wnd_class()) return NULL; - return CreateWindowEx(0, "Trackbar test parent class", - "Trackbar test parent window", - WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | - WS_MAXIMIZEBOX | WS_VISIBLE, - 0, 0, 100, 100, - GetDesktopWindow(), NULL, GetModuleHandleA(NULL), NULL); + return CreateWindowA("Trackbar test parent class", "Trackbar test parent window", + WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_VISIBLE, + 0, 0, 100, 100, GetDesktopWindow(), NULL, GetModuleHandleA(NULL), NULL); } static LRESULT WINAPI trackbar_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){ @@ -462,10 +459,9 @@ static HWND create_trackbar(DWORD style, HWND parent){ RECT rect; GetClientRect(parent, &rect); - hWndTrack = CreateWindowEx( - 0, TRACKBAR_CLASS,"Trackbar Control", style, - rect.right,rect.bottom, 100, 50, - parent, NULL,GetModuleHandleA(NULL) ,NULL); + hWndTrack = CreateWindowA(TRACKBAR_CLASSA, "Trackbar Control", style, + rect.right, rect.bottom, 100, 50, + parent, NULL, GetModuleHandleA(NULL), NULL); if (!hWndTrack) return NULL; @@ -485,42 +481,40 @@ static void test_trackbar_buddy(HWND hWndTrackbar){ flush_sequences(sequences, NUM_MSG_SEQUENCE); - hWndLeftBuddy = CreateWindowEx(0, STATUSCLASSNAME, NULL, 0, - 0,0,300,20, NULL, NULL, NULL, NULL); + hWndLeftBuddy = CreateWindowA(STATUSCLASSNAMEA, NULL, 0, 0, 0, 300, 20, NULL, NULL, NULL, NULL); ok(hWndLeftBuddy != NULL, "Expected non NULL value\n"); if (hWndLeftBuddy != NULL){ - hWndCurrentBuddy = (HWND) SendMessage(hWndTrackbar, TBM_GETBUDDY, TRUE, 0); - rTest = (HWND) SendMessage(hWndTrackbar, TBM_SETBUDDY, FALSE, (LPARAM) hWndLeftBuddy); + hWndCurrentBuddy = (HWND) SendMessageA(hWndTrackbar, TBM_GETBUDDY, TRUE, 0); + rTest = (HWND) SendMessageA(hWndTrackbar, TBM_SETBUDDY, FALSE, (LPARAM) hWndLeftBuddy); ok(rTest == hWndCurrentBuddy, "Expected hWndCurrentBuddy\n"); - rTest = (HWND) SendMessage(hWndTrackbar, TBM_SETBUDDY, FALSE, (LPARAM) hWndLeftBuddy); + rTest = (HWND) SendMessageA(hWndTrackbar, TBM_SETBUDDY, FALSE, (LPARAM) hWndLeftBuddy); ok(rTest == hWndLeftBuddy, "Expected hWndLeftBuddy\n"); } else skip ("left buddy control not present?\n"); - hWndRightBuddy = CreateWindowEx(0, STATUSCLASSNAME, NULL, 0, - 0,0,300,20,NULL,NULL, NULL, NULL); + hWndRightBuddy = CreateWindowA(STATUSCLASSNAMEA, NULL, 0, 0, 0, 300, 20, NULL, NULL, NULL, NULL); ok(hWndRightBuddy != NULL, "expected non NULL value\n"); /* test TBM_SETBUDDY */ if (hWndRightBuddy != NULL){ - hWndCurrentBuddy = (HWND) SendMessage(hWndTrackbar, TBM_GETBUDDY, TRUE, 0); - rTest = (HWND) SendMessage(hWndTrackbar, TBM_SETBUDDY, TRUE, (LPARAM) hWndRightBuddy); + hWndCurrentBuddy = (HWND) SendMessageA(hWndTrackbar, TBM_GETBUDDY, TRUE, 0); + rTest = (HWND) SendMessageA(hWndTrackbar, TBM_SETBUDDY, TRUE, (LPARAM) hWndRightBuddy); ok(rTest == hWndCurrentBuddy, "Expected hWndCurrentBuddy\n"); - rTest = (HWND) SendMessage(hWndTrackbar, TBM_SETBUDDY, TRUE, (LPARAM) hWndRightBuddy); + rTest = (HWND) SendMessageA(hWndTrackbar, TBM_SETBUDDY, TRUE, (LPARAM) hWndRightBuddy); ok(rTest == hWndRightBuddy, "Expected hWndRightbuddy\n"); } else skip("Right buddy control not present?\n"); /* test TBM_GETBUDDY */ if (hWndLeftBuddy != NULL){ - rTest = (HWND) SendMessage(hWndTrackbar, TBM_GETBUDDY, FALSE, 0); + rTest = (HWND) SendMessageA(hWndTrackbar, TBM_GETBUDDY, FALSE, 0); ok(rTest == hWndLeftBuddy, "Expected hWndLeftBuddy\n"); DestroyWindow(hWndLeftBuddy); } if (hWndRightBuddy != NULL){ - rTest = (HWND) SendMessage(hWndTrackbar, TBM_GETBUDDY, TRUE,0); + rTest = (HWND) SendMessageA(hWndTrackbar, TBM_GETBUDDY, TRUE,0); ok(rTest == hWndRightBuddy, "Expected hWndRightBuddy\n"); DestroyWindow(hWndRightBuddy); } @@ -536,13 +530,13 @@ static void test_line_size(HWND hWndTrackbar){ flush_sequences(sequences, NUM_MSG_SEQUENCE); /* test TBM_SETLINESIZE */ - r = SendMessage(hWndTrackbar, TBM_SETLINESIZE, 0, 10); + r = SendMessageA(hWndTrackbar, TBM_SETLINESIZE, 0, 10); expect(1,r); - r = SendMessage(hWndTrackbar, TBM_SETLINESIZE, 0, 4); + r = SendMessageA(hWndTrackbar, TBM_SETLINESIZE, 0, 4); expect(10, r); /* test TBM_GETLINESIZE */ - r = SendMessage(hWndTrackbar, TBM_GETLINESIZE, 0,0); + r = SendMessageA(hWndTrackbar, TBM_GETLINESIZE, 0,0); expect(4, r); ok_sequence(sequences, TRACKBAR_SEQ_INDEX, line_size_test_seq, "linesize test sequence", FALSE); @@ -556,32 +550,32 @@ static void test_page_size(HWND hWndTrackbar){ flush_sequences(sequences, NUM_MSG_SEQUENCE); /* test TBM_SETPAGESIZE */ - r = SendMessage(hWndTrackbar, TBM_SETPAGESIZE, 0, 10); + r = SendMessageA(hWndTrackbar, TBM_SETPAGESIZE, 0, 10); expect(20, r); - r = SendMessage(hWndTrackbar, TBM_SETPAGESIZE, 0, -1); + r = SendMessageA(hWndTrackbar, TBM_SETPAGESIZE, 0, -1); expect(10, r); /* test TBM_GETPAGESIZE */ - r = SendMessage(hWndTrackbar, TBM_GETPAGESIZE, 0,0); + r = SendMessageA(hWndTrackbar, TBM_GETPAGESIZE, 0,0); expect(20, r); ok_sequence(sequences, TRACKBAR_SEQ_INDEX, page_size_test_seq, "page size test sequence", FALSE); ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "parent page size test sequence", FALSE); /* check for zero page size */ - r = SendMessage(hWndTrackbar, TBM_SETPAGESIZE, 0, 0); + r = SendMessageA(hWndTrackbar, TBM_SETPAGESIZE, 0, 0); expect(20, r); - r = SendMessage(hWndTrackbar, TBM_GETPAGESIZE, 0, 0); + r = SendMessageA(hWndTrackbar, TBM_GETPAGESIZE, 0, 0); expect(0, r); /* revert to default */ - r = SendMessage(hWndTrackbar, TBM_SETPAGESIZE, 0, -1); + r = SendMessageA(hWndTrackbar, TBM_SETPAGESIZE, 0, -1); expect(0, r); - r = SendMessage(hWndTrackbar, TBM_GETPAGESIZE, 0, 0); + r = SendMessageA(hWndTrackbar, TBM_GETPAGESIZE, 0, 0); expect(20, r); /* < -1 */ - r = SendMessage(hWndTrackbar, TBM_SETPAGESIZE, 0, -2); + r = SendMessageA(hWndTrackbar, TBM_SETPAGESIZE, 0, -2); expect(20, r); - r = SendMessage(hWndTrackbar, TBM_GETPAGESIZE, 0, 0); + r = SendMessageA(hWndTrackbar, TBM_GETPAGESIZE, 0, 0); expect(-2, r); } @@ -590,23 +584,23 @@ static void test_position(HWND hWndTrackbar){ flush_sequences(sequences, NUM_MSG_SEQUENCE); /* test TBM_SETPOS */ - SendMessage(hWndTrackbar, TBM_SETPOS, TRUE, -1); - r = SendMessage(hWndTrackbar, TBM_GETPOS, 0, 0); + SendMessageA(hWndTrackbar, TBM_SETPOS, TRUE, -1); + r = SendMessageA(hWndTrackbar, TBM_GETPOS, 0, 0); expect(0, r); - SendMessage(hWndTrackbar, TBM_SETPOS, TRUE, 5); - r = SendMessage(hWndTrackbar, TBM_GETPOS, 0,0); + SendMessageA(hWndTrackbar, TBM_SETPOS, TRUE, 5); + r = SendMessageA(hWndTrackbar, TBM_GETPOS, 0,0); expect(5, r); - SendMessage(hWndTrackbar, TBM_SETPOS, TRUE, 5); - SendMessage(hWndTrackbar, TBM_SETPOS, TRUE, 1000); - r = SendMessage(hWndTrackbar, TBM_GETPOS, 0,0); + SendMessageA(hWndTrackbar, TBM_SETPOS, TRUE, 5); + SendMessageA(hWndTrackbar, TBM_SETPOS, TRUE, 1000); + r = SendMessageA(hWndTrackbar, TBM_GETPOS, 0,0); expect(100, r); - SendMessage(hWndTrackbar, TBM_SETPOS, FALSE, 20); - r = SendMessage(hWndTrackbar, TBM_GETPOS, 0,0); + SendMessageA(hWndTrackbar, TBM_SETPOS, FALSE, 20); + r = SendMessageA(hWndTrackbar, TBM_GETPOS, 0,0); expect(20, r); - SendMessage(hWndTrackbar, TBM_SETPOS, TRUE, 20); + SendMessageA(hWndTrackbar, TBM_SETPOS, TRUE, 20); /* test TBM_GETPOS */ - r = SendMessage(hWndTrackbar, TBM_GETPOS, 0,0); + r = SendMessageA(hWndTrackbar, TBM_GETPOS, 0,0); expect(20, r); ok_sequence(sequences, TRACKBAR_SEQ_INDEX, position_test_seq, "position test sequence", TRUE); @@ -618,58 +612,58 @@ static void test_range(HWND hWndTrackbar){ flush_sequences(sequences, NUM_MSG_SEQUENCE); /* test TBM_SETRANGE */ - SendMessage(hWndTrackbar, TBM_SETRANGE, TRUE, MAKELONG(0, 10)); - r = SendMessage(hWndTrackbar, TBM_GETRANGEMAX, 0,0); + SendMessageA(hWndTrackbar, TBM_SETRANGE, TRUE, MAKELONG(0, 10)); + r = SendMessageA(hWndTrackbar, TBM_GETRANGEMAX, 0,0); expect(10, r); - r = SendMessage(hWndTrackbar, TBM_GETRANGEMIN, 0,0); + r = SendMessageA(hWndTrackbar, TBM_GETRANGEMIN, 0,0); expect(0, r); - SendMessage(hWndTrackbar, TBM_SETRANGE, TRUE, MAKELONG(-1, 1000)); - r = SendMessage(hWndTrackbar, TBM_GETRANGEMAX, 0,0); + SendMessageA(hWndTrackbar, TBM_SETRANGE, TRUE, MAKELONG(-1, 1000)); + r = SendMessageA(hWndTrackbar, TBM_GETRANGEMAX, 0,0); expect(1000, r); - r = SendMessage(hWndTrackbar, TBM_GETRANGEMIN, 0,0); + r = SendMessageA(hWndTrackbar, TBM_GETRANGEMIN, 0,0); expect(-1, r); - SendMessage(hWndTrackbar, TBM_SETRANGE, TRUE, MAKELONG(10, 0)); - r = SendMessage(hWndTrackbar, TBM_GETRANGEMAX, 0,0); + SendMessageA(hWndTrackbar, TBM_SETRANGE, TRUE, MAKELONG(10, 0)); + r = SendMessageA(hWndTrackbar, TBM_GETRANGEMAX, 0,0); expect(0, r); - r = SendMessage(hWndTrackbar, TBM_GETRANGEMIN, 0,0); + r = SendMessageA(hWndTrackbar, TBM_GETRANGEMIN, 0,0); expect(10, r); - SendMessage(hWndTrackbar, TBM_SETRANGE, FALSE, MAKELONG(0,10)); - r = SendMessage(hWndTrackbar, TBM_GETRANGEMAX, 0,0); + SendMessageA(hWndTrackbar, TBM_SETRANGE, FALSE, MAKELONG(0,10)); + r = SendMessageA(hWndTrackbar, TBM_GETRANGEMAX, 0,0); expect(10, r); - r = SendMessage(hWndTrackbar, TBM_GETRANGEMIN, 0,0); + r = SendMessageA(hWndTrackbar, TBM_GETRANGEMIN, 0,0); expect(0, r); /*test TBM_SETRANGEMAX */ - SendMessage(hWndTrackbar, TBM_SETRANGEMAX, TRUE, 10); - r = SendMessage(hWndTrackbar, TBM_GETRANGEMAX, 0,0); + SendMessageA(hWndTrackbar, TBM_SETRANGEMAX, TRUE, 10); + r = SendMessageA(hWndTrackbar, TBM_GETRANGEMAX, 0,0); expect(10, r); - SendMessage(hWndTrackbar, TBM_SETRANGEMAX, TRUE, -1); - r = SendMessage(hWndTrackbar, TBM_GETRANGEMAX, 0,0); + SendMessageA(hWndTrackbar, TBM_SETRANGEMAX, TRUE, -1); + r = SendMessageA(hWndTrackbar, TBM_GETRANGEMAX, 0,0); expect(-1, r); - SendMessage(hWndTrackbar, TBM_SETRANGEMAX, FALSE, 10); - r = SendMessage(hWndTrackbar, TBM_GETRANGEMAX, 0,0); + SendMessageA(hWndTrackbar, TBM_SETRANGEMAX, FALSE, 10); + r = SendMessageA(hWndTrackbar, TBM_GETRANGEMAX, 0,0); expect(10, r); /* testing TBM_SETRANGEMIN */ - SendMessage(hWndTrackbar, TBM_SETRANGEMIN, TRUE, 0); - r = SendMessage(hWndTrackbar, TBM_GETRANGEMIN, 0,0); + SendMessageA(hWndTrackbar, TBM_SETRANGEMIN, TRUE, 0); + r = SendMessageA(hWndTrackbar, TBM_GETRANGEMIN, 0,0); expect(0, r); - SendMessage(hWndTrackbar, TBM_SETRANGEMIN, TRUE, 10); - r = SendMessage(hWndTrackbar, TBM_GETRANGEMIN, 0,0); + SendMessageA(hWndTrackbar, TBM_SETRANGEMIN, TRUE, 10); + r = SendMessageA(hWndTrackbar, TBM_GETRANGEMIN, 0,0); expect(10, r); - SendMessage(hWndTrackbar, TBM_SETRANGEMIN, TRUE, -10); - r = SendMessage(hWndTrackbar, TBM_GETRANGEMIN, 0,0); + SendMessageA(hWndTrackbar, TBM_SETRANGEMIN, TRUE, -10); + r = SendMessageA(hWndTrackbar, TBM_GETRANGEMIN, 0,0); expect(-10, r); - SendMessage(hWndTrackbar, TBM_SETRANGEMIN, FALSE, 5); - r = SendMessage(hWndTrackbar, TBM_GETRANGEMIN, 0,0); + SendMessageA(hWndTrackbar, TBM_SETRANGEMIN, FALSE, 5); + r = SendMessageA(hWndTrackbar, TBM_GETRANGEMIN, 0,0); expect(5, r); /* test TBM_GETRANGEMAX */ - r = SendMessage(hWndTrackbar, TBM_GETRANGEMAX, 0,0); + r = SendMessageA(hWndTrackbar, TBM_GETRANGEMAX, 0,0); expect(10, r); /* test TBM_GETRANGEMIN */ - r = SendMessage(hWndTrackbar, TBM_GETRANGEMIN, 0,0); + r = SendMessageA(hWndTrackbar, TBM_GETRANGEMIN, 0,0); expect(5, r); ok_sequence(sequences, TRACKBAR_SEQ_INDEX, range_test_seq, "range test sequence", TRUE); @@ -681,60 +675,60 @@ static void test_selection(HWND hWndTrackbar){ flush_sequences(sequences, NUM_MSG_SEQUENCE); /* test TBM_SETSEL */ - SendMessage(hWndTrackbar, TBM_SETSEL, TRUE, MAKELONG(0,10)); - r = SendMessage(hWndTrackbar, TBM_GETSELEND, 0,0); + SendMessageA(hWndTrackbar, TBM_SETSEL, TRUE, MAKELONG(0,10)); + r = SendMessageA(hWndTrackbar, TBM_GETSELEND, 0,0); expect(10, r); - r = SendMessage(hWndTrackbar, TBM_GETSELSTART, 0,0); + r = SendMessageA(hWndTrackbar, TBM_GETSELSTART, 0,0); expect(5, r); - SendMessage(hWndTrackbar, TBM_SETSEL, TRUE, MAKELONG(5, 20)); - r = SendMessage(hWndTrackbar, TBM_GETSELEND, 0,0); + SendMessageA(hWndTrackbar, TBM_SETSEL, TRUE, MAKELONG(5, 20)); + r = SendMessageA(hWndTrackbar, TBM_GETSELEND, 0,0); expect(10, r); - r = SendMessage(hWndTrackbar, TBM_GETSELSTART, 0,0); + r = SendMessageA(hWndTrackbar, TBM_GETSELSTART, 0,0); expect(5, r); - SendMessage(hWndTrackbar, TBM_SETSEL, FALSE, MAKELONG(5, 10)); - r = SendMessage(hWndTrackbar, TBM_GETSELEND, 0,0); + SendMessageA(hWndTrackbar, TBM_SETSEL, FALSE, MAKELONG(5, 10)); + r = SendMessageA(hWndTrackbar, TBM_GETSELEND, 0,0); expect(10, r); - r = SendMessage(hWndTrackbar, TBM_GETSELSTART, 0,0); + r = SendMessageA(hWndTrackbar, TBM_GETSELSTART, 0,0); expect(5, r); /* test TBM_SETSELEND */ - SendMessage(hWndTrackbar, TBM_SETSELEND, TRUE, 10); - r = SendMessage(hWndTrackbar, TBM_GETSELEND, 0,0); + SendMessageA(hWndTrackbar, TBM_SETSELEND, TRUE, 10); + r = SendMessageA(hWndTrackbar, TBM_GETSELEND, 0,0); expect(10, r); - SendMessage(hWndTrackbar, TBM_SETSELEND, TRUE, 20); - r = SendMessage(hWndTrackbar, TBM_GETSELEND, 0,0); + SendMessageA(hWndTrackbar, TBM_SETSELEND, TRUE, 20); + r = SendMessageA(hWndTrackbar, TBM_GETSELEND, 0,0); expect(10, r); - SendMessage(hWndTrackbar, TBM_SETSELEND, TRUE, 4); - r = SendMessage(hWndTrackbar, TBM_GETSELEND, 0,0); + SendMessageA(hWndTrackbar, TBM_SETSELEND, TRUE, 4); + r = SendMessageA(hWndTrackbar, TBM_GETSELEND, 0,0); expect(4, r); - SendMessage(hWndTrackbar, TBM_SETSELEND, FALSE, 2); - r = SendMessage(hWndTrackbar, TBM_GETSELEND, 0,0); + SendMessageA(hWndTrackbar, TBM_SETSELEND, FALSE, 2); + r = SendMessageA(hWndTrackbar, TBM_GETSELEND, 0,0); expect(2, r); /* test TBM_GETSELEND */ - r = SendMessage(hWndTrackbar, TBM_GETSELEND, 0,0); + r = SendMessageA(hWndTrackbar, TBM_GETSELEND, 0,0); expect(2, r); /* testing TBM_SETSELSTART */ - SendMessage(hWndTrackbar, TBM_SETSELSTART, TRUE, 5); - r = SendMessage(hWndTrackbar, TBM_GETSELSTART, 0,0); + SendMessageA(hWndTrackbar, TBM_SETSELSTART, TRUE, 5); + r = SendMessageA(hWndTrackbar, TBM_GETSELSTART, 0,0); expect(5, r); - SendMessage(hWndTrackbar, TBM_SETSELSTART, TRUE, 0); - r = SendMessage(hWndTrackbar, TBM_GETSELSTART, 0,0); + SendMessageA(hWndTrackbar, TBM_SETSELSTART, TRUE, 0); + r = SendMessageA(hWndTrackbar, TBM_GETSELSTART, 0,0); expect(5, r); - SendMessage(hWndTrackbar, TBM_SETSELSTART, TRUE, 20); - r = SendMessage(hWndTrackbar, TBM_GETSELSTART, 0,0); + SendMessageA(hWndTrackbar, TBM_SETSELSTART, TRUE, 20); + r = SendMessageA(hWndTrackbar, TBM_GETSELSTART, 0,0); expect(20, r); - SendMessage(hWndTrackbar, TBM_SETSELSTART, FALSE, 8); - r = SendMessage(hWndTrackbar, TBM_GETSELSTART, 0,0); + SendMessageA(hWndTrackbar, TBM_SETSELSTART, FALSE, 8); + r = SendMessageA(hWndTrackbar, TBM_GETSELSTART, 0,0); expect(8, r); /* test TBM_GETSELSTART */ - r = SendMessage(hWndTrackbar, TBM_GETSELSTART, 0,0); + r = SendMessageA(hWndTrackbar, TBM_GETSELSTART, 0,0); expect(8, r); ok_sequence(sequences, TRACKBAR_SEQ_INDEX, selection_test_seq, "selection test sequence", TRUE); - ok_sequence(sequences, PARENT_SEQ_INDEX, parent_selection_test_seq, "parent selection test seqence", TRUE); + ok_sequence(sequences, PARENT_SEQ_INDEX, parent_selection_test_seq, "parent selection test sequence", TRUE); } static void test_thumb_length(HWND hWndTrackbar){ @@ -742,24 +736,24 @@ static void test_thumb_length(HWND hWndTrackbar){ flush_sequences(sequences, NUM_MSG_SEQUENCE); /* testing TBM_SETTHUMBLENGTH */ - SendMessage(hWndTrackbar, TBM_SETTHUMBLENGTH, 15, 0); - r = SendMessage(hWndTrackbar, TBM_GETTHUMBLENGTH, 0,0); + SendMessageA(hWndTrackbar, TBM_SETTHUMBLENGTH, 15, 0); + r = SendMessageA(hWndTrackbar, TBM_GETTHUMBLENGTH, 0,0); expect(15, r); - SendMessage(hWndTrackbar, TBM_SETTHUMBLENGTH, 20, 0); - r = SendMessage(hWndTrackbar, TBM_GETTHUMBLENGTH, 0,0); + SendMessageA(hWndTrackbar, TBM_SETTHUMBLENGTH, 20, 0); + r = SendMessageA(hWndTrackbar, TBM_GETTHUMBLENGTH, 0,0); expect(20, r); /* test TBM_GETTHUMBLENGTH */ - r = SendMessage(hWndTrackbar, TBM_GETTHUMBLENGTH, 0,0); + r = SendMessageA(hWndTrackbar, TBM_GETTHUMBLENGTH, 0,0); expect(20, r); - r = SendMessage(hWndTrackbar, WM_SIZE, 0,0); + r = SendMessageA(hWndTrackbar, WM_SIZE, 0,0); expect(0, r); - r = SendMessage(hWndTrackbar, TBM_GETTHUMBLENGTH, 0,0); + r = SendMessageA(hWndTrackbar, TBM_GETTHUMBLENGTH, 0,0); expect(20, r); - r = SendMessage(hWndTrackbar, WM_SIZE, 0, MAKELPARAM(50, 50) ); + r = SendMessageA(hWndTrackbar, WM_SIZE, 0, MAKELPARAM(50, 50) ); expect(0, r); - r = SendMessage(hWndTrackbar, TBM_GETTHUMBLENGTH, 0,0); + r = SendMessageA(hWndTrackbar, TBM_GETTHUMBLENGTH, 0,0); expect(20, r); ok_sequence(sequences, TRACKBAR_SEQ_INDEX, thumb_length_test_seq, "thumb length test sequence", TRUE); @@ -772,59 +766,59 @@ static void test_tic_settings(HWND hWndTrackbar){ /* testing TBM_SETTIC */ /* Set tics at 5 and 10 */ /* 0 and 20 are out of range and should not be set */ - r = SendMessage(hWndTrackbar, TBM_GETRANGEMAX, 0, 0); + r = SendMessageA(hWndTrackbar, TBM_GETRANGEMAX, 0, 0); expect(10, r); - r = SendMessage(hWndTrackbar, TBM_GETRANGEMIN, 0, 0); + r = SendMessageA(hWndTrackbar, TBM_GETRANGEMIN, 0, 0); expect(5, r); flush_sequences(sequences, NUM_MSG_SEQUENCE); - r = SendMessage(hWndTrackbar, TBM_SETTIC, 0, 0); + r = SendMessageA(hWndTrackbar, TBM_SETTIC, 0, 0); ok(r == FALSE, "Expected FALSE, got %d\n", r); - r = SendMessage(hWndTrackbar, TBM_SETTIC, 0, 5); + r = SendMessageA(hWndTrackbar, TBM_SETTIC, 0, 5); ok(r == TRUE, "Expected TRUE, got %d\n", r); - r = SendMessage(hWndTrackbar, TBM_SETTIC, 0, 10); + r = SendMessageA(hWndTrackbar, TBM_SETTIC, 0, 10); ok(r == TRUE, "Expected TRUE, got %d\n", r); - r = SendMessage(hWndTrackbar, TBM_SETTIC, 0, 20); - ok(r == FALSE, "Expected False, got %d\n", r); + r = SendMessageA(hWndTrackbar, TBM_SETTIC, 0, 20); + ok(r == FALSE, "Expected FALSE, got %d\n", r); /* test TBM_SETTICFREQ */ - SendMessage(hWndTrackbar, TBM_SETRANGE, TRUE, MAKELONG(0, 10)); - SendMessage(hWndTrackbar, TBM_SETTICFREQ, 2, 0); - r = SendMessage(hWndTrackbar, TBM_GETNUMTICS, 0, 0); + SendMessageA(hWndTrackbar, TBM_SETRANGE, TRUE, MAKELONG(0, 10)); + SendMessageA(hWndTrackbar, TBM_SETTICFREQ, 2, 0); + r = SendMessageA(hWndTrackbar, TBM_GETNUMTICS, 0, 0); expect(6, r); - SendMessage(hWndTrackbar, TBM_SETTICFREQ, 5, 0); - r = SendMessage(hWndTrackbar, TBM_GETNUMTICS, 0, 0); + SendMessageA(hWndTrackbar, TBM_SETTICFREQ, 5, 0); + r = SendMessageA(hWndTrackbar, TBM_GETNUMTICS, 0, 0); expect(3, r); - SendMessage(hWndTrackbar, TBM_SETTICFREQ, 15, 0); - r = SendMessage(hWndTrackbar, TBM_GETNUMTICS, 0, 0); + SendMessageA(hWndTrackbar, TBM_SETTICFREQ, 15, 0); + r = SendMessageA(hWndTrackbar, TBM_GETNUMTICS, 0, 0); expect(2, r); /* test TBM_GETNUMTICS */ /* since TIC FREQ is 15, there should be only 2 tics now */ - r = SendMessage(hWndTrackbar, TBM_GETNUMTICS, 0, 0); + r = SendMessageA(hWndTrackbar, TBM_GETNUMTICS, 0, 0); expect(2, r); ok_sequence(sequences, TRACKBAR_SEQ_INDEX, tic_settings_test_seq, "tic settings test sequence", TRUE); ok_sequence(sequences, PARENT_SEQ_INDEX, parent_tic_settings_test_seq, "parent tic settings test sequence", TRUE); /* range [0,0], freq = 1 */ - SendMessage(hWndTrackbar, TBM_SETRANGEMAX, TRUE, 0); - SendMessage(hWndTrackbar, TBM_SETRANGEMIN, TRUE, 0); - SendMessage(hWndTrackbar, TBM_SETTICFREQ, 1, 0); - r = SendMessage(hWndTrackbar, TBM_GETNUMTICS, 0, 0); + SendMessageA(hWndTrackbar, TBM_SETRANGEMAX, TRUE, 0); + SendMessageA(hWndTrackbar, TBM_SETRANGEMIN, TRUE, 0); + SendMessageA(hWndTrackbar, TBM_SETTICFREQ, 1, 0); + r = SendMessageA(hWndTrackbar, TBM_GETNUMTICS, 0, 0); expect(2, r); /* range [0,1], freq = 1 */ - SendMessage(hWndTrackbar, TBM_SETRANGEMAX, TRUE, 1); - SendMessage(hWndTrackbar, TBM_SETRANGEMIN, TRUE, 0); - SendMessage(hWndTrackbar, TBM_SETTICFREQ, 1, 0); - r = SendMessage(hWndTrackbar, TBM_GETNUMTICS, 0, 0); + SendMessageA(hWndTrackbar, TBM_SETRANGEMAX, TRUE, 1); + SendMessageA(hWndTrackbar, TBM_SETRANGEMIN, TRUE, 0); + SendMessageA(hWndTrackbar, TBM_SETTICFREQ, 1, 0); + r = SendMessageA(hWndTrackbar, TBM_GETNUMTICS, 0, 0); expect(2, r); /* range [0,2], freq = 1 */ - SendMessage(hWndTrackbar, TBM_SETRANGEMAX, TRUE, 2); - SendMessage(hWndTrackbar, TBM_SETRANGEMIN, TRUE, 0); - SendMessage(hWndTrackbar, TBM_SETTICFREQ, 1, 0); - r = SendMessage(hWndTrackbar, TBM_GETNUMTICS, 0, 0); + SendMessageA(hWndTrackbar, TBM_SETRANGEMAX, TRUE, 2); + SendMessageA(hWndTrackbar, TBM_SETRANGEMIN, TRUE, 0); + SendMessageA(hWndTrackbar, TBM_SETTICFREQ, 1, 0); + r = SendMessageA(hWndTrackbar, TBM_GETNUMTICS, 0, 0); expect(3, r); } @@ -833,32 +827,32 @@ static void test_tic_placement(HWND hWndTrackbar){ DWORD *rPTics; DWORD numtics; - SendMessage(hWndTrackbar, TBM_SETRANGE, TRUE, MAKELONG(1, 6)); - SendMessage(hWndTrackbar, TBM_SETTICFREQ, 1, 0); + SendMessageA(hWndTrackbar, TBM_SETRANGE, TRUE, MAKELONG(1, 6)); + SendMessageA(hWndTrackbar, TBM_SETTICFREQ, 1, 0); - numtics = SendMessage(hWndTrackbar, TBM_GETNUMTICS, 0, 0); + numtics = SendMessageA(hWndTrackbar, TBM_GETNUMTICS, 0, 0); ok(numtics == 6, "Expected 6, got %d\n", numtics); flush_sequences(sequences, NUM_MSG_SEQUENCE); /* test TBM_GETPTICS */ - rPTics = (DWORD *) SendMessage(hWndTrackbar, TBM_GETPTICS, 0,0); + rPTics = (DWORD *) SendMessageA(hWndTrackbar, TBM_GETPTICS, 0,0); expect(2, rPTics[0]); expect(3, rPTics[1]); expect(4, rPTics[2]); expect(5, rPTics[3]); /* test TBM_GETTIC */ - r = SendMessage(hWndTrackbar, TBM_GETTIC, 0,0); + r = SendMessageA(hWndTrackbar, TBM_GETTIC, 0,0); expect(2, r); - r = SendMessage(hWndTrackbar, TBM_GETTIC, 2,0); + r = SendMessageA(hWndTrackbar, TBM_GETTIC, 2,0); expect(4, r); - r = SendMessage(hWndTrackbar, TBM_GETTIC, 4,0); + r = SendMessageA(hWndTrackbar, TBM_GETTIC, 4,0); expect(-1, r); /* test TBM_GETTICPIC */ - r = SendMessage(hWndTrackbar, TBM_GETTICPOS, 0, 0); + r = SendMessageA(hWndTrackbar, TBM_GETTICPOS, 0, 0); ok(r > 0, "Expected r > 0, got %d\n", r); - r = SendMessage(hWndTrackbar, TBM_GETTICPOS, 2, 0); + r = SendMessageA(hWndTrackbar, TBM_GETTICPOS, 2, 0); ok(r > 0, "Expected r > 0, got %d\n", r); ok_sequence(sequences, TRACKBAR_SEQ_INDEX, tic_placement_test_seq, "get tic placement test sequence", FALSE); @@ -873,36 +867,36 @@ static void test_tool_tips(HWND hWndTrackbar){ flush_sequences(sequences, NUM_MSG_SEQUENCE); /* testing TBM_SETTIPSIDE */ - r = SendMessage(hWndTrackbar, TBM_SETTIPSIDE, TBTS_TOP, 0); + r = SendMessageA(hWndTrackbar, TBM_SETTIPSIDE, TBTS_TOP, 0); expect(TBTS_TOP, r); - r = SendMessage(hWndTrackbar, TBM_SETTIPSIDE, TBTS_LEFT, 0); + r = SendMessageA(hWndTrackbar, TBM_SETTIPSIDE, TBTS_LEFT, 0); expect(TBTS_TOP, r); - r = SendMessage(hWndTrackbar, TBM_SETTIPSIDE, TBTS_BOTTOM, 0); + r = SendMessageA(hWndTrackbar, TBM_SETTIPSIDE, TBTS_BOTTOM, 0); expect(TBTS_LEFT, r); - r = SendMessage(hWndTrackbar, TBM_SETTIPSIDE, TBTS_RIGHT, 0); + r = SendMessageA(hWndTrackbar, TBM_SETTIPSIDE, TBTS_RIGHT, 0); expect(TBTS_BOTTOM, r); /* testing TBM_SETTOOLTIPS */ - hWndTooltip = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, NULL, 0, - CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - NULL, NULL, NULL, NULL); + hWndTooltip = CreateWindowExA(WS_EX_TOPMOST, TOOLTIPS_CLASSA, NULL, 0, + CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, + NULL, NULL, NULL, NULL); ok(hWndTooltip != NULL, "Expected non NULL value\n"); if (hWndTooltip != NULL){ - SendMessage(hWndTrackbar, TBM_SETTOOLTIPS, (LPARAM) hWndTooltip, 0); - rTest = (HWND) SendMessage(hWndTrackbar, TBM_GETTOOLTIPS, 0,0); + SendMessageA(hWndTrackbar, TBM_SETTOOLTIPS, (LPARAM) hWndTooltip, 0); + rTest = (HWND) SendMessageA(hWndTrackbar, TBM_GETTOOLTIPS, 0,0); ok(rTest == hWndTooltip, "Expected hWndToolTip, got\n"); - SendMessage(hWndTrackbar, TBM_SETTOOLTIPS, 0, 0); - rTest = (HWND) SendMessage(hWndTrackbar, TBM_GETTOOLTIPS, 0,0); + SendMessageA(hWndTrackbar, TBM_SETTOOLTIPS, 0, 0); + rTest = (HWND) SendMessageA(hWndTrackbar, TBM_GETTOOLTIPS, 0,0); ok(rTest == NULL, "Expected NULL\n"); - SendMessage(hWndTrackbar, TBM_SETTOOLTIPS, (LPARAM) hWndTooltip, 5); - rTest = (HWND) SendMessage(hWndTrackbar, TBM_GETTOOLTIPS, 0,0); + SendMessageA(hWndTrackbar, TBM_SETTOOLTIPS, (LPARAM) hWndTooltip, 5); + rTest = (HWND) SendMessageA(hWndTrackbar, TBM_GETTOOLTIPS, 0,0); ok(rTest == hWndTooltip, "Expected hWndTooltip, got\n"); } else skip("tool tip control not present?\n"); /* test TBM_GETTOOLTIPS */ - rTest = (HWND) SendMessage(hWndTrackbar, TBM_GETTOOLTIPS, 0,0); + rTest = (HWND) SendMessageA(hWndTrackbar, TBM_GETTOOLTIPS, 0,0); ok(rTest == hWndTooltip, "Expected hWndTooltip\n"); ok_sequence(sequences, TRACKBAR_SEQ_INDEX, tool_tips_test_seq, "tool tips test sequence", FALSE); @@ -915,13 +909,13 @@ static void test_unicode(HWND hWndTrackbar){ flush_sequences(sequences, NUM_MSG_SEQUENCE); /* testing TBM_SETUNICODEFORMAT */ - r = SendMessage(hWndTrackbar, TBM_SETUNICODEFORMAT, TRUE, 0); + r = SendMessageA(hWndTrackbar, TBM_SETUNICODEFORMAT, TRUE, 0); ok(r == FALSE, "Expected FALSE, got %d\n",r); - r = SendMessage(hWndTrackbar, TBM_SETUNICODEFORMAT, FALSE, 0); + r = SendMessageA(hWndTrackbar, TBM_SETUNICODEFORMAT, FALSE, 0); ok(r == TRUE, "Expected TRUE, got %d\n",r); /* test TBM_GETUNICODEFORMAT */ - r = SendMessage(hWndTrackbar, TBM_GETUNICODEFORMAT, 0,0); + r = SendMessageA(hWndTrackbar, TBM_GETUNICODEFORMAT, 0,0); ok(r == FALSE, "Expected FALSE, got %d\n",r); ok_sequence(sequences, TRACKBAR_SEQ_INDEX, unicode_test_seq, "unicode test sequence", FALSE); @@ -933,37 +927,37 @@ static void test_ignore_selection(HWND hWndTrackbar){ flush_sequences(sequences, NUM_MSG_SEQUENCE); /* test TBM_SETSEL ensure that it is ignored */ - SendMessage(hWndTrackbar, TBM_SETSEL, TRUE, MAKELONG(0,10)); - r = SendMessage(hWndTrackbar, TBM_GETSELEND, 0,0); + SendMessageA(hWndTrackbar, TBM_SETSEL, TRUE, MAKELONG(0,10)); + r = SendMessageA(hWndTrackbar, TBM_GETSELEND, 0,0); expect(0, r); - r = SendMessage(hWndTrackbar, TBM_GETSELSTART, 0,0); + r = SendMessageA(hWndTrackbar, TBM_GETSELSTART, 0,0); expect(0, r); - SendMessage(hWndTrackbar, TBM_SETSEL, FALSE, MAKELONG(0,10)); - r = SendMessage(hWndTrackbar, TBM_GETSELEND, 0,0); + SendMessageA(hWndTrackbar, TBM_SETSEL, FALSE, MAKELONG(0,10)); + r = SendMessageA(hWndTrackbar, TBM_GETSELEND, 0,0); expect(0, r); - r = SendMessage(hWndTrackbar, TBM_GETSELSTART, 0,0); + r = SendMessageA(hWndTrackbar, TBM_GETSELSTART, 0,0); expect(0, r); /* test TBM_SETSELEND, ensure that it is ignored */ - SendMessage(hWndTrackbar, TBM_SETSELEND, TRUE, 0); - r = SendMessage(hWndTrackbar, TBM_GETSELEND, 0,0); + SendMessageA(hWndTrackbar, TBM_SETSELEND, TRUE, 0); + r = SendMessageA(hWndTrackbar, TBM_GETSELEND, 0,0); expect(0, r); - SendMessage(hWndTrackbar, TBM_SETSELEND, TRUE, 10); - r = SendMessage(hWndTrackbar, TBM_GETSELEND, 0,0); + SendMessageA(hWndTrackbar, TBM_SETSELEND, TRUE, 10); + r = SendMessageA(hWndTrackbar, TBM_GETSELEND, 0,0); expect(0,r); - SendMessage(hWndTrackbar, TBM_SETSELEND, FALSE, 0); - r = SendMessage(hWndTrackbar, TBM_GETSELEND, 0,0); + SendMessageA(hWndTrackbar, TBM_SETSELEND, FALSE, 0); + r = SendMessageA(hWndTrackbar, TBM_GETSELEND, 0,0); expect(0, r); /* test TBM_SETSELSTART, ensure that it is ignored */ - SendMessage(hWndTrackbar, TBM_SETSELSTART, TRUE, 0); - r = SendMessage(hWndTrackbar, TBM_GETSELSTART, 0,0); + SendMessageA(hWndTrackbar, TBM_SETSELSTART, TRUE, 0); + r = SendMessageA(hWndTrackbar, TBM_GETSELSTART, 0,0); expect(0, r); - SendMessage(hWndTrackbar, TBM_SETSELSTART, TRUE, 10); - r = SendMessage(hWndTrackbar, TBM_GETSELSTART, 0,0); + SendMessageA(hWndTrackbar, TBM_SETSELSTART, TRUE, 10); + r = SendMessageA(hWndTrackbar, TBM_GETSELSTART, 0,0); expect(0,r); - SendMessage(hWndTrackbar, TBM_SETSELSTART, FALSE, 0); - r = SendMessage(hWndTrackbar, TBM_GETSELSTART, 0,0); + SendMessageA(hWndTrackbar, TBM_SETSELSTART, FALSE, 0); + r = SendMessageA(hWndTrackbar, TBM_GETSELSTART, 0,0); expect(0, r); ok_sequence(sequences, TRACKBAR_SEQ_INDEX, ignore_selection_test_seq, "ignore selection setting test sequence", FALSE); @@ -977,27 +971,27 @@ static void test_initial_state(void) hWnd = create_trackbar(0, hWndParent); - ret = SendMessage(hWnd, TBM_GETNUMTICS, 0, 0); + ret = SendMessageA(hWnd, TBM_GETNUMTICS, 0, 0); expect(2, ret); - ret = SendMessage(hWnd, TBM_GETTIC, 0, 0); + ret = SendMessageA(hWnd, TBM_GETTIC, 0, 0); expect(-1, ret); - ret = SendMessage(hWnd, TBM_GETTICPOS, 0, 0); + ret = SendMessageA(hWnd, TBM_GETTICPOS, 0, 0); expect(-1, ret); - ret = SendMessage(hWnd, TBM_GETRANGEMIN, 0, 0); + ret = SendMessageA(hWnd, TBM_GETRANGEMIN, 0, 0); expect(0, ret); - ret = SendMessage(hWnd, TBM_GETRANGEMAX, 0, 0); + ret = SendMessageA(hWnd, TBM_GETRANGEMAX, 0, 0); expect(100, ret); - ret = SendMessage(hWnd, TBM_SETRANGEMAX, TRUE, 200); + ret = SendMessageA(hWnd, TBM_SETRANGEMAX, TRUE, 200); expect(0, ret); - ret = SendMessage(hWnd, TBM_GETNUMTICS, 0, 0); + ret = SendMessageA(hWnd, TBM_GETNUMTICS, 0, 0); expect(2, ret); - ret = SendMessage(hWnd, TBM_SETRANGEMIN, TRUE, 10); + ret = SendMessageA(hWnd, TBM_SETRANGEMIN, TRUE, 10); expect(0, ret); - ret = SendMessage(hWnd, TBM_GETNUMTICS, 0, 0); + ret = SendMessageA(hWnd, TBM_GETNUMTICS, 0, 0); expect(2, ret); DestroyWindow(hWnd); @@ -1010,38 +1004,38 @@ static void test_TBS_AUTOTICKS(void) hWnd = create_trackbar(TBS_AUTOTICKS, hWndParent); - ret = SendMessage(hWnd, TBM_GETNUMTICS, 0, 0); + ret = SendMessageA(hWnd, TBM_GETNUMTICS, 0, 0); expect(2, ret); - ret = SendMessage(hWnd, TBM_GETTIC, 0, 0); + ret = SendMessageA(hWnd, TBM_GETTIC, 0, 0); expect(-1, ret); - ret = SendMessage(hWnd, TBM_GETTICPOS, 0, 0); + ret = SendMessageA(hWnd, TBM_GETTICPOS, 0, 0); expect(-1, ret); - ret = SendMessage(hWnd, TBM_GETRANGEMIN, 0, 0); + ret = SendMessageA(hWnd, TBM_GETRANGEMIN, 0, 0); expect(0, ret); - ret = SendMessage(hWnd, TBM_GETRANGEMAX, 0, 0); + ret = SendMessageA(hWnd, TBM_GETRANGEMAX, 0, 0); expect(100, ret); /* TBM_SETRANGEMAX rebuilds tics */ - ret = SendMessage(hWnd, TBM_SETRANGEMAX, TRUE, 200); + ret = SendMessageA(hWnd, TBM_SETRANGEMAX, TRUE, 200); expect(0, ret); - ret = SendMessage(hWnd, TBM_GETNUMTICS, 0, 0); + ret = SendMessageA(hWnd, TBM_GETNUMTICS, 0, 0); expect(201, ret); /* TBM_SETRANGEMIN rebuilds tics */ - ret = SendMessage(hWnd, TBM_SETRANGEMAX, TRUE, 100); + ret = SendMessageA(hWnd, TBM_SETRANGEMAX, TRUE, 100); expect(0, ret); - ret = SendMessage(hWnd, TBM_SETRANGEMIN, TRUE, 10); + ret = SendMessageA(hWnd, TBM_SETRANGEMIN, TRUE, 10); expect(0, ret); - ret = SendMessage(hWnd, TBM_GETNUMTICS, 0, 0); + ret = SendMessageA(hWnd, TBM_GETNUMTICS, 0, 0); expect(91, ret); - ret = SendMessage(hWnd, TBM_SETRANGEMIN, TRUE, 0); + ret = SendMessageA(hWnd, TBM_SETRANGEMIN, TRUE, 0); expect(0, ret); /* TBM_SETRANGE rebuilds tics */ - ret = SendMessage(hWnd, TBM_SETRANGE, TRUE, MAKELONG(10, 200)); + ret = SendMessageA(hWnd, TBM_SETRANGE, TRUE, MAKELONG(10, 200)); expect(0, ret); - ret = SendMessage(hWnd, TBM_GETNUMTICS, 0, 0); + ret = SendMessageA(hWnd, TBM_GETNUMTICS, 0, 0); expect(191, ret); DestroyWindow(hWnd); diff --git a/rostests/winetests/comctl32/treeview.c b/rostests/winetests/comctl32/treeview.c index 3c437de8d79..684543cd8a9 100644 --- a/rostests/winetests/comctl32/treeview.c +++ b/rostests/winetests/comctl32/treeview.c @@ -18,7 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include #include #include "windef.h" @@ -27,7 +26,7 @@ #include "winuser.h" #include "winnls.h" #include "winreg.h" -#include "commctrl.h" +#include "wine/commctrl.h" #include "wine/test.h" #include "v6util.h" @@ -52,8 +51,8 @@ static struct msg_sequence *sequences[NUM_MSG_SEQUENCES]; static struct msg_sequence *item_sequence[1]; static const struct message FillRootSeq[] = { - { TVM_INSERTITEM, sent }, - { TVM_INSERTITEM, sent }, + { TVM_INSERTITEMA, sent }, + { TVM_INSERTITEMA, sent }, { 0 } }; @@ -85,8 +84,8 @@ static const struct message getitemtext_seq[] = { }; static const struct message focus_seq[] = { - { TVM_INSERTITEM, sent }, - { TVM_INSERTITEM, sent }, + { TVM_INSERTITEMA, sent }, + { TVM_INSERTITEMA, sent }, { TVM_SELECTITEM, sent|wparam, 9 }, /* The following end up out of order in wine */ { WM_WINDOWPOSCHANGING, sent|defwinproc }, @@ -330,13 +329,13 @@ static void fill_tree(HWND hTree) ins.hInsertAfter = TVI_ROOT; U(ins).item.mask = TVIF_TEXT; U(ins).item.pszText = root; - hRoot = TreeView_InsertItem(hTree, &ins); + hRoot = TreeView_InsertItemA(hTree, &ins); ins.hParent = hRoot; ins.hInsertAfter = TVI_FIRST; U(ins).item.mask = TVIF_TEXT; U(ins).item.pszText = child; - hChild = TreeView_InsertItem(hTree, &ins); + hChild = TreeView_InsertItemA(hTree, &ins); } static void test_fillroot(void) @@ -352,9 +351,9 @@ static void test_fillroot(void) Clear(); AddItem('A'); - assert(hRoot); + ok(hRoot != NULL, "failed to set root\n"); AddItem('B'); - assert(hChild); + ok(hChild != NULL, "failed to set child\n"); AddItem('.'); ok_sequence(sequences, TREEVIEW_SEQ_INDEX, FillRootSeq, "FillRoot", FALSE); ok(!strcmp(sequence, "AB."), "Item creation\n"); @@ -362,7 +361,7 @@ static void test_fillroot(void) /* UMLPad 1.15 depends on this being not -1 (I_IMAGECALLBACK) */ tvi.hItem = hRoot; tvi.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE; - SendMessage( hTree, TVM_GETITEMA, 0, (LPARAM)&tvi ); + SendMessageA(hTree, TVM_GETITEMA, 0, (LPARAM)&tvi); ok(tvi.iImage == 0, "tvi.iImage=%d\n", tvi.iImage); ok(tvi.iSelectedImage == 0, "tvi.iSelectedImage=%d\n", tvi.iSelectedImage); @@ -383,20 +382,20 @@ static void test_callback(void) hTree = create_treeview_control(0); - ret = TreeView_DeleteAllItems(hTree); + ret = SendMessageA(hTree, TVM_DELETEITEM, 0, (LPARAM)TVI_ROOT); expect(TRUE, ret); ins.hParent = TVI_ROOT; ins.hInsertAfter = TVI_ROOT; U(ins).item.mask = TVIF_TEXT; - U(ins).item.pszText = LPSTR_TEXTCALLBACK; - hRoot = TreeView_InsertItem(hTree, &ins); - assert(hRoot); + U(ins).item.pszText = LPSTR_TEXTCALLBACKA; + hRoot = TreeView_InsertItemA(hTree, &ins); + ok(hRoot != NULL, "failed to set root\n"); tvi.hItem = hRoot; tvi.mask = TVIF_TEXT; tvi.pszText = buf; tvi.cchTextMax = sizeof(buf)/sizeof(buf[0]); - ret = TreeView_GetItem(hTree, &tvi); + ret = TreeView_GetItemA(hTree, &tvi); expect(TRUE, ret); ok(strcmp(tvi.pszText, TEST_CALLBACK_TEXT) == 0, "Callback item text mismatch %s vs %s\n", tvi.pszText, TEST_CALLBACK_TEXT); @@ -405,31 +404,31 @@ static void test_callback(void) ins.hInsertAfter = TVI_FIRST; U(ins).item.mask = TVIF_TEXT; U(ins).item.pszText = test_string; - hItem1 = TreeView_InsertItem(hTree, &ins); - assert(hItem1); + hItem1 = TreeView_InsertItemA(hTree, &ins); + ok(hItem1 != NULL, "failed to set Item1\n"); tvi.hItem = hItem1; - ret = TreeView_GetItem(hTree, &tvi); + ret = TreeView_GetItemA(hTree, &tvi); expect(TRUE, ret); ok(strcmp(tvi.pszText, test_string) == 0, "Item text mismatch %s vs %s\n", tvi.pszText, test_string); /* undocumented: pszText of NULL also means LPSTR_CALLBACK: */ tvi.pszText = NULL; - ret = TreeView_SetItem(hTree, &tvi); + ret = TreeView_SetItemA(hTree, &tvi); expect(TRUE, ret); tvi.pszText = buf; - ret = TreeView_GetItem(hTree, &tvi); + ret = TreeView_GetItemA(hTree, &tvi); expect(TRUE, ret); ok(strcmp(tvi.pszText, TEST_CALLBACK_TEXT) == 0, "Item text mismatch %s vs %s\n", tvi.pszText, TEST_CALLBACK_TEXT); U(ins).item.pszText = NULL; - hItem2 = TreeView_InsertItem(hTree, &ins); - assert(hItem2); + hItem2 = TreeView_InsertItemA(hTree, &ins); + ok(hItem2 != NULL, "failed to set Item2\n"); tvi.hItem = hItem2; memset(buf, 0, sizeof(buf)); - ret = TreeView_GetItem(hTree, &tvi); + ret = TreeView_GetItemA(hTree, &tvi); expect(TRUE, ret); ok(strcmp(tvi.pszText, TEST_CALLBACK_TEXT) == 0, "Item text mismatch %s vs %s\n", tvi.pszText, TEST_CALLBACK_TEXT); @@ -438,7 +437,7 @@ static void test_callback(void) g_disp_A_to_W = TRUE; tvi.hItem = hItem2; memset(buf, 0, sizeof(buf)); - ret = TreeView_GetItem(hTree, &tvi); + ret = TreeView_GetItemA(hTree, &tvi); expect(TRUE, ret); ok(strcmp(tvi.pszText, test2A) == 0, "got %s, expected %s\n", tvi.pszText, test2A); @@ -456,7 +455,7 @@ static void test_callback(void) tvi.hItem = hRoot; tvi.mask = TVIF_STATE; tvi.state = TVIS_SELECTED; - ret = TreeView_GetItem(hTree, &tvi); + ret = TreeView_GetItemA(hTree, &tvi); expect(TRUE, ret); ok(tvi.state == INDEXTOSTATEIMAGEMASK(1), "got 0x%x\n", tvi.state); @@ -468,7 +467,7 @@ static void test_callback(void) tvi.state = TVIS_FOCUSED; tvi.stateMask = TVIS_FOCUSED; tvi.iImage = I_IMAGECALLBACK; - ret = TreeView_SetItem(hTree, &tvi); + ret = TreeView_SetItemA(hTree, &tvi); expect(TRUE, ret); /* ask for item image index through callback - state is also set with state image index */ @@ -477,7 +476,7 @@ static void test_callback(void) tvi.hItem = hRoot; tvi.mask = TVIF_IMAGE; tvi.state = 0; - ret = TreeView_GetItem(hTree, &tvi); + ret = TreeView_GetItemA(hTree, &tvi); expect(TRUE, ret); ok(tvi.state == (INDEXTOSTATEIMAGEMASK(1) | TVIS_FOCUSED), "got 0x%x\n", tvi.state); @@ -492,7 +491,7 @@ static void test_callback(void) tvi.mask = TVIF_IMAGE; tvi.state = INDEXTOSTATEIMAGEMASK(1); tvi.stateMask = 0; - ret = TreeView_GetItem(hTree, &tvi); + ret = TreeView_GetItemA(hTree, &tvi); expect(TRUE, ret); /* handler sets TVIS_SELECTED as well */ ok(tvi.state == (TVIS_FOCUSED | TVIS_SELECTED | INDEXTOSTATEIMAGEMASK(2) | INDEXTOOVERLAYMASK(3)), "got 0x%x\n", tvi.state); @@ -514,23 +513,23 @@ static void test_select(void) /* root-none select tests */ flush_sequences(sequences, NUM_MSG_SEQUENCES); - r = TreeView_SelectItem(hTree, NULL); + r = SendMessageA(hTree, TVM_SELECTITEM, TVGN_CARET, 0); expect(TRUE, r); Clear(); AddItem('1'); - r = TreeView_SelectItem(hTree, hRoot); + r = SendMessageA(hTree, TVM_SELECTITEM, TVGN_CARET, (LPARAM)hRoot); expect(TRUE, r); AddItem('2'); - r = TreeView_SelectItem(hTree, hRoot); + r = SendMessageA(hTree, TVM_SELECTITEM, TVGN_CARET, (LPARAM)hRoot); expect(TRUE, r); AddItem('3'); - r = TreeView_SelectItem(hTree, NULL); + r = SendMessageA(hTree, TVM_SELECTITEM, TVGN_CARET, 0); expect(TRUE, r); AddItem('4'); - r = TreeView_SelectItem(hTree, NULL); + r = SendMessageA(hTree, TVM_SELECTITEM, TVGN_CARET, 0); expect(TRUE, r); AddItem('5'); - r = TreeView_SelectItem(hTree, hRoot); + r = SendMessageA(hTree, TVM_SELECTITEM, TVGN_CARET, (LPARAM)hRoot); expect(TRUE, r); AddItem('.'); ok(!strcmp(sequence, "1(nR)nR23(Rn)Rn45(nR)nR."), "root-none select test\n"); @@ -539,24 +538,24 @@ static void test_select(void) /* root-child select tests */ flush_sequences(sequences, NUM_MSG_SEQUENCES); - r = TreeView_SelectItem(hTree, NULL); + r = SendMessageA(hTree, TVM_SELECTITEM, TVGN_CARET, 0); expect(TRUE, r); Clear(); AddItem('1'); - r = TreeView_SelectItem(hTree, hRoot); + r = SendMessageA(hTree, TVM_SELECTITEM, TVGN_CARET, (LPARAM)hRoot); expect(TRUE, r); AddItem('2'); - r = TreeView_SelectItem(hTree, hRoot); + r = SendMessageA(hTree, TVM_SELECTITEM, TVGN_CARET, (LPARAM)hRoot); expect(TRUE, r); AddItem('3'); - r = TreeView_SelectItem(hTree, hChild); + r = SendMessageA(hTree, TVM_SELECTITEM, TVGN_CARET, (LPARAM)hChild); expect(TRUE, r); AddItem('4'); - r = TreeView_SelectItem(hTree, hChild); + r = SendMessageA(hTree, TVM_SELECTITEM, TVGN_CARET, (LPARAM)hChild); expect(TRUE, r); AddItem('5'); - r = TreeView_SelectItem(hTree, hRoot); + r = SendMessageA(hTree, TVM_SELECTITEM, TVGN_CARET, (LPARAM)hRoot); expect(TRUE, r); AddItem('.'); ok(!strcmp(sequence, "1(nR)nR23(RC)RC45(CR)CR."), "root-child select test\n"); @@ -587,8 +586,8 @@ static void test_getitemtext(void) U(ins).item.mask = 0; U(ins).item.pszText = NULL; U(ins).item.cchTextMax = 0; - hChild = TreeView_InsertItem(hTree, &ins); - assert(hChild); + hChild = TreeView_InsertItemA(hTree, &ins); + ok(hChild != NULL, "failed to set hChild\n"); /* retrieve it with TVIF_TEXT mask */ tvi.hItem = hChild; @@ -627,17 +626,17 @@ static void test_focus(void) ins.hInsertAfter = hChild; U(ins).item.mask = TVIF_TEXT; U(ins).item.pszText = child1; - hChild1 = TreeView_InsertItem(hTree, &ins); - assert(hChild1); + hChild1 = TreeView_InsertItemA(hTree, &ins); + ok(hChild1 != NULL, "failed to set hChild1\n"); ins.hInsertAfter = hChild1; U(ins).item.mask = TVIF_TEXT; U(ins).item.pszText = child2; - hChild2 = TreeView_InsertItem(hTree, &ins); - assert(hChild2); + hChild2 = TreeView_InsertItemA(hTree, &ins); + ok(hChild2 != NULL, "failed to set hChild2\n"); ShowWindow(hMainWnd,SW_SHOW); SendMessageA(hTree, TVM_SELECTITEM, TVGN_CARET, (LPARAM)hChild); - hEdit = TreeView_EditLabel(hTree, hChild); + hEdit = (HWND)SendMessageA(hTree, TVM_EDITLABELA, 0, (LPARAM)hChild); ScrollWindowEx(hTree, -10, 0, NULL, NULL, NULL, NULL, SW_SCROLLCHILDREN); ok(GetFocus() == hEdit, "Edit control should have focus\n"); ok_sequence(sequences, TREEVIEW_SEQ_INDEX, focus_seq, "focus test", TRUE); @@ -656,21 +655,21 @@ static void test_get_set_bkcolor(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); /* If the value is -1, the control is using the system color for the background color. */ - crColor = (COLORREF)SendMessage( hTree, TVM_GETBKCOLOR, 0, 0 ); + crColor = SendMessageA(hTree, TVM_GETBKCOLOR, 0, 0); ok(crColor == ~0u, "Default background color reported as 0x%.8x\n", crColor); /* Test for black background */ - SendMessage( hTree, TVM_SETBKCOLOR, 0, RGB(0,0,0) ); - crColor = (COLORREF)SendMessage( hTree, TVM_GETBKCOLOR, 0, 0 ); + SendMessageA(hTree, TVM_SETBKCOLOR, 0, RGB(0,0,0)); + crColor = SendMessageA(hTree, TVM_GETBKCOLOR, 0, 0); ok(crColor == RGB(0,0,0), "Black background color reported as 0x%.8x\n", crColor); /* Test for white background */ - SendMessage( hTree, TVM_SETBKCOLOR, 0, RGB(255,255,255) ); - crColor = (COLORREF)SendMessage( hTree, TVM_GETBKCOLOR, 0, 0 ); + SendMessageA(hTree, TVM_SETBKCOLOR, 0, RGB(255,255,255)); + crColor = SendMessageA(hTree, TVM_GETBKCOLOR, 0, 0); ok(crColor == RGB(255,255,255), "White background color reported as 0x%.8x\n", crColor); /* Reset the default background */ - SendMessage( hTree, TVM_SETBKCOLOR, 0, -1 ); + SendMessageA(hTree, TVM_SETBKCOLOR, 0, -1); ok_sequence(sequences, TREEVIEW_SEQ_INDEX, test_get_set_bkcolor_seq, "test get set bkcolor", FALSE); @@ -689,8 +688,8 @@ static void test_get_set_imagelist(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); /* Test a NULL HIMAGELIST */ - SendMessage( hTree, TVM_SETIMAGELIST, TVSIL_NORMAL, 0 ); - himl = (HIMAGELIST)SendMessage( hTree, TVM_GETIMAGELIST, TVSIL_NORMAL, 0 ); + SendMessageA(hTree, TVM_SETIMAGELIST, TVSIL_NORMAL, 0); + himl = (HIMAGELIST)SendMessageA(hTree, TVM_GETIMAGELIST, TVSIL_NORMAL, 0); ok(himl == NULL, "NULL image list, reported as %p, expected 0.\n", himl); /* TODO: Test an actual image list */ @@ -714,13 +713,13 @@ static void test_get_set_indent(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); /* Finding the minimum indent */ - SendMessage( hTree, TVM_SETINDENT, 0, 0 ); - ulMinIndent = (int)SendMessage( hTree, TVM_GETINDENT, 0, 0 ); + SendMessageA(hTree, TVM_SETINDENT, 0, 0); + ulMinIndent = SendMessageA(hTree, TVM_GETINDENT, 0, 0); /* Checking an indent that is more than twice the default indent */ ulMoreThanTwiceMin = 2*ulMinIndent+1; - SendMessage( hTree, TVM_SETINDENT, ulMoreThanTwiceMin, 0 ); - ulIndent = (DWORD)SendMessage( hTree, TVM_GETINDENT, 0, 0 ); + SendMessageA(hTree, TVM_SETINDENT, ulMoreThanTwiceMin, 0); + ulIndent = SendMessageA(hTree, TVM_GETINDENT, 0, 0); ok(ulIndent == ulMoreThanTwiceMin, "Indent reported as %d, expected %d\n", ulIndent, ulMoreThanTwiceMin); ok_sequence(sequences, TREEVIEW_SEQ_INDEX, test_get_set_indent_seq, @@ -739,8 +738,8 @@ static void test_get_set_insertmark(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); - SendMessage( hTree, TVM_SETINSERTMARKCOLOR, 0, crColor ); - crColor = (COLORREF)SendMessage( hTree, TVM_GETINSERTMARKCOLOR, 0, 0 ); + SendMessageA(hTree, TVM_SETINSERTMARKCOLOR, 0, crColor); + crColor = SendMessageA(hTree, TVM_GETINSERTMARKCOLOR, 0, 0); ok(crColor == RGB(0,0,0), "Insert mark color reported as 0x%.8x, expected 0x00000000\n", crColor); ok_sequence(sequences, TREEVIEW_SEQ_INDEX, test_get_set_insertmarkcolor_seq, @@ -764,7 +763,7 @@ static void test_get_set_item(void) tviRoot.mask = TVIF_STATE; tviRoot.state = TVIS_FOCUSED; tviRoot.stateMask = TVIS_FOCUSED; - ret = SendMessage( hTree, TVM_SETITEMA, 0, (LPARAM)&tviRoot ); + ret = SendMessageA(hTree, TVM_SETITEMA, 0, (LPARAM)&tviRoot); expect(TRUE, ret); flush_sequences(sequences, NUM_MSG_SEQUENCES); @@ -776,24 +775,24 @@ static void test_get_set_item(void) tviRoot.stateMask = 0; tviRoot.cchTextMax = nBufferSize; tviRoot.pszText = szBuffer; - ret = SendMessage( hTree, TVM_GETITEMA, 0, (LPARAM)&tviRoot ); + ret = SendMessageA(hTree, TVM_GETITEMA, 0, (LPARAM)&tviRoot); expect(TRUE, ret); ok(!strcmp("Root", szBuffer), "GetItem: szBuffer=\"%s\", expected \"Root\"\n", szBuffer); ok(tviRoot.state == TVIS_FOCUSED, "got 0x%0x\n", tviRoot.state); /* Change the root text */ - strncpy(szBuffer, "Testing123", nBufferSize); - ret = SendMessage( hTree, TVM_SETITEMA, 0, (LPARAM)&tviRoot ); + lstrcpynA(szBuffer, "Testing123", nBufferSize); + ret = SendMessageA(hTree, TVM_SETITEMA, 0, (LPARAM)&tviRoot); expect(TRUE, ret); memset(szBuffer, 0, nBufferSize); - ret = SendMessage( hTree, TVM_GETITEMA, 0, (LPARAM)&tviRoot ); + ret = SendMessageA(hTree, TVM_GETITEMA, 0, (LPARAM)&tviRoot); expect(TRUE, ret); ok(!strcmp("Testing123", szBuffer), "GetItem: szBuffer=\"%s\", expected \"Testing123\"\n", szBuffer); /* Reset the root text */ memset(szBuffer, 0, nBufferSize); - strncpy(szBuffer, "Root", nBufferSize); - ret = SendMessage( hTree, TVM_SETITEMA, 0, (LPARAM)&tviRoot ); + lstrcpynA(szBuffer, "Root", nBufferSize); + ret = SendMessageA(hTree, TVM_SETITEMA, 0, (LPARAM)&tviRoot); expect(TRUE, ret); ok_sequence(sequences, TREEVIEW_SEQ_INDEX, test_get_set_item_seq, @@ -805,7 +804,7 @@ static void test_get_set_item(void) tviRoot.hItem = hRoot; tviRoot.mask = TVIF_STATE; tviRoot.state = 0; - ret = SendMessage( hTree2, TVM_GETITEMA, 0, (LPARAM)&tviRoot ); + ret = SendMessageA(hTree2, TVM_GETITEMA, 0, (LPARAM)&tviRoot); expect(TRUE, ret); ok(tviRoot.state == TVIS_FOCUSED, "got state 0x%0x\n", tviRoot.state); @@ -825,50 +824,50 @@ static void test_get_set_itemheight(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); /* Assuming default height to begin with */ - ulOldHeight = (int) SendMessage( hTree, TVM_GETITEMHEIGHT, 0, 0 ); + ulOldHeight = SendMessageA(hTree, TVM_GETITEMHEIGHT, 0, 0); /* Explicitly setting and getting the default height */ - SendMessage( hTree, TVM_SETITEMHEIGHT, -1, 0 ); - ulNewHeight = (int) SendMessage( hTree, TVM_GETITEMHEIGHT, 0, 0 ); + SendMessageA(hTree, TVM_SETITEMHEIGHT, -1, 0); + ulNewHeight = SendMessageA(hTree, TVM_GETITEMHEIGHT, 0, 0); ok(ulNewHeight == ulOldHeight, "Default height not set properly, reported %d, expected %d\n", ulNewHeight, ulOldHeight); /* Explicitly setting and getting the height of twice the normal */ - SendMessage( hTree, TVM_SETITEMHEIGHT, 2*ulOldHeight, 0 ); - ulNewHeight = (int) SendMessage( hTree, TVM_GETITEMHEIGHT, 0, 0 ); + SendMessageA(hTree, TVM_SETITEMHEIGHT, 2*ulOldHeight, 0); + ulNewHeight = SendMessageA(hTree, TVM_GETITEMHEIGHT, 0, 0); ok(ulNewHeight == 2*ulOldHeight, "New height not set properly, reported %d, expected %d\n", ulNewHeight, 2*ulOldHeight); /* Assuming tree doesn't have TVS_NONEVENHEIGHT set, so a set of 9 will round down to 8 */ - SendMessage( hTree, TVM_SETITEMHEIGHT, 9, 0 ); - ulNewHeight = (int) SendMessage( hTree, TVM_GETITEMHEIGHT, 0, 0 ); + SendMessageA(hTree, TVM_SETITEMHEIGHT, 9, 0); + ulNewHeight = SendMessageA(hTree, TVM_GETITEMHEIGHT, 0, 0); ok(ulNewHeight == 8, "Uneven height not set properly, reported %d, expected %d\n", ulNewHeight, 8); ok_sequence(sequences, TREEVIEW_SEQ_INDEX, test_get_set_itemheight_seq, "test get set item height", FALSE); /* without TVS_NONEVENHEIGHT */ - SetWindowLong(hTree, GWL_STYLE, GetWindowLong(hTree, GWL_STYLE) & ~TVS_NONEVENHEIGHT); + SetWindowLongA(hTree, GWL_STYLE, GetWindowLongA(hTree, GWL_STYLE) & ~TVS_NONEVENHEIGHT); /* odd value */ - ulOldHeight = SendMessage( hTree, TVM_SETITEMHEIGHT, 3, 0); + ulOldHeight = SendMessageA(hTree, TVM_SETITEMHEIGHT, 3, 0); ok(ulOldHeight == 8, "got %d, expected %d\n", ulOldHeight, 8); - ulNewHeight = (int) SendMessage( hTree, TVM_GETITEMHEIGHT, 0, 0 ); + ulNewHeight = SendMessageA(hTree, TVM_GETITEMHEIGHT, 0, 0); ok(ulNewHeight == 2, "got %d, expected %d\n", ulNewHeight, 2); - ulOldHeight = SendMessage( hTree, TVM_SETITEMHEIGHT, 4, 0); + ulOldHeight = SendMessageA(hTree, TVM_SETITEMHEIGHT, 4, 0); ok(ulOldHeight == 2, "got %d, expected %d\n", ulOldHeight, 2); - ulNewHeight = (int) SendMessage( hTree, TVM_GETITEMHEIGHT, 0, 0 ); + ulNewHeight = SendMessageA(hTree, TVM_GETITEMHEIGHT, 0, 0); ok(ulNewHeight == 4, "got %d, expected %d\n", ulNewHeight, 4); /* with TVS_NONEVENHEIGHT */ - SetWindowLong(hTree, GWL_STYLE, GetWindowLong(hTree, GWL_STYLE) | TVS_NONEVENHEIGHT); + SetWindowLongA(hTree, GWL_STYLE, GetWindowLongA(hTree, GWL_STYLE) | TVS_NONEVENHEIGHT); /* odd value */ - ulOldHeight = SendMessage( hTree, TVM_SETITEMHEIGHT, 3, 0); + ulOldHeight = SendMessageA(hTree, TVM_SETITEMHEIGHT, 3, 0); ok(ulOldHeight == 4, "got %d, expected %d\n", ulOldHeight, 4); - ulNewHeight = (int) SendMessage( hTree, TVM_GETITEMHEIGHT, 0, 0 ); + ulNewHeight = SendMessageA(hTree, TVM_GETITEMHEIGHT, 0, 0); ok(ulNewHeight == 3, "got %d, expected %d\n", ulNewHeight, 3); /* even value */ - ulOldHeight = SendMessage( hTree, TVM_SETITEMHEIGHT, 10, 0); + ulOldHeight = SendMessageA(hTree, TVM_SETITEMHEIGHT, 10, 0); ok(ulOldHeight == 3, "got %d, expected %d\n", ulOldHeight, 3); - ulNewHeight = (int) SendMessage( hTree, TVM_GETITEMHEIGHT, 0, 0 ); + ulNewHeight = SendMessageA(hTree, TVM_GETITEMHEIGHT, 0, 0); ok(ulNewHeight == 10, "got %d, expected %d\n", ulNewHeight, 10); DestroyWindow(hTree); @@ -885,8 +884,8 @@ static void test_get_set_scrolltime(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); - SendMessage( hTree, TVM_SETSCROLLTIME, ulExpectedTime, 0 ); - ulTime = (int)SendMessage( hTree, TVM_GETSCROLLTIME, 0, 0 ); + SendMessageA(hTree, TVM_SETSCROLLTIME, ulExpectedTime, 0); + ulTime = SendMessageA(hTree, TVM_GETSCROLLTIME, 0, 0); ok(ulTime == ulExpectedTime, "Scroll time reported as %d, expected %d\n", ulTime, ulExpectedTime); ok_sequence(sequences, TREEVIEW_SEQ_INDEX, test_get_set_scrolltime_seq, @@ -906,21 +905,21 @@ static void test_get_set_textcolor(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); - crColor = (COLORREF)SendMessage( hTree, TVM_GETTEXTCOLOR, 0, 0 ); + crColor = SendMessageA(hTree, TVM_GETTEXTCOLOR, 0, 0); ok(crColor == ~0u, "Default text color reported as 0x%.8x\n", crColor); /* Test for black text */ - SendMessage( hTree, TVM_SETTEXTCOLOR, 0, RGB(0,0,0) ); - crColor = (COLORREF)SendMessage( hTree, TVM_GETTEXTCOLOR, 0, 0 ); + SendMessageA(hTree, TVM_SETTEXTCOLOR, 0, RGB(0,0,0)); + crColor = SendMessageA(hTree, TVM_GETTEXTCOLOR, 0, 0); ok(crColor == RGB(0,0,0), "Black text color reported as 0x%.8x\n", crColor); /* Test for white text */ - SendMessage( hTree, TVM_SETTEXTCOLOR, 0, RGB(255,255,255) ); - crColor = (COLORREF)SendMessage( hTree, TVM_GETTEXTCOLOR, 0, 0 ); + SendMessageA(hTree, TVM_SETTEXTCOLOR, 0, RGB(255,255,255)); + crColor = SendMessageA(hTree, TVM_GETTEXTCOLOR, 0, 0); ok(crColor == RGB(255,255,255), "White text color reported as 0x%.8x\n", crColor); /* Reset the default text color */ - SendMessage( hTree, TVM_SETTEXTCOLOR, 0, CLR_NONE ); + SendMessageA(hTree, TVM_SETTEXTCOLOR, 0, CLR_NONE); ok_sequence(sequences, TREEVIEW_SEQ_INDEX, test_get_set_textcolor_seq, "test get set text color", FALSE); @@ -940,12 +939,13 @@ static void test_get_set_tooltips(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); /* show even WS_POPUP treeview don't send NM_TOOLTIPSCREATED */ - hPopupTreeView = CreateWindow(WC_TREEVIEW, NULL, WS_POPUP|WS_VISIBLE, 0, 0, 100, 100, hMainWnd, NULL, NULL, NULL); + hPopupTreeView = CreateWindowA(WC_TREEVIEWA, NULL, WS_POPUP|WS_VISIBLE, 0, 0, 100, 100, + hMainWnd, NULL, NULL, NULL); DestroyWindow(hPopupTreeView); /* Testing setting a NULL ToolTip */ - SendMessage( hTree, TVM_SETTOOLTIPS, 0, 0 ); - hwndLastToolTip = (HWND)SendMessage( hTree, TVM_GETTOOLTIPS, 0, 0 ); + SendMessageA(hTree, TVM_SETTOOLTIPS, 0, 0); + hwndLastToolTip = (HWND)SendMessageA(hTree, TVM_GETTOOLTIPS, 0, 0); ok(hwndLastToolTip == NULL, "NULL tool tip, reported as 0x%p, expected 0.\n", hwndLastToolTip); ok_sequence(sequences, TREEVIEW_SEQ_INDEX, test_get_set_tooltips_seq, @@ -957,31 +957,31 @@ static void test_get_set_tooltips(void) static void test_get_set_unicodeformat(void) { - BOOL bPreviousSetting = 0; - BOOL bNewSetting = 0; + BOOL bPreviousSetting = FALSE; + BOOL bNewSetting = FALSE; HWND hTree; hTree = create_treeview_control(0); fill_tree(hTree); /* Check that an invalid format returned by NF_QUERY defaults to ANSI */ - bPreviousSetting = (BOOL)SendMessage( hTree, TVM_GETUNICODEFORMAT, 0, 0 ); - ok(bPreviousSetting == 0, "Format should be ANSI.\n"); + bPreviousSetting = SendMessageA(hTree, TVM_GETUNICODEFORMAT, 0, 0); + ok(bPreviousSetting == FALSE, "Format should be ANSI.\n"); flush_sequences(sequences, NUM_MSG_SEQUENCES); /* Set to Unicode */ - bPreviousSetting = (BOOL)SendMessage( hTree, TVM_SETUNICODEFORMAT, 1, 0 ); - bNewSetting = (BOOL)SendMessage( hTree, TVM_GETUNICODEFORMAT, 0, 0 ); - ok(bNewSetting == 1, "Unicode setting did not work.\n"); + bPreviousSetting = SendMessageA(hTree, TVM_SETUNICODEFORMAT, 1, 0); + bNewSetting = SendMessageA(hTree, TVM_GETUNICODEFORMAT, 0, 0); + ok(bNewSetting == TRUE, "Unicode setting did not work.\n"); /* Set to ANSI */ - SendMessage( hTree, TVM_SETUNICODEFORMAT, 0, 0 ); - bNewSetting = (BOOL)SendMessage( hTree, TVM_GETUNICODEFORMAT, 0, 0 ); - ok(bNewSetting == 0, "ANSI setting did not work.\n"); + SendMessageA(hTree, TVM_SETUNICODEFORMAT, 0, 0); + bNewSetting = SendMessageA(hTree, TVM_GETUNICODEFORMAT, 0, 0); + ok(bNewSetting == FALSE, "ANSI setting did not work.\n"); /* Revert to original setting */ - SendMessage( hTree, TVM_SETUNICODEFORMAT, bPreviousSetting, 0 ); + SendMessageA(hTree, TVM_SETUNICODEFORMAT, bPreviousSetting, 0); ok_sequence(sequences, TREEVIEW_SEQ_INDEX, test_get_set_unicodeformat_seq, "test get set unicode format", FALSE); @@ -1052,7 +1052,7 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam, case TVN_GETDISPINFOA: { NMTVDISPINFOA *disp = (NMTVDISPINFOA *)lParam; if (disp->item.mask & TVIF_TEXT) { - lstrcpyn(disp->item.pszText, TEST_CALLBACK_TEXT, disp->item.cchTextMax); + lstrcpynA(disp->item.pszText, TEST_CALLBACK_TEXT, disp->item.cchTextMax); } if (g_disp_A_to_W && (disp->item.mask & TVIF_TEXT)) { @@ -1073,7 +1073,7 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam, break; } - case TVN_BEGINLABELEDIT: + case TVN_BEGINLABELEDITA: { if (g_beginedit_alter_text) { @@ -1088,7 +1088,7 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam, break; } - case TVN_ENDLABELEDIT: return TRUE; + case TVN_ENDLABELEDITA: return TRUE; case TVN_ITEMEXPANDINGA: ok(pTreeView->itemNew.mask == (TVIF_HANDLE | TVIF_SELECTEDIMAGE | TVIF_IMAGE | TVIF_PARAM | TVIF_STATE), @@ -1120,14 +1120,18 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam, } if (g_get_rect_in_expand) { - visibleItem = TreeView_GetNextItem(pHdr->hwndFrom, NULL, TVGN_FIRSTVISIBLE); + visibleItem = (HTREEITEM)SendMessageA(pHdr->hwndFrom, TVM_GETNEXTITEM, + TVGN_FIRSTVISIBLE, 0); ok(pTreeView->itemNew.hItem == visibleItem, "expanded item == first visible item\n"); *(HTREEITEM*)&rect = visibleItem; - ok(SendMessage(pHdr->hwndFrom, TVM_GETITEMRECT, TRUE, (LPARAM)&rect), "Failed to get rect for first visible item.\n"); - visibleItem = TreeView_GetNextItem(pHdr->hwndFrom, visibleItem, TVGN_NEXTVISIBLE); + ok(SendMessageA(pHdr->hwndFrom, TVM_GETITEMRECT, TRUE, (LPARAM)&rect), + "Failed to get rect for first visible item.\n"); + visibleItem = (HTREEITEM)SendMessageA(pHdr->hwndFrom, TVM_GETNEXTITEM, + TVGN_NEXTVISIBLE, (LPARAM)visibleItem); *(HTREEITEM*)&rect = visibleItem; ok(visibleItem != NULL, "There must be a visible item after the first visisble item.\n"); - ok(SendMessage(pHdr->hwndFrom, TVM_GETITEMRECT, TRUE, (LPARAM)&rect), "Failed to get rect for second visible item.\n"); + ok(SendMessageA(pHdr->hwndFrom, TVM_GETITEMRECT, TRUE, (LPARAM)&rect), + "Failed to get rect for second visible item.\n"); } break; case TVN_DELETEITEMA: @@ -1184,54 +1188,61 @@ static void test_expandinvisible(void) * */ - ret = TreeView_DeleteAllItems(hTree); + ret = SendMessageA(hTree, TVM_DELETEITEM, 0, (LPARAM)TVI_ROOT); ok(ret == TRUE, "ret\n"); ins.hParent = TVI_ROOT; ins.hInsertAfter = TVI_ROOT; U(ins).item.mask = TVIF_TEXT; U(ins).item.pszText = nodeText[0]; - node[0] = TreeView_InsertItem(hTree, &ins); - assert(node[0]); + node[0] = TreeView_InsertItemA(hTree, &ins); + ok(node[0] != NULL, "failed to set node[0]\n"); ins.hInsertAfter = TVI_LAST; U(ins).item.mask = TVIF_TEXT; ins.hParent = node[0]; U(ins).item.pszText = nodeText[1]; - node[1] = TreeView_InsertItem(hTree, &ins); - assert(node[1]); + node[1] = TreeView_InsertItemA(hTree, &ins); + ok(node[1] != NULL, "failed to set node[1]\n"); U(ins).item.pszText = nodeText[4]; - node[4] = TreeView_InsertItem(hTree, &ins); - assert(node[4]); + node[4] = TreeView_InsertItemA(hTree, &ins); + ok(node[4] != NULL, "failed to set node[4]\n"); ins.hParent = node[1]; U(ins).item.pszText = nodeText[2]; - node[2] = TreeView_InsertItem(hTree, &ins); - assert(node[2]); + node[2] = TreeView_InsertItemA(hTree, &ins); + ok(node[2] != NULL, "failed to set node[2]\n"); U(ins).item.pszText = nodeText[3]; - node[3] = TreeView_InsertItem(hTree, &ins); - assert(node[3]); + node[3] = TreeView_InsertItemA(hTree, &ins); + ok(node[3] != NULL, "failed to set node[3]\n"); - - nodeVisible = TreeView_GetItemRect(hTree, node[1], &dummyRect, FALSE); + *(HTREEITEM *)&dummyRect = node[1]; + nodeVisible = SendMessageA(hTree, TVM_GETITEMRECT, FALSE, (LPARAM)&dummyRect); ok(!nodeVisible, "Node 1 should not be visible.\n"); - nodeVisible = TreeView_GetItemRect(hTree, node[2], &dummyRect, FALSE); + *(HTREEITEM *)&dummyRect = node[2]; + nodeVisible = SendMessageA(hTree, TVM_GETITEMRECT, FALSE, (LPARAM)&dummyRect); ok(!nodeVisible, "Node 2 should not be visible.\n"); - nodeVisible = TreeView_GetItemRect(hTree, node[3], &dummyRect, FALSE); + *(HTREEITEM *)&dummyRect = node[3]; + nodeVisible = SendMessageA(hTree, TVM_GETITEMRECT, FALSE, (LPARAM)&dummyRect); ok(!nodeVisible, "Node 3 should not be visible.\n"); - nodeVisible = TreeView_GetItemRect(hTree, node[4], &dummyRect, FALSE); + *(HTREEITEM *)&dummyRect = node[4]; + nodeVisible = SendMessageA(hTree, TVM_GETITEMRECT, FALSE, (LPARAM)&dummyRect); ok(!nodeVisible, "Node 4 should not be visible.\n"); - ok(TreeView_Expand(hTree, node[1], TVE_EXPAND), "Expand of node 1 failed.\n"); + ok(SendMessageA(hTree, TVM_EXPAND, TVE_EXPAND, (LPARAM)node[1]), "Expand of node 1 failed.\n"); - nodeVisible = TreeView_GetItemRect(hTree, node[1], &dummyRect, FALSE); + *(HTREEITEM *)&dummyRect = node[1]; + nodeVisible = SendMessageA(hTree, TVM_GETITEMRECT, FALSE, (LPARAM)&dummyRect); ok(!nodeVisible, "Node 1 should not be visible.\n"); - nodeVisible = TreeView_GetItemRect(hTree, node[2], &dummyRect, FALSE); + *(HTREEITEM *)&dummyRect = node[2]; + nodeVisible = SendMessageA(hTree, TVM_GETITEMRECT, FALSE, (LPARAM)&dummyRect); ok(!nodeVisible, "Node 2 should not be visible.\n"); - nodeVisible = TreeView_GetItemRect(hTree, node[3], &dummyRect, FALSE); + *(HTREEITEM *)&dummyRect = node[3]; + nodeVisible = SendMessageA(hTree, TVM_GETITEMRECT, FALSE, (LPARAM)&dummyRect); ok(!nodeVisible, "Node 3 should not be visible.\n"); - nodeVisible = TreeView_GetItemRect(hTree, node[4], &dummyRect, FALSE); + *(HTREEITEM *)&dummyRect = node[4]; + nodeVisible = SendMessageA(hTree, TVM_GETITEMRECT, FALSE, (LPARAM)&dummyRect); ok(!nodeVisible, "Node 4 should not be visible.\n"); DestroyWindow(hTree); @@ -1249,47 +1260,47 @@ static void test_itemedit(void) fill_tree(hTree); /* try with null item */ - edit = (HWND)SendMessage(hTree, TVM_EDITLABELA, 0, 0); + edit = (HWND)SendMessageA(hTree, TVM_EDITLABELA, 0, 0); ok(!IsWindow(edit), "Expected valid handle\n"); /* trigger edit */ - edit = (HWND)SendMessage(hTree, TVM_EDITLABELA, 0, (LPARAM)hRoot); + edit = (HWND)SendMessageA(hTree, TVM_EDITLABELA, 0, (LPARAM)hRoot); ok(IsWindow(edit), "Expected valid handle\n"); - /* item shouldn't be selected automatically after TVM_EDITLABEL */ - r = SendMessage(hTree, TVM_GETITEMSTATE, (WPARAM)hRoot, TVIS_SELECTED); + /* item shouldn't be selected automatically after TVM_EDITLABELA */ + r = SendMessageA(hTree, TVM_GETITEMSTATE, (WPARAM)hRoot, TVIS_SELECTED); expect(0, r); /* try to cancel with wrong edit handle */ - r = SendMessage(hTree, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), 0); + r = SendMessageA(hTree, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), 0); expect(0, r); ok(IsWindow(edit), "Expected edit control to be valid\n"); - r = SendMessage(hTree, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), (LPARAM)edit); + r = SendMessageA(hTree, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), (LPARAM)edit); expect(0, r); ok(!IsWindow(edit), "Expected edit control to be destroyed\n"); /* try to cancel without creating edit */ - r = SendMessage(hTree, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), 0); + r = SendMessageA(hTree, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), 0); expect(0, r); /* try to cancel with wrong (not null) handle */ - edit = (HWND)SendMessage(hTree, TVM_EDITLABELA, 0, (LPARAM)hRoot); + edit = (HWND)SendMessageA(hTree, TVM_EDITLABELA, 0, (LPARAM)hRoot); ok(IsWindow(edit), "Expected valid handle\n"); - r = SendMessage(hTree, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), (LPARAM)hTree); + r = SendMessageA(hTree, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), (LPARAM)hTree); expect(0, r); ok(IsWindow(edit), "Expected edit control to be valid\n"); - r = SendMessage(hTree, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), (LPARAM)edit); + r = SendMessageA(hTree, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), (LPARAM)edit); expect(0, r); /* remove selection after starting edit */ - r = TreeView_SelectItem(hTree, hRoot); + r = SendMessageA(hTree, TVM_SELECTITEM, TVGN_CARET, (LPARAM)hRoot); expect(TRUE, r); - edit = (HWND)SendMessage(hTree, TVM_EDITLABELA, 0, (LPARAM)hRoot); + edit = (HWND)SendMessageA(hTree, TVM_EDITLABELA, 0, (LPARAM)hRoot); ok(IsWindow(edit), "Expected valid handle\n"); - r = TreeView_SelectItem(hTree, NULL); + r = SendMessageA(hTree, TVM_SELECTITEM, TVGN_CARET, 0); expect(TRUE, r); /* alter text */ strcpy(buffA, "x"); - r = SendMessage(edit, WM_SETTEXT, 0, (LPARAM)buffA); + r = SendMessageA(edit, WM_SETTEXT, 0, (LPARAM)buffA); expect(TRUE, r); - r = SendMessage(hTree, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), (LPARAM)edit); + r = SendMessageA(hTree, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), (LPARAM)edit); expect(0, r); ok(!IsWindow(edit), "Expected edit control to be destroyed\n"); /* check that text is saved */ @@ -1297,7 +1308,7 @@ static void test_itemedit(void) item.hItem = hRoot; item.pszText = buffA; item.cchTextMax = sizeof(buffA)/sizeof(CHAR); - r = SendMessage(hTree, TVM_GETITEMA, 0, (LPARAM)&item); + r = SendMessageA(hTree, TVM_GETITEMA, 0, (LPARAM)&item); expect(TRUE, r); ok(!strcmp("x", buffA), "Expected item text to change\n"); @@ -1305,14 +1316,14 @@ static void test_itemedit(void) edit = (HWND)SendMessageA(hTree, TVM_EDITLABELA, 0, (LPARAM)hRoot); ok(IsWindow(edit), "Expected valid handle\n"); ok(IsWindowUnicode(edit), "got ansi window\n"); - r = SendMessage(hTree, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), (LPARAM)edit); + r = SendMessageA(hTree, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), (LPARAM)edit); expect(0, r); ok(!IsWindow(edit), "expected invalid handle\n"); edit = (HWND)SendMessageA(hTree, TVM_EDITLABELW, 0, (LPARAM)hRoot); ok(IsWindow(edit), "Expected valid handle\n"); ok(IsWindowUnicode(edit), "got ansi window\n"); - r = SendMessage(hTree, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), (LPARAM)edit); + r = SendMessageA(hTree, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), (LPARAM)edit); expect(0, r); /* alter text during TVM_BEGINLABELEDIT, check that it's preserved */ @@ -1322,7 +1333,7 @@ static void test_itemedit(void) item.hItem = hRoot; item.pszText = buffA; item.cchTextMax = 0; - r = SendMessage(hTree, TVM_SETITEMA, 0, (LPARAM)&item); + r = SendMessageA(hTree, TVM_SETITEMA, 0, (LPARAM)&item); expect(TRUE, r); g_beginedit_alter_text = TRUE; @@ -1341,7 +1352,7 @@ static void test_treeview_classinfo(void) WNDCLASSA cls; memset(&cls, 0, sizeof(cls)); - GetClassInfo(GetModuleHandleA("comctl32.dll"), WC_TREEVIEWA, &cls); + GetClassInfoA(GetModuleHandleA("comctl32.dll"), WC_TREEVIEWA, &cls); ok(cls.hbrBackground == NULL, "Expected NULL background brush, got %p\n", cls.hbrBackground); ok(cls.style == (CS_GLOBALCLASS | CS_DBLCLKS), "Expected got %x\n", cls.style); expect(0, cls.cbClsExtra); @@ -1355,7 +1366,7 @@ static void test_get_linecolor(void) hTree = create_treeview_control(0); /* newly created control has default color */ - clr = (COLORREF)SendMessage(hTree, TVM_GETLINECOLOR, 0, 0); + clr = SendMessageA(hTree, TVM_GETLINECOLOR, 0, 0); if (clr == 0) win_skip("TVM_GETLINECOLOR is not supported on comctl32 < 5.80\n"); else @@ -1372,7 +1383,7 @@ static void test_get_insertmarkcolor(void) hTree = create_treeview_control(0); /* newly created control has default color */ - clr = (COLORREF)SendMessage(hTree, TVM_GETINSERTMARKCOLOR, 0, 0); + clr = SendMessageA(hTree, TVM_GETINSERTMARKCOLOR, 0, 0); if (clr == 0) win_skip("TVM_GETINSERTMARKCOLOR is not supported on comctl32 < 5.80\n"); else @@ -1451,7 +1462,7 @@ static void test_expandnotify(void) hTree = create_treeview_control(0); fill_tree(hTree); g_get_rect_in_expand = TRUE; - ret = TreeView_Select(hTree, hChild, TVGN_CARET); + ret = SendMessageA(hTree, TVM_SELECTITEM, TVGN_CARET, (LPARAM)hChild); expect(TRUE, ret); g_get_rect_in_expand = FALSE; @@ -1581,7 +1592,7 @@ static void test_TVS_SINGLEEXPAND(void) BOOL ret; hTree = create_treeview_control(0); - SetWindowLongA(hTree, GWL_STYLE, GetWindowLong(hTree, GWL_STYLE) | TVS_SINGLEEXPAND); + SetWindowLongA(hTree, GWL_STYLE, GetWindowLongA(hTree, GWL_STYLE) | TVS_SINGLEEXPAND); /* to avoid painting related notifications */ ShowWindow(hTree, SW_HIDE); fill_tree(hTree); @@ -1645,7 +1656,7 @@ static void test_delete_items(void) /* check delete order */ flush_sequences(item_sequence, 1); - ret = SendMessage(hTree, TVM_DELETEITEM, 0, 0); + ret = SendMessageA(hTree, TVM_DELETEITEM, 0, 0); ok(ret == TRUE, "got %d\n", ret); msg = item_sequence[0]->sequence; @@ -1672,7 +1683,7 @@ static void test_cchildren(void) hTree = create_treeview_control(0); fill_tree(hTree); - ret = SendMessage(hTree, TVM_DELETEITEM, 0, (LPARAM)hChild); + ret = SendMessageA(hTree, TVM_DELETEITEM, 0, (LPARAM)hChild); expect(TRUE, ret); /* check cChildren - automatic mode */ @@ -1700,7 +1711,7 @@ static void test_cchildren(void) ret = SendMessageA(hTree, TVM_SETITEMA, 0, (LPARAM)&item); expect(TRUE, ret); - ret = SendMessage(hTree, TVM_DELETEITEM, 0, (LPARAM)hChild); + ret = SendMessageA(hTree, TVM_DELETEITEM, 0, (LPARAM)hChild); expect(TRUE, ret); /* check cChildren */ @@ -1746,18 +1757,18 @@ static void test_htreeitem_layout(void) ins.hParent = hChild; ins.hInsertAfter = TVI_FIRST; U(ins).item.mask = 0; - item1 = TreeView_InsertItem(hTree, &ins); + item1 = TreeView_InsertItemA(hTree, &ins); check_item(item1, hChild, 0, 0); ins.hParent = hRoot; ins.hInsertAfter = TVI_FIRST; U(ins).item.mask = 0; - item2 = TreeView_InsertItem(hTree, &ins); + item2 = TreeView_InsertItemA(hTree, &ins); check_item(item2, hRoot, hChild, 0); - SendMessage(hTree, TVM_DELETEITEM, 0, (LPARAM)hChild); + SendMessageA(hTree, TVM_DELETEITEM, 0, (LPARAM)hChild); /* without children now */ check_item(hRoot, ((struct _ITEM_DATA*)hRoot)->parent, 0, item2); @@ -1771,6 +1782,7 @@ static void test_TVS_CHECKBOXES(void) HWND hTree, hTree2; TVITEMA item; DWORD ret; + MSG msg; hTree = create_treeview_control(0); fill_tree(hTree); @@ -1841,16 +1853,10 @@ static void test_TVS_CHECKBOXES(void) DestroyWindow(hTree); /* the same, but initially created with TVS_CHECKBOXES */ - hTree = create_treeview_control(0); - fill_tree(hTree); - himl = (HIMAGELIST)SendMessageA(hTree, TVM_GETIMAGELIST, TVSIL_STATE, 0); - ok(himl == NULL, "got %p\n", himl); - DestroyWindow(hTree); - hTree = create_treeview_control(TVS_CHECKBOXES); fill_tree(hTree); himl = (HIMAGELIST)SendMessageA(hTree, TVM_GETIMAGELIST, TVSIL_STATE, 0); - todo_wine ok(himl == NULL, "got %p\n", himl); + ok(himl == NULL, "got %p\n", himl); item.hItem = hRoot; item.mask = TVIF_STATE; @@ -1868,6 +1874,90 @@ static void test_TVS_CHECKBOXES(void) expect(TRUE, ret); ok(item.state == INDEXTOSTATEIMAGEMASK(1), "got 0x%x\n", item.state); + item.hItem = hChild; + item.mask = TVIF_STATE; + item.state = INDEXTOSTATEIMAGEMASK(2); + item.stateMask = TVIS_STATEIMAGEMASK; + ret = SendMessageA(hTree, TVM_SETITEMA, 0, (LPARAM)&item); + expect(TRUE, ret); + + item.hItem = hChild; + item.mask = TVIF_STATE; + item.state = 0; + ret = SendMessageA(hTree, TVM_GETITEMA, 0, (LPARAM)&item); + expect(TRUE, ret); + ok(item.state == INDEXTOSTATEIMAGEMASK(2), "got 0x%x\n", item.state); + + while(GetMessageA(&msg, 0, 0, 0)) + { + TranslateMessage(&msg); + DispatchMessageA(&msg); + + if((msg.hwnd == hTree) && (msg.message == WM_PAINT)) + break; + } + + item.hItem = hChild; + item.mask = TVIF_STATE; + item.state = 0; + ret = SendMessageA(hTree, TVM_GETITEMA, 0, (LPARAM)&item); + expect(TRUE, ret); + ok(item.state == INDEXTOSTATEIMAGEMASK(1), "got 0x%x\n", item.state); + + himl = (HIMAGELIST)SendMessageA(hTree, TVM_GETIMAGELIST, TVSIL_STATE, 0); + ok(himl != NULL, "got %p\n", himl); + + DestroyWindow(hTree); + + /* check what happens if TVSIL_STATE image list is removed */ + hTree = create_treeview_control(0); + fill_tree(hTree); + himl = (HIMAGELIST)SendMessageA(hTree, TVM_GETIMAGELIST, TVSIL_STATE, 0); + ok(himl == NULL, "got %p\n", himl); + + SetWindowLongA(hTree, GWL_STYLE, GetWindowLongA(hTree, GWL_STYLE) | TVS_CHECKBOXES); + himl = (HIMAGELIST)SendMessageA(hTree, TVM_GETIMAGELIST, TVSIL_STATE, 0); + ok(himl != NULL, "got %p\n", himl); + + himl2 = (HIMAGELIST)SendMessageA(hTree, TVM_SETIMAGELIST, TVSIL_STATE, 0); + ok(himl2 == himl, "got %p\n", himl2); + + himl2 = (HIMAGELIST)SendMessageA(hTree, TVM_GETIMAGELIST, TVSIL_STATE, 0); + ok(himl2 == NULL, "got %p\n", himl2); + + item.hItem = hChild; + item.mask = TVIF_STATE; + item.state = INDEXTOSTATEIMAGEMASK(2); + item.stateMask = TVIS_STATEIMAGEMASK; + ret = SendMessageA(hTree, TVM_SETITEMA, 0, (LPARAM)&item); + expect(TRUE, ret); + + item.hItem = hChild; + item.mask = TVIF_STATE; + item.state = 0; + ret = SendMessageA(hTree, TVM_GETITEMA, 0, (LPARAM)&item); + expect(TRUE, ret); + ok(item.state == INDEXTOSTATEIMAGEMASK(2), "got 0x%x\n", item.state); + + while(GetMessageA(&msg, 0, 0, 0)) + { + TranslateMessage(&msg); + DispatchMessageA(&msg); + + if((msg.hwnd == hTree) && (msg.message == WM_PAINT)) + break; + } + + item.hItem = hChild; + item.mask = TVIF_STATE; + item.state = 0; + ret = SendMessageA(hTree, TVM_GETITEMA, 0, (LPARAM)&item); + expect(TRUE, ret); + ok(item.state == INDEXTOSTATEIMAGEMASK(1), "got 0x%x\n", item.state); + + himl = (HIMAGELIST)SendMessageA(hTree, TVM_GETIMAGELIST, TVSIL_STATE, 0); + ok(himl != NULL, "got %p\n", himl); + DestroyWindow(hTree); } @@ -1920,13 +2010,13 @@ static void test_TVM_HITTEST(void) fill_tree(hTree); *(HTREEITEM*)&rc = hRoot; - ret = SendMessage(hTree, TVM_GETITEMRECT, TRUE, (LPARAM)&rc); + ret = SendMessageA(hTree, TVM_GETITEMRECT, TRUE, (LPARAM)&rc); expect(TRUE, (BOOL)ret); ht.pt.x = rc.left-1; ht.pt.y = rc.top; - ret = SendMessage(hTree, TVM_HITTEST, 0, (LPARAM)&ht); + ret = SendMessageA(hTree, TVM_HITTEST, 0, (LPARAM)&ht); ok((HTREEITEM)ret == hRoot, "got %p, expected %p\n", (HTREEITEM)ret, hRoot); ok(ht.hItem == hRoot, "got %p, expected %p\n", ht.hItem, hRoot); ok(ht.flags == TVHT_ONITEMBUTTON, "got %d, expected %d\n", ht.flags, TVHT_ONITEMBUTTON); @@ -1935,13 +2025,13 @@ static void test_TVM_HITTEST(void) expect(TRUE, (BOOL)ret); *(HTREEITEM*)&rc = hChild; - ret = SendMessage(hTree, TVM_GETITEMRECT, TRUE, (LPARAM)&rc); + ret = SendMessageA(hTree, TVM_GETITEMRECT, TRUE, (LPARAM)&rc); expect(TRUE, (BOOL)ret); ht.pt.x = rc.left-1; ht.pt.y = rc.top; - ret = SendMessage(hTree, TVM_HITTEST, 0, (LPARAM)&ht); + ret = SendMessageA(hTree, TVM_HITTEST, 0, (LPARAM)&ht); ok((HTREEITEM)ret == hChild, "got %p, expected %p\n", (HTREEITEM)ret, hChild); ok(ht.hItem == hChild, "got %p, expected %p\n", ht.hItem, hChild); /* Wine returns item button here, but this item has no button */ @@ -1972,7 +2062,6 @@ START_TEST(treeview) ULONG_PTR ctx_cookie; HANDLE hCtx; - HWND hwnd; hComctl32 = GetModuleHandleA("comctl32.dll"); pInitCommonControlsEx = (void*)GetProcAddress(hComctl32, "InitCommonControlsEx"); @@ -1994,7 +2083,7 @@ START_TEST(treeview) wc.cbWndExtra = 0; wc.hInstance = GetModuleHandleA(NULL); wc.hIcon = NULL; - wc.hCursor = LoadCursorA(NULL, IDC_IBEAM); + wc.hCursor = LoadCursorA(NULL, (LPCSTR)IDC_IBEAM); wc.hbrBackground = GetSysColorBrush(COLOR_WINDOW); wc.lpszMenuName = NULL; wc.lpszClassName = "MyTestWnd"; @@ -2044,21 +2133,6 @@ START_TEST(treeview) return; } - /* this is a XP SP3 failure workaround */ - hwnd = CreateWindowExA(0, WC_TREEVIEW, "foo", - WS_CHILD | WS_BORDER | WS_VISIBLE, - 0, 0, 100, 100, - hMainWnd, NULL, GetModuleHandleA(NULL), NULL); - if (!IsWindow(hwnd)) - { - win_skip("FIXME: failed to create TreeView window.\n"); - unload_v6_module(ctx_cookie, hCtx); - DestroyWindow(hMainWnd); - return; - } - else - DestroyWindow(hwnd); - /* comctl32 version 6 tests start here */ test_expandedimage(); test_htreeitem_layout(); diff --git a/rostests/winetests/comctl32/updown.c b/rostests/winetests/comctl32/updown.c index bacc1126dc3..ed7d95b2451 100644 --- a/rostests/winetests/comctl32/updown.c +++ b/rostests/winetests/comctl32/updown.c @@ -210,7 +210,7 @@ static BOOL register_parent_wnd_class(void) cls.cbWndExtra = 0; cls.hInstance = GetModuleHandleA(NULL); cls.hIcon = 0; - cls.hCursor = LoadCursorA(0, IDC_ARROW); + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); cls.hbrBackground = GetStockObject(WHITE_BRUSH); cls.lpszMenuName = NULL; cls.lpszClassName = "Up-Down test parent class"; @@ -222,7 +222,7 @@ static HWND create_parent_window(void) if (!register_parent_wnd_class()) return NULL; - return CreateWindowEx(0, "Up-Down test parent class", + return CreateWindowExA(0, "Up-Down test parent class", "Up-Down test parent window", WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_VISIBLE, @@ -325,48 +325,48 @@ static void test_updown_pos(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); /* Set Range from 0 to 100 */ - SendMessage(updown, UDM_SETRANGE, 0 , MAKELONG(100,0) ); - r = SendMessage(updown, UDM_GETRANGE, 0,0); + SendMessageA(updown, UDM_SETRANGE, 0 , MAKELONG(100,0) ); + r = SendMessageA(updown, UDM_GETRANGE, 0,0); expect(100,LOWORD(r)); expect(0,HIWORD(r)); /* Set the position to 5, return is not checked as it was set before func call */ - SendMessage(updown, UDM_SETPOS, 0 , MAKELONG(5,0) ); + SendMessageA(updown, UDM_SETPOS, 0 , MAKELONG(5,0) ); /* Since UDM_SETBUDDYINT was not set at creation HIWORD(r) will always be 1 as a return from UDM_GETPOS */ /* Get the position, which should be 5 */ - r = SendMessage(updown, UDM_GETPOS, 0 , 0 ); + r = SendMessageA(updown, UDM_GETPOS, 0 , 0 ); expect(5,LOWORD(r)); expect(1,HIWORD(r)); /* Set the position to 0, return should be 5 */ - r = SendMessage(updown, UDM_SETPOS, 0 , MAKELONG(0,0) ); + r = SendMessageA(updown, UDM_SETPOS, 0 , MAKELONG(0,0) ); expect(5,r); /* Get the position, which should be 0 */ - r = SendMessage(updown, UDM_GETPOS, 0 , 0 ); + r = SendMessageA(updown, UDM_GETPOS, 0 , 0 ); expect(0,LOWORD(r)); expect(1,HIWORD(r)); /* Set the position to -1, return should be 0 */ - r = SendMessage(updown, UDM_SETPOS, 0 , MAKELONG(-1,0) ); + r = SendMessageA(updown, UDM_SETPOS, 0 , MAKELONG(-1,0) ); expect(0,r); /* Get the position, which should be 0 */ - r = SendMessage(updown, UDM_GETPOS, 0 , 0 ); + r = SendMessageA(updown, UDM_GETPOS, 0 , 0 ); expect(0,LOWORD(r)); expect(1,HIWORD(r)); /* Set the position to 100, return should be 0 */ - r = SendMessage(updown, UDM_SETPOS, 0 , MAKELONG(100,0) ); + r = SendMessageA(updown, UDM_SETPOS, 0 , MAKELONG(100,0) ); expect(0,r); /* Get the position, which should be 100 */ - r = SendMessage(updown, UDM_GETPOS, 0 , 0 ); + r = SendMessageA(updown, UDM_GETPOS, 0 , 0 ); expect(100,LOWORD(r)); expect(1,HIWORD(r)); /* Set the position to 101, return should be 100 */ - r = SendMessage(updown, UDM_SETPOS, 0 , MAKELONG(101,0) ); + r = SendMessageA(updown, UDM_SETPOS, 0 , MAKELONG(101,0) ); expect(100,r); /* Get the position, which should be 100 */ - r = SendMessage(updown, UDM_GETPOS, 0 , 0 ); + r = SendMessageA(updown, UDM_GETPOS, 0 , 0 ); expect(100,LOWORD(r)); expect(1,HIWORD(r)); @@ -376,19 +376,61 @@ static void test_updown_pos(void) /* there's no attempt to update buddy Edit if text didn't change */ SetWindowTextA(g_edit, "50"); - updown = create_updown_control(UDS_ALIGNRIGHT | UDS_SETBUDDYINT, g_edit); + updown = create_updown_control(UDS_ALIGNRIGHT | UDS_SETBUDDYINT | UDS_ARROWKEYS, g_edit); /* test sequence only on 5.8x versions */ - r = SendMessage(updown, UDM_GETPOS32, 0, 0); + r = SendMessageA(updown, UDM_GETPOS32, 0, 0); if (r) { + UDACCEL accel; + flush_sequences(sequences, NUM_MSG_SEQUENCES); - r = SendMessage(updown, UDM_SETPOS, 0, 50); + r = SendMessageA(updown, UDM_SETPOS, 0, 50); expect(50,r); ok_sequence(sequences, EDIT_SEQ_INDEX, test_updown_pos_nochange_seq, "test updown pos, no change", FALSE); + + SendMessageA(updown, UDM_SETRANGE, 0, MAKELONG(1, 40)); + r = SendMessageA(updown, UDM_GETRANGE, 0, 0); + expect(1, LOWORD(r)); + expect(40, HIWORD(r)); + + accel.nSec = 0; + accel.nInc = 5; + r = SendMessageA(updown, UDM_SETACCEL, 1, (LPARAM)&accel); + expect(TRUE, r); + + r = SendMessageA(updown, UDM_GETPOS, 0, 0); + expect(40, LOWORD(r)); + expect(1, HIWORD(r)); + + r = SendMessageA(updown, UDM_SETPOS, 0, MAKELONG(0, 0)); + expect(40, LOWORD(r)); + expect(0, HIWORD(r)); + + r = SendMessageA(updown, UDM_GETPOS, 0, 0); + expect(1, LOWORD(r)); + expect(0, HIWORD(r)); + + r = SendMessageA(updown, UDM_SETPOS, 0, MAKELONG(2, 0)); + expect(1, LOWORD(r)); + expect(0, HIWORD(r)); + + r = SendMessageA(g_edit, WM_KEYDOWN, VK_UP, 0); + expect(0, r); + r = SendMessageA(updown, UDM_GETPOS, 0, 0); + expect(1, LOWORD(r)); + expect(0, HIWORD(r)); + + r = SendMessageA(updown, UDM_SETPOS, 0, MAKELONG(50, 0)); + expect(1, LOWORD(r)); + expect(0, HIWORD(r)); + + r = SendMessageA(updown, UDM_GETPOS, 0, 0); + expect(40, LOWORD(r)); + expect(0, HIWORD(r)); } DestroyWindow(updown); @@ -405,10 +447,10 @@ static void test_updown_pos32(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); /* Set the position to 0 to 1000 */ - SendMessage(updown, UDM_SETRANGE32, 0 , 1000 ); + SendMessageA(updown, UDM_SETRANGE32, 0 , 1000 ); low = high = -1; - r = SendMessage(updown, UDM_GETRANGE32, (WPARAM) &low , (LPARAM) &high ); + r = SendMessageA(updown, UDM_GETRANGE32, (WPARAM) &low , (LPARAM) &high ); expect(0,r); if (low == -1) { @@ -421,7 +463,7 @@ static void test_updown_pos32(void) expect(1000,high); /* Set position to 500 */ - r = SendMessage(updown, UDM_SETPOS32, 0 , 500 ); + r = SendMessageA(updown, UDM_SETPOS32, 0 , 500 ); if (!r) { win_skip("UDM_SETPOS32 and UDM_GETPOS32 need 5.80\n"); @@ -432,35 +474,35 @@ static void test_updown_pos32(void) /* Since UDM_SETBUDDYINT was not set at creation bRet will always be true as a return from UDM_GETPOS32 */ - r = SendMessage(updown, UDM_GETPOS32, 0 , (LPARAM) &high ); + r = SendMessageA(updown, UDM_GETPOS32, 0 , (LPARAM) &high ); expect(500,r); expect(1,high); /* Set position to 0, return should be 500 */ - r = SendMessage(updown, UDM_SETPOS32, 0 , 0 ); + r = SendMessageA(updown, UDM_SETPOS32, 0 , 0 ); expect(500,r); - r = SendMessage(updown, UDM_GETPOS32, 0 , (LPARAM) &high ); + r = SendMessageA(updown, UDM_GETPOS32, 0 , (LPARAM) &high ); expect(0,r); expect(1,high); /* Set position to -1 which should become 0, return should be 0 */ - r = SendMessage(updown, UDM_SETPOS32, 0 , -1 ); + r = SendMessageA(updown, UDM_SETPOS32, 0 , -1 ); expect(0,r); - r = SendMessage(updown, UDM_GETPOS32, 0 , (LPARAM) &high ); + r = SendMessageA(updown, UDM_GETPOS32, 0 , (LPARAM) &high ); expect(0,r); expect(1,high); /* Set position to 1000, return should be 0 */ - r = SendMessage(updown, UDM_SETPOS32, 0 , 1000 ); + r = SendMessageA(updown, UDM_SETPOS32, 0 , 1000 ); expect(0,r); - r = SendMessage(updown, UDM_GETPOS32, 0 , (LPARAM) &high ); + r = SendMessageA(updown, UDM_GETPOS32, 0 , (LPARAM) &high ); expect(1000,r); expect(1,high); /* Set position to 1001 which should become 1000, return should be 1000 */ - r = SendMessage(updown, UDM_SETPOS32, 0 , 1001 ); + r = SendMessageA(updown, UDM_SETPOS32, 0 , 1001 ); expect(1000,r); - r = SendMessage(updown, UDM_GETPOS32, 0 , (LPARAM) &high ); + r = SendMessageA(updown, UDM_GETPOS32, 0 , (LPARAM) &high ); expect(1000,r); expect(1,high); @@ -474,7 +516,7 @@ static void test_updown_pos32(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); - r = SendMessage(updown, UDM_SETPOS32, 0, 50); + r = SendMessageA(updown, UDM_SETPOS32, 0, 50); expect(50,r); ok_sequence(sequences, EDIT_SEQ_INDEX, test_updown_pos_nochange_seq, "test updown pos, no change", FALSE); @@ -492,13 +534,13 @@ static void test_updown_buddy(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); - buddyReturn = (HWND)SendMessage(updown, UDM_GETBUDDY, 0 , 0 ); + buddyReturn = (HWND)SendMessageA(updown, UDM_GETBUDDY, 0 , 0 ); ok(buddyReturn == g_edit, "Expected edit handle\n"); - buddyReturn = (HWND)SendMessage(updown, UDM_SETBUDDY, (WPARAM) g_edit, 0); + buddyReturn = (HWND)SendMessageA(updown, UDM_SETBUDDY, (WPARAM) g_edit, 0); ok(buddyReturn == g_edit, "Expected edit handle\n"); - buddyReturn = (HWND)SendMessage(updown, UDM_GETBUDDY, 0 , 0 ); + buddyReturn = (HWND)SendMessageA(updown, UDM_GETBUDDY, 0 , 0 ); ok(buddyReturn == g_edit, "Expected edit handle\n"); ok_sequence(sequences, UPDOWN_SEQ_INDEX, test_updown_buddy_seq, "test updown buddy", TRUE); @@ -545,32 +587,32 @@ static void test_updown_base(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); - SendMessage(updown, UDM_SETBASE, 10 , 0); - r = SendMessage(updown, UDM_GETBASE, 0 , 0); + SendMessageA(updown, UDM_SETBASE, 10 , 0); + r = SendMessageA(updown, UDM_GETBASE, 0 , 0); expect(10,r); /* Set base to an invalid value, should return 0 and stay at 10 */ - r = SendMessage(updown, UDM_SETBASE, 80 , 0); + r = SendMessageA(updown, UDM_SETBASE, 80 , 0); expect(0,r); - r = SendMessage(updown, UDM_GETBASE, 0 , 0); + r = SendMessageA(updown, UDM_GETBASE, 0 , 0); expect(10,r); /* Set base to 16 now, should get 16 as the return */ - r = SendMessage(updown, UDM_SETBASE, 16 , 0); + r = SendMessageA(updown, UDM_SETBASE, 16 , 0); expect(10,r); - r = SendMessage(updown, UDM_GETBASE, 0 , 0); + r = SendMessageA(updown, UDM_GETBASE, 0 , 0); expect(16,r); /* Set base to an invalid value, should return 0 and stay at 16 */ - r = SendMessage(updown, UDM_SETBASE, 80 , 0); + r = SendMessageA(updown, UDM_SETBASE, 80 , 0); expect(0,r); - r = SendMessage(updown, UDM_GETBASE, 0 , 0); + r = SendMessageA(updown, UDM_GETBASE, 0 , 0); expect(16,r); /* Set base back to 10, return should be 16 */ - r = SendMessage(updown, UDM_SETBASE, 10 , 0); + r = SendMessageA(updown, UDM_SETBASE, 10 , 0); expect(16,r); - r = SendMessage(updown, UDM_GETBASE, 0 , 0); + r = SendMessageA(updown, UDM_GETBASE, 0 , 0); expect(10,r); ok_sequence(sequences, UPDOWN_SEQ_INDEX, test_updown_base_seq, "test updown base", FALSE); @@ -580,13 +622,13 @@ static void test_updown_base(void) /* switch base with buddy attached */ updown = create_updown_control(UDS_SETBUDDYINT | UDS_ALIGNRIGHT, g_edit); - r = SendMessage(updown, UDM_SETPOS, 0, 10); + r = SendMessageA(updown, UDM_SETPOS, 0, 10); expect(50, r); GetWindowTextA(g_edit, text, sizeof(text)/sizeof(CHAR)); ok(lstrcmpA(text, "10") == 0, "Expected '10', got '%s'\n", text); - r = SendMessage(updown, UDM_SETBASE, 16, 0); + r = SendMessageA(updown, UDM_SETBASE, 16, 0); expect(10, r); GetWindowTextA(g_edit, text, sizeof(text)/sizeof(CHAR)); @@ -607,14 +649,14 @@ static void test_updown_unicode(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); /* Set it to ANSI, don't check return as we don't know previous state */ - SendMessage(updown, UDM_SETUNICODEFORMAT, 0 , 0); - r = SendMessage(updown, UDM_GETUNICODEFORMAT, 0 , 0); + SendMessageA(updown, UDM_SETUNICODEFORMAT, 0 , 0); + r = SendMessageA(updown, UDM_GETUNICODEFORMAT, 0 , 0); expect(0,r); /* Now set it to Unicode format */ - r = SendMessage(updown, UDM_SETUNICODEFORMAT, 1 , 0); + r = SendMessageA(updown, UDM_SETUNICODEFORMAT, 1 , 0); expect(0,r); - r = SendMessage(updown, UDM_GETUNICODEFORMAT, 0 , 0); + r = SendMessageA(updown, UDM_GETUNICODEFORMAT, 0 , 0); if (!r) { win_skip("UDM_SETUNICODEFORMAT not available\n"); @@ -624,9 +666,9 @@ static void test_updown_unicode(void) expect(1,r); /* And now set it back to ANSI */ - r = SendMessage(updown, UDM_SETUNICODEFORMAT, 0 , 0); + r = SendMessageA(updown, UDM_SETUNICODEFORMAT, 0 , 0); expect(1,r); - r = SendMessage(updown, UDM_GETUNICODEFORMAT, 0 , 0); + r = SendMessageA(updown, UDM_GETUNICODEFORMAT, 0 , 0); expect(0,r); ok_sequence(sequences, UPDOWN_SEQ_INDEX, test_updown_unicode_seq, "test updown unicode", FALSE); @@ -722,7 +764,7 @@ static void test_UDS_SETBUDDYINT(void) SetWindowLongA(updown, GWL_STYLE, style | UDS_SETBUDDYINT); style = GetWindowLongA(updown, GWL_STYLE); ok(style & UDS_SETBUDDYINT, "Expected UDS_SETBUDDY to be set\n"); - SendMessage(updown, UDM_SETPOS, 0, 20); + SendMessageA(updown, UDM_SETPOS, 0, 20); GetWindowTextA(g_edit, text, sizeof(text)/sizeof(CHAR)); ok(lstrlenA(text) == 0, "Expected empty string\n"); DestroyWindow(updown); @@ -735,7 +777,7 @@ static void test_UDS_SETBUDDYINT(void) /* now remove style flag */ style = GetWindowLongA(updown, GWL_STYLE); SetWindowLongA(updown, GWL_STYLE, style & ~UDS_SETBUDDYINT); - SendMessage(updown, UDM_SETPOS, 0, 20); + SendMessageA(updown, UDM_SETPOS, 0, 20); GetWindowTextA(g_edit, text, sizeof(text)/sizeof(CHAR)); ok(lstrcmpA(text, "20") == 0, "Expected '20', got '%s'\n", text); /* set edit text directly, check position */ @@ -757,7 +799,7 @@ static void test_UDS_SETBUDDYINT(void) /* set style back */ style = GetWindowLongA(updown, GWL_STYLE); SetWindowLongA(updown, GWL_STYLE, style | UDS_SETBUDDYINT); - SendMessage(updown, UDM_SETPOS, 0, 30); + SendMessageA(updown, UDM_SETPOS, 0, 30); GetWindowTextA(g_edit, text, sizeof(text)/sizeof(CHAR)); ok(lstrcmpA(text, "30") == 0, "Expected '30', got '%s'\n", text); DestroyWindow(updown); diff --git a/rostests/winetests/comctl32/v6util.h b/rostests/winetests/comctl32/v6util.h index 848e95b9225..130059827c3 100644 --- a/rostests/winetests/comctl32/v6util.h +++ b/rostests/winetests/comctl32/v6util.h @@ -82,6 +82,9 @@ static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx) HANDLE hKernel32; HANDLE (WINAPI *pCreateActCtxA)(ACTCTXA*); BOOL (WINAPI *pActivateActCtx)(HANDLE, ULONG_PTR*); + BOOL (WINAPI *pFindActCtxSectionStringA)(DWORD,const GUID *,ULONG,LPCSTR,PACTCTX_SECTION_KEYED_DATA); + + ACTCTX_SECTION_KEYED_DATA data; ACTCTXA ctx; BOOL ret; @@ -91,6 +94,7 @@ static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx) hKernel32 = GetModuleHandleA("kernel32.dll"); pCreateActCtxA = (void*)GetProcAddress(hKernel32, "CreateActCtxA"); pActivateActCtx = (void*)GetProcAddress(hKernel32, "ActivateActCtx"); + pFindActCtxSectionStringA = (void*)GetProcAddress(hKernel32, "FindActCtxSectionStringA"); if (!(pCreateActCtxA && pActivateActCtx)) { win_skip("Activation contexts unsupported. No version 6 tests possible.\n"); @@ -135,6 +139,13 @@ static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx) DeleteFileA(manifest_name); } + data.cbSize = sizeof(data); + ret = pFindActCtxSectionStringA(0, NULL, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, + "comctl32.dll", &data); + ok(ret, "failed to find comctl32.dll in active context, %u\n", GetLastError()); + if (ret) + LoadLibraryA("comctl32.dll"); + return ret; }