Pelles C forum
C language => User contributions => Topic started by: czerny on December 11, 2008, 11:04:54 PM
-
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
-
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 (http://www.smorgasbordet.com/pellesc/sample_odmenu.htm)