News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

ODMenu

Started by czerny, December 11, 2008, 11:04:54 PM

Previous topic - Next topic

czerny

I have had problems with Pelles owner drawn menu (win2000 and Pelles C 5.00.6).

In 'InstallOwnerDrawMenuHandler' I made two changes

ncm.cbSize = sizeof(NONCLIENTMETRICS) - sizeof(ncm.iPaddedBorderWidth);
if (SystemParametersInfo(SPI_GETNONCLIENTMETRICS, ncm.cbSize, &ncm, 0))
        g_hFont = CreateFontIndirect(&ncm.lfMenuFont);

Without this changes 'SystemParametersInfo' fails.

Czerny

Pelle

OK, thank you for reporting this.

I have uploaded a modified version; I changed the two calls to SystemParametersInfo() and added WINVER to the project settings (IMO a better way to deal with the iPaddedBorderWidth field in NONCLIENTMETRICS).

http://www.smorgasbordet.com/pellesc/sample_odmenu.htm
/Pelle