Re: user32: implement support for HBMENU_POPUP_* magic menu bitmaps and use them to decorate the system menu
On Freitag 20 Februar 2009, Rein Klazes wrote:
Hi,
See subject.
Rein.
Hi, mostly minor code style comments.
if( hMenu ) { + MENUINFO minfo; + MENUITEMINFOW miteminfo; POPUPMENU* menu = MENU_GetMenu(hMenu); menu->wFlags |= MF_SYSMENU | MF_POPUP; SetMenuDefaultItem(hMenu, SC_CLOSE, FALSE); + + minfo.cbSize = sizeof( MENUINFO); + minfo.dwStyle = MNS_CHECKORBMP; + minfo.fMask = MIM_STYLE; + SetMenuInfo( hMenu, &minfo); + + miteminfo.cbSize = sizeof( MENUITEMINFOW); + miteminfo.fMask = MIIM_BITMAP; + miteminfo.hbmpItem = HBMMENU_POPUP_CLOSE; + SetMenuItemInfoW( hMenu, SC_CLOSE, FALSE, &miteminfo); + miteminfo.hbmpItem = HBMMENU_POPUP_RESTORE; + SetMenuItemInfoW( hMenu, SC_RESTORE, FALSE, &miteminfo); + miteminfo.hbmpItem = HBMMENU_POPUP_MAXIMIZE; + SetMenuItemInfoW( hMenu, SC_MAXIMIZE, FALSE, &miteminfo); + miteminfo.hbmpItem = HBMMENU_POPUP_MINIMIZE; + SetMenuItemInfoW( hMenu, SC_MINIMIZE, FALSE, &miteminfo); }
I think this part deserves a bit more spacing to be readable. Something like the above looks better IMO. Also there is some inconsistent spacing around the beginning and end ()/{} which does not match the rest of the file.
+ logfont.lfHeight = min( h, w) - 2 ; + TextOutW( hdc, rect->left, rect->top, bmchr, 1);
double space after '=' and ','
case (INT_PTR)HBMMENU_POPUP_CLOSE: + bmchr[0] = 0x72; + break; case (INT_PTR)HBMMENU_POPUP_RESTORE: + bmchr[0] = 0x32; + break; case (INT_PTR)HBMMENU_POPUP_MAXIMIZE: + bmchr[0] = 0x31; + break; case (INT_PTR)HBMMENU_POPUP_MINIMIZE: + bmchr[0] = 0x30; + break;
The constants seem to be equal to DFCS_CAPTION... I just tried to use DrawFrameControl but it seems to always draw a border around the images. And i did not find the right parameters for not drawing a border. It could save some code for font setup but i guess it is not usable for this :-(
+ TRACE(" height %d rect %s\n", logfont.lfHeight, wine_dbgstr_rect( rect)); leftover from debugging or is it still needed?
Greetings Peter
participants (1)
-
Peter Oberndorfer