Changeset 2577 for trunk/src/user32/menu.cpp
- Timestamp:
- Jan 30, 2000, 7:48:29 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/menu.cpp
r2483 r2577 1 /* $Id: menu.cpp,v 1.1 2 2000-01-20 16:48:54 cbratschiExp $*/1 /* $Id: menu.cpp,v 1.13 2000-01-30 18:48:27 sandervl Exp $*/ 2 2 /* 3 3 * Menu functions … … 3216 3216 * GetMenuString32A (USER32.268) 3217 3217 */ 3218 INT WINAPI GetMenuStringA( 3219 3218 INT WINAPI GetMenuStringA(HMENU hMenu, UINT wItemID, 3219 LPSTR str, INT nMaxSiz, UINT wFlags ) 3220 3220 { 3221 3221 MENUITEM *item; 3222 3222 3223 dprintf(("USER32: GetMenuStringA "));3223 dprintf(("USER32: GetMenuStringA %x %d %d %x", hMenu, wItemID, nMaxSiz, wFlags)); 3224 3224 3225 3225 //TRACE("menu=%04x item=%04x ptr=%p len=%d flags=%04x\n", 3226 3226 // hMenu, wItemID, str, nMaxSiz, wFlags ); 3227 if (!str || !nMaxSiz) return 0;3228 str[0] = '\0';3229 3227 if (!(item = MENU_FindItem( &hMenu, &wItemID, wFlags ))) return 0; 3230 3228 if (!IS_STRING_ITEM(item->fType)) return 0; 3229 if (!str || !nMaxSiz) return strlen(item->text); 3230 str[0] = '\0'; 3231 3231 lstrcpynA( str, item->text, nMaxSiz ); 3232 3232 //TRACE("returning '%s'\n", str ); … … 3247 3247 //TRACE("menu=%04x item=%04x ptr=%p len=%d flags=%04x\n", 3248 3248 // hMenu, wItemID, str, nMaxSiz, wFlags ); 3249 if (!str || !nMaxSiz) return 0;3250 str[0] = '\0';3251 3249 if (!(item = MENU_FindItem( &hMenu, &wItemID, wFlags ))) return 0; 3252 3250 if (!IS_STRING_ITEM(item->fType)) return 0; 3251 if (!str || !nMaxSiz) return strlen(item->text); 3252 str[0] = '\0'; 3253 3253 lstrcpynAtoW( str, item->text, nMaxSiz ); 3254 3254 return lstrlenW(str); … … 3773 3773 lpmenu->Height = 0; /* Make sure we recalculate the size */ 3774 3774 } 3775 if (IsWindowVisible(hWnd)) 3775 //SvL: This fixes the menu in standard mine sweeper (window isn't visible 3776 // when SetMenu is called) 3777 // if (IsWindowVisible(hWnd)) 3776 3778 SetWindowPos( hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | 3777 3779 SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED ); … … 4316 4318 HWND referenceHwnd; 4317 4319 4318 dprintf(("USER32: GetMenuItemRect"));4319 4320 //TRACE("(0x%x,0x%x,%d,%p)\n", hwnd, hMenu, uItem, rect); 4320 4321 … … 4325 4326 { 4326 4327 itemMenu = (POPUPMENU*)hMenu; 4327 if (itemMenu == NULL) 4328 return FALSE; 4328 if (itemMenu == NULL) { 4329 SetLastError(ERROR_INVALID_PARAMETER); 4330 return FALSE; 4331 } 4329 4332 4330 4333 if(itemMenu->hWnd == 0) … … 4333 4336 } 4334 4337 4335 if ((rect == NULL) || (item == NULL)) 4336 return FALSE; 4337 4338 if ((rect == NULL) || (item == NULL)) { 4339 SetLastError(ERROR_INVALID_PARAMETER); 4340 return FALSE; 4341 } 4338 4342 *rect = item->rect; 4339 4343 4340 4344 MapWindowPoints(referenceHwnd, 0, (LPPOINT)rect, 2); 4345 dprintf(("USER32: GetMenuItemRect %x %x %d (%d,%d)(%d,%d)", hwnd, hMenu, uItem, rect->left, rect->top, rect->right, rect->bottom)); 4341 4346 4342 4347 return TRUE;
Note:
See TracChangeset
for help on using the changeset viewer.