i did these code for try change the menu font, without OWNERDRAW it:
CHOOSEFONT ShowSelectFont()
{
HWND hwnd=GetForegroundWindow();
CHOOSEFONT cf = {sizeof(CHOOSEFONT)};
LOGFONT* lf = new LOGFONT;
HDC hdc=GetDC(hwnd);
HFONT hlf =(HFONT) GetCurrentObject(hdc,OBJ_FONT);
GetObject(hlf,sizeof(LOGFONT),lf);
cf.Flags = CF_EFFECTS | CF_INITTOLOGFONTSTRUCT | CF_SCREENFONTS;
cf.hwndOwner = hwnd;
cf.lpLogFont = lf;
cf.rgbColors =GetTextColor(hdc);
ChooseFont(&cf);
ReleaseDC(hwnd,hdc);
cf.lpLogFont = lf;
return cf;
}
//.......
CHOOSEFONT cf={0};
NONCLIENTMETRICS theMetrics;
cf=ShowSelectFont();//font dialog
theMetrics.cbSize = sizeof(NONCLIENTMETRICS);
SystemParametersInfo(SPI_GETNONCLIENTMETRICS,sizeof(NONCLIENTMETRICS),
(PVOID) &theMetrics,0);
blnFirst=true;
theMetrics.lfMenuFont=*cf.lpLogFont;
SystemParametersInfo(SPI_SETNONCLIENTMETRICS,sizeof(NONCLIENTMETRICS),
(PVOID) &theMetrics,0);
the menu font is changed, but SystemParametersInfo() it's the system font(it's changed for all windows menu bar, all aplications.
can anyone advice me more?
i need just change on the window(HWND) and not all windows