Commit d2ab1731 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

user32/tests: Fix menu tests compilation with __WINESRC__ defined.

parent a562af5a
......@@ -64,15 +64,15 @@ static void init_function_pointers(void)
static BOOL correct_behavior(void)
{
HMENU hmenu;
MENUITEMINFO info;
MENUITEMINFOA info;
BOOL rc;
hmenu = CreateMenu();
memset(&info, 0, sizeof(MENUITEMINFO));
info.cbSize= sizeof(MENUITEMINFO);
memset(&info, 0, sizeof(MENUITEMINFOA));
info.cbSize= sizeof(MENUITEMINFOA);
SetLastError(0xdeadbeef);
rc = GetMenuItemInfo(hmenu, 0, TRUE, &info);
rc = GetMenuItemInfoA(hmenu, 0, TRUE, &info);
/* Win9x : 0xdeadbeef
* NT4 : ERROR_INVALID_PARAMETER
* >= W2K : ERROR_MENU_ITEM_NOT_FOUND
......@@ -94,12 +94,12 @@ static LRESULT WINAPI menu_check_wnd_proc(HWND hwnd, UINT msg, WPARAM wparam, LP
{
case WM_ENTERMENULOOP:
/* mark window as having entered menu loop */
SetWindowLongPtr(hwnd, GWLP_USERDATA, TRUE);
SetWindowLongPtrA(hwnd, GWLP_USERDATA, TRUE);
/* exit menu modal loop
* ( A SendMessage does not work on NT3.51 here ) */
return PostMessage(hwnd, WM_CANCELMODE, 0, 0);
return PostMessageA(hwnd, WM_CANCELMODE, 0, 0);
}
return DefWindowProc(hwnd, msg, wparam, lparam);
return DefWindowProcA(hwnd, msg, wparam, lparam);
}
/* The MSVC headers ignore our NONAMELESSUNION requests so we have to define
......@@ -182,7 +182,7 @@ static LRESULT WINAPI menu_ownerdraw_wnd_proc(HWND hwnd, UINT msg,
case WM_DRAWITEM:
{
DRAWITEMSTRUCT * pdis;
TEXTMETRIC tm;
TEXTMETRICA tm;
HPEN oldpen;
char chrs[]="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
SIZE sz;
......@@ -212,12 +212,12 @@ static LRESULT WINAPI menu_ownerdraw_wnd_proc(HWND hwnd, UINT msg,
strcpy( buf, MOD_txtsizes[i].text);
if( ( p = strchr( buf, '\t'))) {
*p = '\0';
DrawText( pdis->hDC, p + 1, -1, &rc,
DrawTextA( pdis->hDC, p + 1, -1, &rc,
DT_SINGLELINE|DT_CALCRECT);
MOD_txtsizes[i].sc_size.cx= rc.right - rc.left;
MOD_txtsizes[i].sc_size.cy= rc.bottom - rc.top;
}
DrawText( pdis->hDC, buf, -1, &rc,
DrawTextA( pdis->hDC, buf, -1, &rc,
DT_SINGLELINE|DT_CALCRECT);
MOD_txtsizes[i].size.cx= rc.right - rc.left;
MOD_txtsizes[i].size.cy= rc.bottom - rc.top;
......@@ -227,9 +227,9 @@ static LRESULT WINAPI menu_ownerdraw_wnd_proc(HWND hwnd, UINT msg,
/* store the rectangle */
MOD_rc[pdis->itemData] = pdis->rcItem;
/* calculate average character width */
GetTextExtentPoint( pdis->hDC, chrs, 52, &sz );
GetTextExtentPointA( pdis->hDC, chrs, 52, &sz );
MOD_avec = (sz.cx + 26)/52;
GetTextMetrics( pdis->hDC, &tm);
GetTextMetricsA( pdis->hDC, &tm);
MOD_hic = tm.tmHeight;
MOD_GotDrawItemMsg = TRUE;
return TRUE;
......@@ -243,31 +243,31 @@ static LRESULT WINAPI menu_ownerdraw_wnd_proc(HWND hwnd, UINT msg,
ok( hmenupopup == hmenu, "MN_GETHMENU returns %p expected %p\n",
hmenu, hmenupopup);
}
PostMessage(hwnd, WM_CANCELMODE, 0, 0);
PostMessageA(hwnd, WM_CANCELMODE, 0, 0);
return TRUE;
}
}
return DefWindowProc(hwnd, msg, wparam, lparam);
return DefWindowProcA(hwnd, msg, wparam, lparam);
}
static void register_menu_check_class(void)
{
WNDCLASS wc =
WNDCLASSA wc =
{
0,
menu_check_wnd_proc,
0,
0,
GetModuleHandle(NULL),
GetModuleHandleA(NULL),
NULL,
LoadCursor(NULL, IDC_ARROW),
LoadCursorA(NULL, (LPCSTR)IDC_ARROW),
(HBRUSH)(COLOR_BTNFACE+1),
NULL,
TEXT("WineMenuCheck"),
"WineMenuCheck",
};
atomMenuCheckClass = RegisterClass(&wc);
atomMenuCheckClass = RegisterClassA(&wc);
}
static void test_getmenubarinfo(void)
......@@ -286,7 +286,7 @@ static void test_getmenubarinfo(void)
mbi.cbSize = sizeof(MENUBARINFO);
hwnd = CreateWindowEx(0, MAKEINTATOM(atomMenuCheckClass), NULL,
hwnd = CreateWindowExA(0, (LPCSTR)MAKEINTATOM(atomMenuCheckClass), NULL,
WS_SYSMENU | WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 100, 100,
NULL, NULL, NULL, NULL);
ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError());
......@@ -350,9 +350,9 @@ static void test_getmenubarinfo(void)
ok(mbi.fFocused == 0, "fFocused: Got %d instead of 0.\n", mbi.fFocused);
/* add some items */
ret = AppendMenu(hmenu, MF_STRING , 100, "item 1");
ret = AppendMenuA(hmenu, MF_STRING , 100, "item 1");
ok(ret, "AppendMenu failed.\n");
ret = AppendMenu(hmenu, MF_STRING , 101, "item 2");
ret = AppendMenuA(hmenu, MF_STRING , 101, "item 2");
ok(ret, "AppendMenu failed.\n");
ret = SetMenu(hwnd, hmenu);
ok(ret, "SetMenu failed with error %d\n", GetLastError());
......@@ -404,13 +404,13 @@ static void test_menu_locked_by_window(void)
{
BOOL ret;
HMENU hmenu;
HWND hwnd = CreateWindowEx(0, MAKEINTATOM(atomMenuCheckClass), NULL,
HWND hwnd = CreateWindowExA(0, (LPCSTR)MAKEINTATOM(atomMenuCheckClass), NULL,
WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 200, 200,
NULL, NULL, NULL, NULL);
ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError());
hmenu = CreateMenu();
ok(hmenu != NULL, "CreateMenu failed with error %d\n", GetLastError());
ret = InsertMenu(hmenu, 0, MF_STRING, 0, TEXT("&Test"));
ret = InsertMenuA(hmenu, 0, MF_STRING, 0, "&Test");
ok(ret, "InsertMenu failed with error %d\n", GetLastError());
ret = SetMenu(hwnd, hmenu);
ok(ret, "SetMenu failed with error %d\n", GetLastError());
......@@ -424,9 +424,9 @@ static void test_menu_locked_by_window(void)
ret = IsMenu(GetMenu(hwnd));
ok(!ret || broken(ret) /* nt4 */, "Menu handle should have been destroyed\n");
SendMessage(hwnd, WM_SYSCOMMAND, SC_KEYMENU, 0);
SendMessageA(hwnd, WM_SYSCOMMAND, SC_KEYMENU, 0);
/* did we process the WM_INITMENU message? */
ret = GetWindowLongPtr(hwnd, GWLP_USERDATA);
ret = GetWindowLongPtrA(hwnd, GWLP_USERDATA);
todo_wine {
ok(ret, "WM_INITMENU should have been sent\n");
}
......@@ -444,12 +444,12 @@ static LRESULT WINAPI subpopuplocked_wnd_proc(HWND hwnd, UINT msg, WPARAM wparam
case WM_ENTERIDLE:
hwndmenu = GetCapture();
if( hwndmenu) {
PostMessage( hwndmenu, WM_KEYDOWN, VK_DOWN, 0);
PostMessage( hwndmenu, WM_KEYDOWN, VK_RIGHT, 0);
PostMessage( hwndmenu, WM_KEYDOWN, VK_RETURN, 0);
PostMessageA( hwndmenu, WM_KEYDOWN, VK_DOWN, 0);
PostMessageA( hwndmenu, WM_KEYDOWN, VK_RIGHT, 0);
PostMessageA( hwndmenu, WM_KEYDOWN, VK_RETURN, 0);
}
}
return DefWindowProc(hwnd, msg, wparam, lparam);
return DefWindowProcA(hwnd, msg, wparam, lparam);
}
static void test_subpopup_locked_by_menu(void)
......@@ -458,7 +458,7 @@ static void test_subpopup_locked_by_menu(void)
BOOL ret;
HMENU hmenu, hsubmenu;
MENUINFO mi = { sizeof( MENUINFO)};
MENUITEMINFO mii = { sizeof( MENUITEMINFO)};
MENUITEMINFOA mii = { sizeof( MENUITEMINFOA)};
HWND hwnd;
const int itemid = 0x1234567;
if( !pGetMenuInfo)
......@@ -467,23 +467,23 @@ static void test_subpopup_locked_by_menu(void)
return;
}
/* create window, popupmenu with one subpopup */
hwnd = CreateWindowEx(0, MAKEINTATOM(atomMenuCheckClass), NULL,
hwnd = CreateWindowExA(0, (LPCSTR)MAKEINTATOM(atomMenuCheckClass), NULL,
WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 200, 200,
NULL, NULL, NULL, NULL);
ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError());
SetWindowLongPtr( hwnd, GWLP_WNDPROC, (LONG_PTR) subpopuplocked_wnd_proc);
SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR) subpopuplocked_wnd_proc);
hmenu = CreatePopupMenu();
ok(hmenu != NULL, "CreateMenu failed with error %d\n", GetLastError());
hsubmenu = CreatePopupMenu();
ok(hsubmenu != NULL, "CreateMenu failed with error %d\n", GetLastError());
ret = InsertMenu(hmenu, 0, MF_BYPOSITION | MF_POPUP | MF_STRING, (UINT_PTR)hsubmenu,
TEXT("PopUpLockTest"));
ret = InsertMenuA(hmenu, 0, MF_BYPOSITION | MF_POPUP | MF_STRING, (UINT_PTR)hsubmenu,
"PopUpLockTest");
ok(ret, "InsertMenu failed with error %d\n", GetLastError());
ret = InsertMenu(hsubmenu, 0, MF_BYPOSITION | MF_STRING, itemid, TEXT("PopUpMenu"));
ret = InsertMenuA(hsubmenu, 0, MF_BYPOSITION | MF_STRING, itemid, "PopUpMenu");
ok(ret, "InsertMenu failed with error %d\n", GetLastError());
/* first some tests that all this functions properly */
mii.fMask = MIIM_SUBMENU;
ret = GetMenuItemInfo( hmenu, 0, TRUE, &mii);
ret = GetMenuItemInfoA( hmenu, 0, TRUE, &mii);
ok( ret, "GetMenuItemInfo failed error %d\n", GetLastError());
ok( mii.hSubMenu == hsubmenu, "submenu is %p\n", mii.hSubMenu);
mi.fMask |= MIM_STYLE;
......@@ -507,7 +507,7 @@ static void test_subpopup_locked_by_menu(void)
ok(ret, "DestroyMenu failed with error %d\n", GetLastError());
/* and repeat the tests */
mii.fMask = MIIM_SUBMENU;
ret = GetMenuItemInfo( hmenu, 0, TRUE, &mii);
ret = GetMenuItemInfoA( hmenu, 0, TRUE, &mii);
ok( ret, "GetMenuItemInfo failed error %d\n", GetLastError());
/* GetMenuInfo fails now */
ok( mii.hSubMenu == hsubmenu, "submenu is %p\n", mii.hSubMenu);
......@@ -539,22 +539,22 @@ static void test_menu_ownerdraw(void)
int i,j,k;
BOOL ret;
HMENU hmenu;
MENUITEMINFO mii;
MENUITEMINFOA mii;
LONG leftcol;
HWND hwnd = CreateWindowEx(0, MAKEINTATOM(atomMenuCheckClass), NULL,
HWND hwnd = CreateWindowExA(0, (LPCSTR)MAKEINTATOM(atomMenuCheckClass), NULL,
WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 200, 200,
NULL, NULL, NULL, NULL);
ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError());
if( !hwnd) return;
SetWindowLongPtr( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_ownerdraw_wnd_proc);
SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_ownerdraw_wnd_proc);
hmenu = CreatePopupMenu();
ok(hmenu != NULL, "CreateMenu failed with error %d\n", GetLastError());
if( !hmenu) { DestroyWindow(hwnd);return;}
k=0;
for( j=0;j<2;j++) /* create columns */
for(i=0;i<2;i++) { /* create rows */
ret = AppendMenu( hmenu, MF_OWNERDRAW |
(i==0 ? MF_MENUBREAK : 0), k, MAKEINTRESOURCE(k));
ret = AppendMenuA( hmenu, MF_OWNERDRAW |
(i==0 ? MF_MENUBREAK : 0), k, (LPCSTR)MAKEINTRESOURCE(k));
k++;
ok( ret, "AppendMenu failed for %d\n", k-1);
}
......@@ -583,7 +583,7 @@ static void test_menu_ownerdraw(void)
/* test what MF_MENUBREAK did at the first position. Also show
* that an MF_SEPARATOR is ignored in the height calculation. */
leftcol= MOD_rc[0].left;
ModifyMenu( hmenu, 0, MF_BYCOMMAND| MF_OWNERDRAW| MF_SEPARATOR, 0, 0);
ModifyMenuA( hmenu, 0, MF_BYCOMMAND| MF_OWNERDRAW| MF_SEPARATOR, 0, 0);
/* display the menu */
TrackPopupMenu( hmenu, TPM_RETURNCMD, 100,100, 0, hwnd, NULL);
/* left should be 4 pixels less now */
......@@ -600,7 +600,7 @@ static void test_menu_ownerdraw(void)
MOD_rc[0].bottom - MOD_rc[0].top, MOD_SIZE);
/* test owner-drawn callback bitmap */
ModifyMenu( hmenu, 1, MF_BYPOSITION | MFT_BITMAP, 1, (LPCSTR)HBMMENU_CALLBACK );
ModifyMenuA( hmenu, 1, MF_BYPOSITION | MFT_BITMAP, 1, (LPCSTR)HBMMENU_CALLBACK );
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_BITMAP | MIIM_FTYPE | MIIM_ID;
if (GetMenuItemInfoA( hmenu, 1, TRUE, &mii ))
......@@ -619,7 +619,7 @@ static void test_menu_ownerdraw(void)
if( !hmenu) { DestroyWindow(hwnd);return;}
MOD_maxid=1;
for(i=0;i<2;i++) {
ret = AppendMenu( hmenu, MF_OWNERDRAW , i, 0);
ret = AppendMenuA( hmenu, MF_OWNERDRAW, i, 0 );
ok( ret, "AppendMenu failed for %d\n", i);
}
ret = SetMenu( hwnd, hmenu);
......@@ -647,7 +647,7 @@ static void test_mbs_help( int ispop, int hassub, int mnuopt,
{
BOOL ret;
HMENU hmenu, submenu;
MENUITEMINFO mii={ sizeof( MENUITEMINFO )};
MENUITEMINFOA mii={ sizeof( MENUITEMINFOA )};
MENUINFO mi;
RECT rc;
CHAR text_copy[16];
......@@ -696,7 +696,7 @@ static void test_mbs_help( int ispop, int hassub, int mnuopt,
ret = pSetMenuInfo( hmenu, &mi);
ok( ret, "SetMenuInfo failed with error %d\n", GetLastError());
}
ret = InsertMenuItem( hmenu, 0, FALSE, &mii);
ret = InsertMenuItemA( hmenu, 0, FALSE, &mii);
ok( ret, "InsertMenuItem failed with error %d\n", GetLastError());
failed = !ret;
if( winetest_debug) {
......@@ -706,7 +706,7 @@ static void test_mbs_help( int ispop, int hassub, int mnuopt,
sprintf( buf,"%d text \"%s\" mnuopt %d", count, text ? text: "(nil)", mnuopt);
FillRect( hdc, &rc, (HBRUSH) COLOR_WINDOW);
TextOut( hdc, 10, 50, buf, strlen( buf));
TextOutA( hdc, 10, 50, buf, strlen( buf));
ReleaseDC( hwnd, hdc);
}
if(ispop)
......@@ -819,11 +819,11 @@ static void test_menu_bmp_and_string(void)
}
memset( bmfill, 0xcc, sizeof( bmfill));
hwnd = CreateWindowEx(0, MAKEINTATOM(atomMenuCheckClass), NULL, WS_SYSMENU |
hwnd = CreateWindowExA(0, (LPCSTR)MAKEINTATOM(atomMenuCheckClass), NULL, WS_SYSMENU |
WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 200, 200,
NULL, NULL, NULL, NULL);
hbm_arrow=LoadBitmap( 0, (CHAR*)OBM_MNARROW);
GetObject( hbm_arrow, sizeof(bm), &bm);
hbm_arrow = LoadBitmapA( 0, (LPCSTR)OBM_MNARROW);
GetObjectA( hbm_arrow, sizeof(bm), &bm);
arrowwidth = bm.bmWidth;
ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError());
if( !hwnd) return;
......@@ -843,7 +843,7 @@ static void test_menu_bmp_and_string(void)
ok( HBMMENU_POPUP_CLOSE == mii.hbmpItem, "Item info did not get the right hbitmap: got %p expected %p\n",
mii.hbmpItem, HBMMENU_POPUP_CLOSE);
SetWindowLongPtr( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_ownerdraw_wnd_proc);
SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_ownerdraw_wnd_proc);
if( winetest_debug)
trace(" check %d,%d arrow %d avechar %d\n",
......@@ -890,7 +890,7 @@ static void test_menu_bmp_and_string(void)
static void test_menu_add_string( void )
{
HMENU hmenu;
MENUITEMINFO info;
MENUITEMINFOA info;
BOOL rc;
int ret;
......@@ -912,7 +912,7 @@ static void test_menu_add_string( void )
info.dwItemData = 0;
info.wID = 1;
info.fState = 0;
InsertMenuItem(hmenu, 0, TRUE, &info );
InsertMenuItemA(hmenu, 0, TRUE, &info );
memset( &info, 0, sizeof info );
info.cbSize = sizeof info;
......@@ -920,22 +920,22 @@ static void test_menu_add_string( void )
info.dwTypeData = string;
info.cch = sizeof string;
string[0] = 0;
GetMenuItemInfo( hmenu, 0, TRUE, &info );
GetMenuItemInfoA( hmenu, 0, TRUE, &info );
ok( !strcmp( string, "blah" ), "menu item name differed\n");
/* Test combination of ownerdraw and strings with GetMenuItemString(A/W) */
strcpy(string, "Dummy string");
memset(&info, 0x00, sizeof(info));
info.cbSize= sizeof(MENUITEMINFO);
info.cbSize= sizeof(MENUITEMINFOA);
info.fMask= MIIM_FTYPE | MIIM_STRING; /* Set OwnerDraw + typeData */
info.fType= MFT_OWNERDRAW;
info.dwTypeData= string;
rc = InsertMenuItem( hmenu, 0, TRUE, &info );
rc = InsertMenuItemA( hmenu, 0, TRUE, &info );
ok (rc, "InsertMenuItem failed\n");
strcpy(string,"Garbage");
ok (GetMenuString( hmenu, 0, strback, 99, MF_BYPOSITION), "GetMenuString on ownerdraw entry failed\n");
ok (GetMenuStringA( hmenu, 0, strback, 99, MF_BYPOSITION), "GetMenuString on ownerdraw entry failed\n");
ok (!strcmp( strback, "Dummy string" ), "Menu text from Ansi version incorrect\n");
SetLastError(0xdeadbeef);
......@@ -950,56 +950,56 @@ static void test_menu_add_string( void )
/* Just change ftype to string and see what text is stored */
memset(&info, 0x00, sizeof(info));
info.cbSize= sizeof(MENUITEMINFO);
info.cbSize= sizeof(MENUITEMINFOA);
info.fMask= MIIM_FTYPE; /* Set string type */
info.fType= MFT_STRING;
info.dwTypeData= (char *)0xdeadbeef;
rc = SetMenuItemInfo( hmenu, 0, TRUE, &info );
info.dwTypeData= (char *)0xdeadbeef;
rc = SetMenuItemInfoA( hmenu, 0, TRUE, &info );
ok (rc, "SetMenuItemInfo failed\n");
/* Did we keep the old dwTypeData? */
ok (GetMenuString( hmenu, 0, strback, 99, MF_BYPOSITION), "GetMenuString on ownerdraw entry failed\n");
ok (GetMenuStringA( hmenu, 0, strback, 99, MF_BYPOSITION), "GetMenuString on ownerdraw entry failed\n");
ok (!strcmp( strback, "Dummy string" ), "Menu text from Ansi version incorrect\n");
/* Ensure change to bitmap type fails */
memset(&info, 0x00, sizeof(info));
info.cbSize= sizeof(MENUITEMINFO);
info.cbSize= sizeof(MENUITEMINFOA);
info.fMask= MIIM_FTYPE; /* Set as bitmap type */
info.fType= MFT_BITMAP;
info.dwTypeData= (char *)0xdeadbee2;
rc = SetMenuItemInfo( hmenu, 0, TRUE, &info );
rc = SetMenuItemInfoA( hmenu, 0, TRUE, &info );
ok (!rc, "SetMenuItemInfo unexpectedly worked\n");
/* Just change ftype back and ensure data hasn't been freed */
info.fType= MFT_OWNERDRAW; /* Set as ownerdraw type */
info.dwTypeData= (char *)0xdeadbee3;
rc = SetMenuItemInfo( hmenu, 0, TRUE, &info );
rc = SetMenuItemInfoA( hmenu, 0, TRUE, &info );
ok (rc, "SetMenuItemInfo failed\n");
/* Did we keep the old dwTypeData? */
ok (GetMenuString( hmenu, 0, strback, 99, MF_BYPOSITION), "GetMenuString on ownerdraw entry failed\n");
ok (GetMenuStringA( hmenu, 0, strback, 99, MF_BYPOSITION), "GetMenuString on ownerdraw entry failed\n");
ok (!strcmp( strback, "Dummy string" ), "Menu text from Ansi version incorrect\n");
/* Just change string value (not type) */
memset(&info, 0x00, sizeof(info));
info.cbSize= sizeof(MENUITEMINFO);
info.cbSize= sizeof(MENUITEMINFOA);
info.fMask= MIIM_STRING; /* Set typeData */
strcpy(string2, "string2");
info.dwTypeData= string2;
rc = SetMenuItemInfo( hmenu, 0, TRUE, &info );
info.dwTypeData= string2;
rc = SetMenuItemInfoA( hmenu, 0, TRUE, &info );
ok (rc, "SetMenuItemInfo failed\n");
ok (GetMenuString( hmenu, 0, strback, 99, MF_BYPOSITION), "GetMenuString on ownerdraw entry failed\n");
ok (GetMenuStringA( hmenu, 0, strback, 99, MF_BYPOSITION), "GetMenuString on ownerdraw entry failed\n");
ok (!strcmp( strback, "string2" ), "Menu text from Ansi version incorrect\n");
/* crashes with wine 0.9.5 */
memset(&info, 0x00, sizeof(info));
info.cbSize= sizeof(MENUITEMINFO);
info.cbSize= sizeof(MENUITEMINFOA);
info.fMask= MIIM_FTYPE | MIIM_STRING; /* Set OwnerDraw + typeData */
info.fType= MFT_OWNERDRAW;
rc = InsertMenuItem( hmenu, 0, TRUE, &info );
rc = InsertMenuItemA( hmenu, 0, TRUE, &info );
ok (rc, "InsertMenuItem failed\n");
ok (!GetMenuString( hmenu, 0, NULL, 0, MF_BYPOSITION),
ok (!GetMenuStringA( hmenu, 0, NULL, 0, MF_BYPOSITION),
"GetMenuString on ownerdraw entry succeeded.\n");
SetLastError(0xdeadbeef);
ret = GetMenuStringW( hmenu, 0, NULL, 0, MF_BYPOSITION);
......@@ -1693,7 +1693,7 @@ static void test_menu_iteminfo( void )
static void test_menu_search_bycommand( void )
{
HMENU hmenu, hmenuSub, hmenuSub2;
MENUITEMINFO info;
MENUITEMINFOA info;
BOOL rc;
UINT id;
char strback[0x80];
......@@ -1703,7 +1703,7 @@ static void test_menu_search_bycommand( void )
/* Case 1: Menu containing a menu item */
hmenu = CreateMenu();
memset( &info, 0, sizeof info );
info.cbSize = sizeof info;
info.fMask = MIIM_FTYPE | MIIM_STRING | MIIM_ID;
......@@ -1711,8 +1711,8 @@ static void test_menu_search_bycommand( void )
strcpy(strIn, "Case 1 MenuItem");
info.dwTypeData = strIn;
info.wID = (UINT) 0x1234;
rc = InsertMenuItem(hmenu, 0, TRUE, &info );
rc = InsertMenuItemA(hmenu, 0, TRUE, &info );
ok (rc, "Inserting the menuitem failed\n");
id = GetMenuItemID(hmenu, 0);
......@@ -1721,12 +1721,12 @@ static void test_menu_search_bycommand( void )
/* Confirm the menuitem was given the id supplied (getting by position) */
memset( &info, 0, sizeof info );
strback[0] = 0x00;
info.cbSize = sizeof(MENUITEMINFO);
info.cbSize = sizeof(MENUITEMINFOA);
info.fMask = MIIM_FTYPE | MIIM_ID | MIIM_STRING;
info.dwTypeData = strback;
info.cch = sizeof(strback);
rc = GetMenuItemInfo(hmenu, 0, TRUE, &info); /* Get by position */
rc = GetMenuItemInfoA(hmenu, 0, TRUE, &info); /* Get by position */
ok (rc, "Getting the menu items info failed\n");
ok (info.wID == 0x1234, "IDs differ for the menuitem\n");
ok (!strcmp(info.dwTypeData, "Case 1 MenuItem"), "Returned item has wrong label\n");
......@@ -1734,11 +1734,11 @@ static void test_menu_search_bycommand( void )
/* Search by id - Should return the item */
memset( &info, 0, sizeof info );
strback[0] = 0x00;
info.cbSize = sizeof(MENUITEMINFO);
info.cbSize = sizeof(MENUITEMINFOA);
info.fMask = MIIM_FTYPE | MIIM_ID | MIIM_STRING;
info.dwTypeData = strback;
info.cch = sizeof(strback);
rc = GetMenuItemInfo(hmenu, 0x1234, FALSE, &info); /* Get by ID */
rc = GetMenuItemInfoA(hmenu, 0x1234, FALSE, &info); /* Get by ID */
ok (rc, "Getting the menu items info failed\n");
ok (info.wID == 0x1234, "IDs differ for the menuitem\n");
......@@ -1749,9 +1749,9 @@ static void test_menu_search_bycommand( void )
/* Case 2: Menu containing a popup menu */
hmenu = CreateMenu();
hmenuSub = CreateMenu();
strcpy(strIn, "Case 2 SubMenu");
rc = InsertMenu(hmenu, 0, MF_BYPOSITION | MF_POPUP | MF_STRING, (UINT_PTR)hmenuSub, strIn);
rc = InsertMenuA(hmenu, 0, MF_BYPOSITION | MF_POPUP | MF_STRING, (UINT_PTR)hmenuSub, strIn);
ok (rc, "Inserting the popup menu into the main menu failed\n");
id = GetMenuItemID(hmenu, 0);
......@@ -1760,13 +1760,13 @@ static void test_menu_search_bycommand( void )
/* Confirm the menuitem itself was given an id the same as the HMENU, (getting by position) */
memset( &info, 0, sizeof info );
strback[0] = 0x00;
info.cbSize = sizeof(MENUITEMINFO);
info.cbSize = sizeof(MENUITEMINFOA);
info.fMask = MIIM_FTYPE | MIIM_ID | MIIM_STRING;
info.dwTypeData = strback;
info.cch = sizeof(strback);
info.wID = 0xdeadbeef;
rc = GetMenuItemInfo(hmenu, 0, TRUE, &info); /* Get by position */
rc = GetMenuItemInfoA(hmenu, 0, TRUE, &info); /* Get by position */
ok (rc, "Getting the menu items info failed\n");
ok (info.wID == (UINT_PTR)hmenuSub, "IDs differ for the menuitem\n");
ok (!strcmp(info.dwTypeData, "Case 2 SubMenu"), "Returned item has wrong label\n");
......@@ -1774,11 +1774,11 @@ static void test_menu_search_bycommand( void )
/* Search by id - returns the popup menu itself */
memset( &info, 0, sizeof info );
strback[0] = 0x00;
info.cbSize = sizeof(MENUITEMINFO);
info.cbSize = sizeof(MENUITEMINFOA);
info.fMask = MIIM_FTYPE | MIIM_ID | MIIM_STRING;
info.dwTypeData = strback;
info.cch = sizeof(strback);
rc = GetMenuItemInfo(hmenu, (UINT_PTR)hmenuSub, FALSE, &info); /* Get by ID */
rc = GetMenuItemInfoA(hmenu, (UINT_PTR)hmenuSub, FALSE, &info); /* Get by ID */
ok (rc, "Getting the menu items info failed\n");
ok (info.wID == (UINT_PTR)hmenuSub, "IDs differ for the popup menu\n");
......@@ -1794,17 +1794,17 @@ static void test_menu_search_bycommand( void )
strcpy(strIn, "Case 2 MenuItem 1");
info.dwTypeData = strIn;
info.wID = (UINT_PTR) hmenuSub;
rc = InsertMenuItem(hmenu, -1, TRUE, &info );
rc = InsertMenuItemA(hmenu, -1, TRUE, &info );
ok (rc, "Inserting the menuitem failed\n");
/* Search by id - returns the item which follows the popup menu */
memset( &info, 0, sizeof info );
strback[0] = 0x00;
info.cbSize = sizeof(MENUITEMINFO);
info.cbSize = sizeof(MENUITEMINFOA);
info.fMask = MIIM_FTYPE | MIIM_ID | MIIM_STRING;
info.dwTypeData = strback;
info.cch = sizeof(strback);
rc = GetMenuItemInfo(hmenu, (UINT_PTR)hmenuSub, FALSE, &info); /* Get by ID */
rc = GetMenuItemInfoA(hmenu, (UINT_PTR)hmenuSub, FALSE, &info); /* Get by ID */
ok (rc, "Getting the menu items info failed\n");
ok (info.wID == (UINT_PTR)hmenuSub, "IDs differ for the popup menu\n");
......@@ -1820,17 +1820,17 @@ static void test_menu_search_bycommand( void )
strcpy(strIn, "Case 2 MenuItem 2");
info.dwTypeData = strIn;
info.wID = (UINT_PTR) hmenuSub;
rc = InsertMenuItem(hmenu, 0, TRUE, &info );
rc = InsertMenuItemA(hmenu, 0, TRUE, &info );
ok (rc, "Inserting the menuitem failed\n");
/* Search by id - returns the item which precedes the popup menu */
memset( &info, 0, sizeof info );
strback[0] = 0x00;
info.cbSize = sizeof(MENUITEMINFO);
info.cbSize = sizeof(MENUITEMINFOA);
info.fMask = MIIM_FTYPE | MIIM_ID | MIIM_STRING;
info.dwTypeData = strback;
info.cch = sizeof(strback);
rc = GetMenuItemInfo(hmenu, (UINT_PTR)hmenuSub, FALSE, &info); /* Get by ID */
rc = GetMenuItemInfoA(hmenu, (UINT_PTR)hmenuSub, FALSE, &info); /* Get by ID */
ok (rc, "Getting the menu items info failed\n");
ok (info.wID == (UINT_PTR)hmenuSub, "IDs differ for the popup menu\n");
......@@ -1854,10 +1854,10 @@ static void test_menu_search_bycommand( void )
info.dwTypeData = menuitem;
info.wID = (UINT_PTR) hmenuSub; /* Enforce id collisions with the hmenu of the popup submenu*/
rc = InsertMenu(hmenu, 0, MF_BYPOSITION | MF_POPUP | MF_STRING, (UINT_PTR)hmenuSub, "Submenu");
rc = InsertMenuA(hmenu, 0, MF_BYPOSITION | MF_POPUP | MF_STRING, (UINT_PTR)hmenuSub, "Submenu");
ok (rc, "Inserting the popup menu into the main menu failed\n");
rc = InsertMenuItem(hmenuSub, 0, TRUE, &info );
rc = InsertMenuItemA(hmenuSub, 0, TRUE, &info );
ok (rc, "Inserting the sub menu menuitem failed\n");
memset( &info, 0, sizeof info );
......@@ -1867,7 +1867,7 @@ static void test_menu_search_bycommand( void )
info.dwTypeData = menuitem2;
info.wID = (UINT_PTR) hmenuSub; /* Enforce id collisions with the hmenu of the popup submenu*/
rc = InsertMenuItem(hmenuSub, 1, TRUE, &info );
rc = InsertMenuItemA(hmenuSub, 1, TRUE, &info );
ok (rc, "Inserting the sub menu menuitem 2 failed\n");
/* Prove that you can't query the id of a popup directly (By position) */
......@@ -1877,30 +1877,30 @@ static void test_menu_search_bycommand( void )
/* Prove getting the item info via ID returns the first item (not the popup or 2nd item)*/
memset( &info, 0, sizeof info );
strback[0] = 0x00;
info.cbSize = sizeof(MENUITEMINFO);
info.cbSize = sizeof(MENUITEMINFOA);
info.fMask = MIIM_STRING | MIIM_ID;
info.dwTypeData = strback;
info.cch = sizeof(strback);
rc = GetMenuItemInfo(hmenu, (UINT_PTR)hmenuSub, FALSE, &info);
rc = GetMenuItemInfoA(hmenu, (UINT_PTR)hmenuSub, FALSE, &info);
ok (rc, "Getting the menus info failed\n");
ok (info.wID == (UINT_PTR)hmenuSub, "IDs differ for popup menu\n");
ok (!strcmp(info.dwTypeData, "MenuItem"), "Returned item has wrong label (%s)\n", info.dwTypeData);
DestroyMenu( hmenu );
DestroyMenu( hmenuSub );
/*
/*
Case 4: Menu containing 2 popup menus, the second
contains 2 items with the same id as the first popup menu
*/
hmenu = CreateMenu();
hmenuSub = CreateMenu();
hmenuSub2 = CreateMenu();
rc = InsertMenu(hmenu, 0, MF_BYPOSITION | MF_POPUP | MF_STRING, (UINT_PTR)hmenuSub, "Submenu");
rc = InsertMenuA(hmenu, 0, MF_BYPOSITION | MF_POPUP | MF_STRING, (UINT_PTR)hmenuSub, "Submenu");
ok (rc, "Inserting the popup menu into the main menu failed\n");
rc = InsertMenu(hmenu, 1, MF_BYPOSITION | MF_POPUP | MF_STRING, (UINT_PTR)hmenuSub2, "Submenu2");
rc = InsertMenuA(hmenu, 1, MF_BYPOSITION | MF_POPUP | MF_STRING, (UINT_PTR)hmenuSub2, "Submenu2");
ok (rc, "Inserting the popup menu into the main menu failed\n");
memset( &info, 0, sizeof info );
......@@ -1910,7 +1910,7 @@ static void test_menu_search_bycommand( void )
info.dwTypeData = menuitem;
info.wID = (UINT_PTR) hmenuSub; /* Enforce id collisions with the hmenu of the popup submenu*/
rc = InsertMenuItem(hmenuSub2, 0, TRUE, &info );
rc = InsertMenuItemA(hmenuSub2, 0, TRUE, &info );
ok (rc, "Inserting the sub menu menuitem failed\n");
memset( &info, 0, sizeof info );
......@@ -1920,30 +1920,30 @@ static void test_menu_search_bycommand( void )
info.dwTypeData = menuitem2;
info.wID = (UINT_PTR) hmenuSub; /* Enforce id collisions with the hmenu of the popup submenu*/
rc = InsertMenuItem(hmenuSub2, 1, TRUE, &info );
rc = InsertMenuItemA(hmenuSub2, 1, TRUE, &info );
ok (rc, "Inserting the sub menu menuitem 2 failed\n");
/* Prove getting the item info via ID returns the first item (not the popup or 2nd item)*/
memset( &info, 0, sizeof info );
strback[0] = 0x00;
info.cbSize = sizeof(MENUITEMINFO);
info.cbSize = sizeof(MENUITEMINFOA);
info.fMask = MIIM_STRING | MIIM_ID;
info.dwTypeData = strback;
info.cch = sizeof(strback);
rc = GetMenuItemInfo(hmenu, (UINT_PTR)hmenuSub, FALSE, &info);
rc = GetMenuItemInfoA(hmenu, (UINT_PTR)hmenuSub, FALSE, &info);
ok (rc, "Getting the menus info failed\n");
ok (info.wID == (UINT_PTR)hmenuSub, "IDs differ for popup menu\n");
ok (!strcmp(info.dwTypeData, "MenuItem"), "Returned item has wrong label (%s)\n", info.dwTypeData);
memset( &info, 0, sizeof info );
strback[0] = 0x00;
info.cbSize = sizeof(MENUITEMINFO);
info.cbSize = sizeof(MENUITEMINFOA);
info.fMask = MIIM_STRING | MIIM_ID;
info.dwTypeData = strback;
info.cch = sizeof(strback);
rc = GetMenuItemInfo(hmenu, (UINT_PTR)hmenuSub2, FALSE, &info);
rc = GetMenuItemInfoA(hmenu, (UINT_PTR)hmenuSub2, FALSE, &info);
ok (rc, "Getting the menus info failed\n");
ok (info.wID == (UINT_PTR)hmenuSub2, "IDs differ for popup menu\n");
ok (!strcmp(info.dwTypeData, "Submenu2"), "Returned item has wrong label (%s)\n", info.dwTypeData);
......@@ -1953,7 +1953,7 @@ static void test_menu_search_bycommand( void )
DestroyMenu( hmenuSub2 );
/*
/*
Case 5: Menu containing a popup menu which in turn
contains an item with a different id than the popup menu.
This tests the fallback to a popup menu ID.
......@@ -1962,10 +1962,10 @@ static void test_menu_search_bycommand( void )
hmenu = CreateMenu();
hmenuSub = CreateMenu();
rc = AppendMenu(hmenu, MF_POPUP | MF_STRING, (UINT_PTR)hmenuSub, "Submenu");
rc = AppendMenuA(hmenu, MF_POPUP | MF_STRING, (UINT_PTR)hmenuSub, "Submenu");
ok (rc, "Appending the popup menu to the main menu failed\n");
rc = AppendMenu(hmenuSub, MF_STRING, 102, "Item");
rc = AppendMenuA(hmenuSub, MF_STRING, 102, "Item");
ok (rc, "Appending the item to the popup menu failed\n");
/* Set the ID for hmenuSub */
......@@ -1973,24 +1973,24 @@ static void test_menu_search_bycommand( void )
info.fMask = MIIM_ID;
info.wID = 101;
rc = SetMenuItemInfo(hmenu, 0, TRUE, &info);
rc = SetMenuItemInfoA(hmenu, 0, TRUE, &info);
ok(rc, "Setting the ID for the popup menu failed\n");
/* Check if the ID has been set */
info.wID = 0;
rc = GetMenuItemInfo(hmenu, 0, TRUE, &info);
rc = GetMenuItemInfoA(hmenu, 0, TRUE, &info);
ok(rc, "Getting the ID for the popup menu failed\n");
ok(info.wID == 101, "The ID for the popup menu has not been set\n");
/* Prove getting the item info via ID returns the popup menu */
memset( &info, 0, sizeof(info));
strback[0] = 0x00;
info.cbSize = sizeof(MENUITEMINFO);
info.cbSize = sizeof(MENUITEMINFOA);
info.fMask = MIIM_STRING | MIIM_ID;
info.dwTypeData = strback;
info.cch = sizeof(strback);
rc = GetMenuItemInfo(hmenu, 101, FALSE, &info);
rc = GetMenuItemInfoA(hmenu, 101, FALSE, &info);
ok (rc, "Getting the menu info failed\n");
ok (info.wID == 101, "IDs differ\n");
ok (!strcmp(info.dwTypeData, "Submenu"), "Returned item has wrong label (%s)\n", info.dwTypeData);
......@@ -1998,12 +1998,12 @@ static void test_menu_search_bycommand( void )
/* Also look for the menu item */
memset( &info, 0, sizeof(info));
strback[0] = 0x00;
info.cbSize = sizeof(MENUITEMINFO);
info.cbSize = sizeof(MENUITEMINFOA);
info.fMask = MIIM_STRING | MIIM_ID;
info.dwTypeData = strback;
info.cch = sizeof(strback);
rc = GetMenuItemInfo(hmenu, 102, FALSE, &info);
rc = GetMenuItemInfoA(hmenu, 102, FALSE, &info);
ok (rc, "Getting the menu info failed\n");
ok (info.wID == 102, "IDs differ\n");
ok (!strcmp(info.dwTypeData, "Item"), "Returned item has wrong label (%s)\n", info.dwTypeData);
......@@ -2097,7 +2097,7 @@ static BOOL click_menu(HANDLE hWnd, struct menu_item_pair_s *mi)
ret = pSendInput(3, (INPUT *) i, sizeof(INPUT));
/* hack to prevent mouse message buildup in Wine */
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
return ret;
}
......@@ -2124,7 +2124,7 @@ static DWORD WINAPI test_menu_input_thread(LPVOID lpParameter)
if (!ret)
{
skip( "test %u: failed to send input\n", i );
PostMessage( hWnd, WM_CANCELMODE, 0, 0 );
PostMessageA( hWnd, WM_CANCELMODE, 0, 0 );
return 0;
}
while (menu_tests[i].bMenuVisible != bMenuVisible)
......@@ -2138,7 +2138,7 @@ static DWORD WINAPI test_menu_input_thread(LPVOID lpParameter)
if (!got_input)
{
skip( "test %u: didn't receive input\n", i );
PostMessage( hWnd, WM_CANCELMODE, 0, 0 );
PostMessageA( hWnd, WM_CANCELMODE, 0, 0 );
return 0;
}
......@@ -2254,8 +2254,8 @@ static void test_menu_input(void) {
wclass.style = CS_HREDRAW | CS_VREDRAW;
wclass.lpfnWndProc = WndProc;
wclass.hInstance = hInstance;
wclass.hIcon = LoadIconA( 0, IDI_APPLICATION );
wclass.hCursor = LoadCursorA( NULL, IDC_ARROW );
wclass.hIcon = LoadIconA( 0, (LPCSTR)IDI_APPLICATION );
wclass.hCursor = LoadCursorA( 0, (LPCSTR)IDC_ARROW );
wclass.hbrBackground = (HBRUSH)( COLOR_WINDOW + 1 );
wclass.lpszMenuName = 0;
wclass.cbClsExtra = 0;
......@@ -2270,18 +2270,18 @@ static void test_menu_input(void) {
if (!hWnd) return;
/* fixed menus */
hMenus[3] = CreatePopupMenu();
AppendMenu(hMenus[3], MF_STRING, 0, "&Enabled");
AppendMenu(hMenus[3], MF_STRING|MF_DISABLED, 0, "&Disabled");
AppendMenuA(hMenus[3], MF_STRING, 0, "&Enabled");
AppendMenuA(hMenus[3], MF_STRING|MF_DISABLED, 0, "&Disabled");
hMenus[2] = CreatePopupMenu();
AppendMenu(hMenus[2], MF_STRING|MF_POPUP, (UINT_PTR) hMenus[3], "&Popup");
AppendMenu(hMenus[2], MF_STRING, 0, "&Enabled");
AppendMenu(hMenus[2], MF_STRING|MF_DISABLED, 0, "&Disabled");
AppendMenuA(hMenus[2], MF_STRING|MF_POPUP, (UINT_PTR) hMenus[3], "&Popup");
AppendMenuA(hMenus[2], MF_STRING, 0, "&Enabled");
AppendMenuA(hMenus[2], MF_STRING|MF_DISABLED, 0, "&Disabled");
hMenus[1] = CreateMenu();
AppendMenu(hMenus[1], MF_STRING|MF_POPUP, (UINT_PTR) hMenus[2], "&Menu");
AppendMenu(hMenus[1], MF_STRING, 0, "&Enabled");
AppendMenu(hMenus[1], MF_STRING|MF_DISABLED, 0, "&Disabled");
AppendMenuA(hMenus[1], MF_STRING|MF_POPUP, (UINT_PTR) hMenus[2], "&Menu");
AppendMenuA(hMenus[1], MF_STRING, 0, "&Enabled");
AppendMenuA(hMenus[1], MF_STRING|MF_DISABLED, 0, "&Disabled");
SetMenu(hWnd, hMenus[1]);
ShowWindow(hWnd, SW_SHOW);
......@@ -2292,7 +2292,7 @@ static void test_menu_input(void) {
{
if (WAIT_TIMEOUT != WaitForSingleObject(hThread, 50))
break;
while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
}
DestroyWindow(hWnd);
}
......@@ -2304,12 +2304,12 @@ static void test_menu_flags( void )
hMenu = CreateMenu();
hPopupMenu = CreatePopupMenu();
AppendMenu(hMenu, MF_POPUP | MF_STRING, (UINT_PTR)hPopupMenu, "Popup");
AppendMenuA(hMenu, MF_POPUP | MF_STRING, (UINT_PTR)hPopupMenu, "Popup");
AppendMenu(hPopupMenu, MF_STRING | MF_HILITE | MF_DEFAULT, 101, "Item 1");
InsertMenu(hPopupMenu, 1, MF_BYPOSITION | MF_STRING | MF_HILITE | MF_DEFAULT, 102, "Item 2");
AppendMenu(hPopupMenu, MF_STRING, 103, "Item 3");
ModifyMenu(hPopupMenu, 2, MF_BYPOSITION | MF_STRING | MF_HILITE | MF_DEFAULT, 103, "Item 3");
AppendMenuA(hPopupMenu, MF_STRING | MF_HILITE | MF_DEFAULT, 101, "Item 1");
InsertMenuA(hPopupMenu, 1, MF_BYPOSITION | MF_STRING | MF_HILITE | MF_DEFAULT, 102, "Item 2");
AppendMenuA(hPopupMenu, MF_STRING, 103, "Item 3");
ModifyMenuA(hPopupMenu, 2, MF_BYPOSITION | MF_STRING | MF_HILITE | MF_DEFAULT, 103, "Item 3");
ok(GetMenuState(hPopupMenu, 0, MF_BYPOSITION) & MF_HILITE,
"AppendMenu should accept MF_HILITE\n");
......@@ -2339,8 +2339,8 @@ static void test_menu_hilitemenuitem( void )
wclass.style = CS_HREDRAW | CS_VREDRAW;
wclass.lpfnWndProc = WndProc;
wclass.hInstance = GetModuleHandleA( NULL );
wclass.hIcon = LoadIconA( 0, IDI_APPLICATION );
wclass.hCursor = LoadCursorA( NULL, IDC_ARROW );
wclass.hIcon = LoadIconA( 0, (LPCSTR)IDI_APPLICATION );
wclass.hCursor = LoadCursorA( 0, (LPCSTR)IDC_ARROW );
wclass.hbrBackground = (HBRUSH)( COLOR_WINDOW + 1 );
wclass.lpszMenuName = 0;
wclass.cbClsExtra = 0;
......@@ -2357,11 +2357,11 @@ static void test_menu_hilitemenuitem( void )
hMenu = CreateMenu();
hPopupMenu = CreatePopupMenu();
AppendMenu(hMenu, MF_POPUP | MF_STRING, (UINT_PTR)hPopupMenu, "Popup");
AppendMenuA(hMenu, MF_POPUP | MF_STRING, (UINT_PTR)hPopupMenu, "Popup");
AppendMenu(hPopupMenu, MF_STRING, 101, "Item 1");
AppendMenu(hPopupMenu, MF_STRING, 102, "Item 2");
AppendMenu(hPopupMenu, MF_STRING, 103, "Item 3");
AppendMenuA(hPopupMenu, MF_STRING, 101, "Item 1");
AppendMenuA(hPopupMenu, MF_STRING, 102, "Item 2");
AppendMenuA(hPopupMenu, MF_STRING, 103, "Item 3");
SetMenu(hWnd, hMenu);
......@@ -2477,12 +2477,12 @@ static void check_menu_items(HMENU hmenu, UINT checked_cmd, UINT checked_type,
for (i = 0; i < count; i++)
{
BOOL ret;
MENUITEMINFO mii;
MENUITEMINFOA mii;
memset(&mii, 0, sizeof(mii));
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_FTYPE | MIIM_STATE | MIIM_ID | MIIM_SUBMENU;
ret = GetMenuItemInfo(hmenu, i, TRUE, &mii);
ret = GetMenuItemInfoA(hmenu, i, TRUE, &mii);
ok(ret, "GetMenuItemInfo(%u) failed\n", i);
#if 0
trace("item #%u: fType %04x, fState %04x, wID %u, hSubMenu %p\n",
......@@ -2523,12 +2523,12 @@ static void check_menu_items(HMENU hmenu, UINT checked_cmd, UINT checked_type,
static void clear_ftype_and_state(HMENU hmenu, UINT id, UINT flags)
{
BOOL ret;
MENUITEMINFO mii;
MENUITEMINFOA mii;
memset(&mii, 0, sizeof(mii));
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_FTYPE | MIIM_STATE;
ret = SetMenuItemInfo(hmenu, id, (flags & MF_BYPOSITION) != 0, &mii);
ret = SetMenuItemInfoA(hmenu, id, (flags & MF_BYPOSITION) != 0, &mii);
ok(ret, "SetMenuItemInfo(%u) failed\n", id);
}
......@@ -2537,7 +2537,7 @@ static void test_CheckMenuRadioItem(void)
BOOL ret;
HMENU hmenu;
hmenu = LoadMenu(GetModuleHandle(0), MAKEINTRESOURCE(1));
hmenu = LoadMenuA(GetModuleHandleA(NULL), MAKEINTRESOURCEA(1));
assert(hmenu != 0);
check_menu_items(hmenu, -1, 0, 0);
......@@ -2616,14 +2616,14 @@ static void test_menu_resource_layout(void)
INT count, i;
BOOL ret;
hmenu = LoadMenuIndirect(&menu_template);
hmenu = LoadMenuIndirectA(&menu_template);
ok(hmenu != 0, "LoadMenuIndirect error %u\n", GetLastError());
ret = AppendMenu(hmenu, MF_STRING, 6, NULL);
ret = AppendMenuA(hmenu, MF_STRING, 6, NULL);
ok(ret, "AppendMenu failed\n");
ret = AppendMenu(hmenu, MF_STRING, 7, "\0");
ret = AppendMenuA(hmenu, MF_STRING, 7, "\0");
ok(ret, "AppendMenu failed\n");
ret = AppendMenu(hmenu, MF_SEPARATOR, 8, "separator");
ret = AppendMenuA(hmenu, MF_SEPARATOR, 8, "separator");
ok(ret, "AppendMenu failed\n");
count = GetMenuItemCount(hmenu);
......@@ -2634,14 +2634,14 @@ static void test_menu_resource_layout(void)
for (i = 0; i < count; i++)
{
char buf[20];
MENUITEMINFO mii;
MENUITEMINFOA mii;
memset(&mii, 0, sizeof(mii));
mii.cbSize = sizeof(mii);
mii.dwTypeData = buf;
mii.cch = sizeof(buf);
mii.fMask = MIIM_FTYPE | MIIM_STATE | MIIM_ID | MIIM_STRING;
ret = GetMenuItemInfo(hmenu, i, TRUE, &mii);
ret = GetMenuItemInfoA(hmenu, i, TRUE, &mii);
ok(ret, "GetMenuItemInfo(%u) failed\n", i);
#if 0
trace("item #%u: fType %04x, fState %04x, wID %u, dwTypeData %s\n",
......@@ -2680,7 +2680,7 @@ static HMENU create_menu_from_data(const struct menu_data *item, INT item_count)
for (i = 0; i < item_count; i++)
{
SetLastError(0xdeadbeef);
ret = AppendMenu(hmenu, item[i].type, item[i].id, item[i].str);
ret = AppendMenuA(hmenu, item[i].type, item[i].id, item[i].str);
ok(ret, "%d: AppendMenu(%04x, %04x, %p) error %u\n",
i, item[i].type, item[i].id, item[i].str, GetLastError());
}
......@@ -2695,7 +2695,7 @@ static HMENU create_menuitem_from_data(const struct menu_data *item, INT item_co
HMENU hmenu;
INT i;
BOOL ret;
MENUITEMINFO mii = { sizeof( MENUITEMINFO)};
MENUITEMINFOA mii = { sizeof( MENUITEMINFOA) };
hmenu = CreateMenu();
assert(hmenu != 0);
......@@ -2722,7 +2722,7 @@ static HMENU create_menuitem_from_data(const struct menu_data *item, INT item_co
mii.fState = 0;
if( item[i].type & MF_HELP) mii.fType |= MF_HELP;
mii.wID = item[i].id;
ret = InsertMenuItem( hmenu, -1, TRUE, &mii);
ret = InsertMenuItemA( hmenu, -1, TRUE, &mii);
ok(ret, "%d: InsertMenuItem(%04x, %04x, %p) error %u\n",
i, item[i].type, item[i].id, item[i].str, GetLastError());
}
......@@ -2740,14 +2740,14 @@ static void compare_menu_data(HMENU hmenu, const struct menu_data *item, INT ite
for (i = 0; i < count; i++)
{
char buf[20];
MENUITEMINFO mii;
MENUITEMINFOA mii;
memset(&mii, 0, sizeof(mii));
mii.cbSize = sizeof(mii);
mii.dwTypeData = buf;
mii.cch = sizeof(buf);
mii.fMask = MIIM_FTYPE | MIIM_ID | MIIM_STRING | MIIM_BITMAP;
ret = GetMenuItemInfo(hmenu, i, TRUE, &mii);
ret = GetMenuItemInfoA(hmenu, i, TRUE, &mii);
ok(ret, "GetMenuItemInfo(%u) failed\n", i);
#if 0
trace("item #%u: fType %04x, fState %04x, wID %04x, hbmp %p\n",
......@@ -2782,20 +2782,20 @@ static void test_InsertMenu(void)
static const struct menu_data in1[] =
{
{ MF_STRING, 1, "File" },
{ MF_BITMAP|MF_HELP, SC_CLOSE, MAKEINTRESOURCE(1) },
{ MF_BITMAP|MF_HELP, SC_CLOSE, MAKEINTRESOURCEA(1) },
{ MF_STRING|MF_HELP, 2, "Help" }
};
static const struct menu_data out1[] =
{
{ MF_STRING, 1, "File" },
{ MF_STRING|MF_HELP, 2, "Help" },
{ MF_BITMAP|MF_HELP, SC_CLOSE, MAKEINTRESOURCE(1) }
{ MF_BITMAP|MF_HELP, SC_CLOSE, MAKEINTRESOURCEA(1) }
};
static const struct menu_data out1a[] =
{
{ MF_STRING, 1, "File" },
{ MF_STRING|MF_HELP, 2, "Help" },
{ MF_HELP, SC_CLOSE, MAKEINTRESOURCE(1) }
{ MF_HELP, SC_CLOSE, MAKEINTRESOURCEA(1) }
};
const struct menu_data in2[] =
{
......@@ -2818,32 +2818,32 @@ static void test_InsertMenu(void)
static const struct menu_data in3[] =
{
{ MF_STRING, 1, "File" },
{ MF_SEPARATOR|MF_HELP, SC_CLOSE, MAKEINTRESOURCE(1) },
{ MF_SEPARATOR|MF_HELP, SC_CLOSE, MAKEINTRESOURCEA(1) },
{ MF_STRING|MF_HELP, 2, "Help" }
};
static const struct menu_data out3[] =
{
{ MF_STRING, 1, "File" },
{ MF_SEPARATOR|MF_HELP, SC_CLOSE, MAKEINTRESOURCE(0) },
{ MF_SEPARATOR|MF_HELP, SC_CLOSE, MAKEINTRESOURCEA(0) },
{ MF_STRING|MF_HELP, 2, "Help" },
};
static const struct menu_data in4[] =
{
{ MF_STRING, 1, "File" },
{ MF_BITMAP|MF_HELP, 1, MAKEINTRESOURCE(1) },
{ MF_BITMAP|MF_HELP, 1, MAKEINTRESOURCEA(1) },
{ MF_STRING|MF_HELP, 2, "Help" }
};
static const struct menu_data out4[] =
{
{ MF_STRING, 1, "File" },
{ MF_STRING|MF_HELP, 2, "Help" },
{ MF_BITMAP|MF_HELP, 1, MAKEINTRESOURCE(1) }
{ MF_BITMAP|MF_HELP, 1, MAKEINTRESOURCEA(1) }
};
static const struct menu_data out4a[] =
{
{ MF_STRING, 1, "File" },
{ MF_STRING|MF_HELP, 2, "Help" },
{ MF_HELP, 1, MAKEINTRESOURCE(1) }
{ MF_HELP, 1, MAKEINTRESOURCEA(1) }
};
HMENU hmenu;
......@@ -2944,7 +2944,7 @@ static void test_menu_setmenuinfo(void)
{
HMENU hmenu, hsubmenu;
MENUINFO mi = {0};
MENUITEMINFOA mii = {sizeof( MENUITEMINFOA)};
MENUITEMINFOA mii = { sizeof(MENUITEMINFOA) };
BOOL ret;
DWORD gle;
......@@ -2960,7 +2960,7 @@ static void test_menu_setmenuinfo(void)
assert( hmenu && hsubmenu);
mii.fMask = MIIM_SUBMENU;
mii.hSubMenu = hsubmenu;
ret = InsertMenuItem( hmenu, 0, FALSE, &mii);
ret = InsertMenuItemA( hmenu, 0, FALSE, &mii);
ok( ret, "InsertMenuItem failed with error %d\n", GetLastError());
/* test some parameter errors */
SetLastError(0xdeadbeef);
......@@ -3087,12 +3087,12 @@ static void test_menu_trackpopupmenu(void)
HMENU hmenu;
DWORD gle;
int Ex;
HWND hwnd = CreateWindowEx(0, MAKEINTATOM(atomMenuCheckClass), NULL,
HWND hwnd = CreateWindowExA(0, (LPCSTR)MAKEINTATOM(atomMenuCheckClass), NULL,
WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 200, 200,
NULL, NULL, NULL, NULL);
ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError());
if (!hwnd) return;
SetWindowLongPtr( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_ownerdraw_wnd_proc);
SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_ownerdraw_wnd_proc);
for( Ex = 0; Ex < 2; Ex++)
{
hmenu = CreatePopupMenu();
......@@ -3209,10 +3209,10 @@ static LRESULT WINAPI menu_track_again_wnd_proc(HWND hwnd, UINT msg, WPARAM wpar
/* exit menu modal loop
* ( A SendMessage does not work on NT3.51 here ) */
return PostMessage(hwnd, WM_CANCELMODE, 0, 0);
return PostMessageA(hwnd, WM_CANCELMODE, 0, 0);
}
}
return DefWindowProc(hwnd, msg, wparam, lparam);
return DefWindowProcA(hwnd, msg, wparam, lparam);
}
static void test_menu_trackagain(void)
......@@ -3220,12 +3220,12 @@ static void test_menu_trackagain(void)
HWND hwnd;
BOOL ret;
hwnd = CreateWindowEx(0, MAKEINTATOM(atomMenuCheckClass), NULL,
hwnd = CreateWindowExA(0, (LPCSTR)MAKEINTATOM(atomMenuCheckClass), NULL,
WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 200, 200,
NULL, NULL, NULL, NULL);
ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError());
if (!hwnd) return;
SetWindowLongPtr( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_track_again_wnd_proc);
SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_track_again_wnd_proc);
g_hmenu = CreatePopupMenu();
ok(g_hmenu != NULL, "CreateMenu failed with error %d\n", GetLastError());
......@@ -3247,19 +3247,19 @@ static LRESULT WINAPI menu_cancelmode_wnd_proc(HWND hwnd, UINT msg,
{
case WM_ENTERMENULOOP:
g_got_enteridle = 0;
return SendMessage( g_hwndtosend, WM_CANCELMODE, 0, 0);
return SendMessageA( g_hwndtosend, WM_CANCELMODE, 0, 0);
case WM_ENTERIDLE:
{
if( g_got_enteridle++ == 0) {
/* little hack to get another WM_ENTERIDLE message */
PostMessage( hwnd, WM_MOUSEMOVE, 0, 0);
return SendMessage( g_hwndtosend, WM_CANCELMODE, 0, 0);
PostMessageA( hwnd, WM_MOUSEMOVE, 0, 0);
return SendMessageA( g_hwndtosend, WM_CANCELMODE, 0, 0);
}
pEndMenu();
return TRUE;
}
}
return DefWindowProc( hwnd, msg, wparam, lparam);
return DefWindowProcA( hwnd, msg, wparam, lparam);
}
static void test_menu_cancelmode(void)
......@@ -3272,24 +3272,24 @@ static void test_menu_cancelmode(void)
win_skip( "EndMenu is not available\n");
return;
}
hwnd = CreateWindowEx( 0, MAKEINTATOM(atomMenuCheckClass), NULL,
hwnd = CreateWindowExA( 0, (LPCSTR)MAKEINTATOM(atomMenuCheckClass), NULL,
WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 200, 200,
NULL, NULL, NULL, NULL);
hwndchild = CreateWindowEx( 0, MAKEINTATOM(atomMenuCheckClass), NULL,
hwndchild = CreateWindowExA( 0, (LPCSTR)MAKEINTATOM(atomMenuCheckClass), NULL,
WS_VISIBLE | WS_CHILD, 10, 10, 20, 20,
hwnd, NULL, NULL, NULL);
ok( hwnd != NULL && hwndchild != NULL,
"CreateWindowEx failed with error %d\n", GetLastError());
g_hwndtosend = hwnd;
SetWindowLongPtr( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_cancelmode_wnd_proc);
SetWindowLongPtr( hwndchild, GWLP_WNDPROC, (LONG_PTR)menu_cancelmode_wnd_proc);
SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_cancelmode_wnd_proc);
SetWindowLongPtrA( hwndchild, GWLP_WNDPROC, (LONG_PTR)menu_cancelmode_wnd_proc);
menu = CreatePopupMenu();
ok( menu != NULL, "CreatePopupMenu failed with error %d\n", GetLastError());
ret = AppendMenuA( menu, MF_STRING, 1, "winetest");
ok( ret, "Functie failed lasterror is %u\n", GetLastError());
/* seems to be needed only on wine :( */
while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
DispatchMessage(&msg);
while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE))
DispatchMessageA(&msg);
/* test the effect of sending a WM_CANCELMODE message in the WM_INITMENULOOP
* handler of the menu owner */
/* test results is extracted from variable g_got_enteridle. Possible values:
......@@ -3326,10 +3326,10 @@ static void test_menu_cancelmode(void)
ok( ret, "SetMenu failed lasterror is %u\n", GetLastError());
/* initiate tracking */
g_hwndtosend = hwnd;
ret = SendMessage( hwnd, WM_SYSCOMMAND, SC_KEYMENU, 0 );
ret = SendMessageA( hwnd, WM_SYSCOMMAND, SC_KEYMENU, 0 );
ok( ret == 0, "Sending WM_SYSCOMMAND/SC_KEYMENU failed lasterror is %u\n", GetLastError());
while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
DispatchMessage(&msg);
while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE))
DispatchMessageA(&msg);
todo_wine {
ok(g_got_enteridle == 0, "received %d WM_ENTERIDLE messages, none expected\n", g_got_enteridle);
}
......@@ -3406,7 +3406,7 @@ static void test_menualign(void)
BYTE bmfill[300];
HMENU menu;
HBITMAP hbm1, hbm2, hbm3;
MENUITEMINFO mii = { sizeof(MENUITEMINFO)};
MENUITEMINFOA mii = { sizeof(MENUITEMINFOA) };
DWORD ret;
HWND hwnd;
MENUINFO mi = { sizeof( MENUINFO)};
......@@ -3415,7 +3415,7 @@ static void test_menualign(void)
skip( "interactive alignment tests.\n");
return;
}
hwnd = CreateWindowEx(0,
hwnd = CreateWindowExA(0,
"STATIC",
"Menu text alignment Test\nPlease make a selection.",
WS_OVERLAPPEDWINDOW,
......@@ -3443,13 +3443,13 @@ static void test_menualign(void)
mii.wID = 1;
mii.hbmpItem = hbm1;
mii.dwTypeData = (LPSTR) " OK: menu texts are correctly left-aligned.";
ret = InsertMenuItem( menu, -1, TRUE, &mii);
ret = InsertMenuItemA( menu, -1, TRUE, &mii);
ok( ret, "InsertMenuItem() failed\n");
mii.fMask = MIIM_BITMAP | MIIM_STRING | MIIM_ID ;
mii.wID = 2;
mii.hbmpItem = hbm2;
mii.dwTypeData = (LPSTR) " FAIL: menu texts are NOT left-aligned.";
ret = InsertMenuItem( menu, -1, TRUE, &mii);
ret = InsertMenuItemA( menu, -1, TRUE, &mii);
ok( ret, "InsertMenuItem() failed\n");
ret = TrackPopupMenu( menu, TPM_RETURNCMD, 110, 200, 0, hwnd, NULL);
ok( ret != 2, "User indicated that menu text alignment test 1 failed %d\n", ret);
......@@ -3458,7 +3458,7 @@ static void test_menualign(void)
mii.wID = 3;
mii.hbmpItem = hbm3;
mii.dwTypeData = NULL;
ret = InsertMenuItem( menu, 0, TRUE, &mii);
ret = InsertMenuItemA( menu, 0, TRUE, &mii);
ok( ret, "InsertMenuItem() failed\n");
mii.fMask = MIIM_BITMAP | MIIM_STRING | MIIM_ID;
mii.wID = 1;
......@@ -3466,12 +3466,12 @@ static void test_menualign(void)
/* make the text a bit longer, to keep it readable */
/* this bug is on winXP and reproduced on wine */
mii.dwTypeData = (LPSTR) " OK: menu texts are to the right of the bitmaps........";
ret = SetMenuItemInfo( menu, 1, TRUE, &mii);
ret = SetMenuItemInfoA( menu, 1, TRUE, &mii);
ok( ret, "SetMenuItemInfo() failed\n");
mii.wID = 2;
mii.hbmpItem = hbm2;
mii.dwTypeData = (LPSTR) " FAIL: menu texts are below the first bitmap. ";
ret = SetMenuItemInfo( menu, 2, TRUE, &mii);
ret = SetMenuItemInfoA( menu, 2, TRUE, &mii);
ok( ret, "SetMenuItemInfo() failed\n");
ret = TrackPopupMenu( menu, TPM_RETURNCMD, 110, 200, 0, hwnd, NULL);
ok( ret != 2, "User indicated that menu text alignment test 2 failed %d\n", ret);
......@@ -3480,18 +3480,18 @@ static void test_menualign(void)
mii.wID = 3;
mii.fType = MFT_BITMAP;
mii.dwTypeData = (LPSTR) hbm3;
ret = SetMenuItemInfo( menu, 0, TRUE, &mii);
ret = SetMenuItemInfoA( menu, 0, TRUE, &mii);
ok( ret, "SetMenuItemInfo() failed\n");
mii.fMask = MIIM_BITMAP | MIIM_STRING | MIIM_ID;
mii.wID = 1;
mii.hbmpItem = NULL;
mii.dwTypeData = (LPSTR) " OK: menu texts are below the bitmap.";
ret = SetMenuItemInfo( menu, 1, TRUE, &mii);
ret = SetMenuItemInfoA( menu, 1, TRUE, &mii);
ok( ret, "SetMenuItemInfo() failed\n");
mii.wID = 2;
mii.hbmpItem = NULL;
mii.dwTypeData = (LPSTR) " FAIL: menu texts are NOT below the bitmap.";
ret = SetMenuItemInfo( menu, 2, TRUE, &mii);
ret = SetMenuItemInfoA( menu, 2, TRUE, &mii);
ok( ret, "SetMenuItemInfo() failed\n");
ret = TrackPopupMenu( menu, TPM_RETURNCMD, 110, 200, 0, hwnd, NULL);
ok( ret != 2, "User indicated that menu text alignment test 3 failed %d\n", ret);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment