P
kann mir vorstellen das is langsam nerve
aber es will immer noch nicht funktionieren....
die schrift bleibt immer die selbe, egal was ich übergebe
void setfontweight(HWND _handle, int _id, int _weight)
{
HWND idhandle = GetDlgItem(_handle, _id);
LOGFONT lfPrevData;
// Schrift ermitteln:
static HFONT hfPrevFont = reinterpret_cast<HFONT>(SendMessage(idhandle, WM_GETFONT, 0, 0L));
// Objektinformationen abrufen:
if(hfPrevFont == NULL)
{
GetObject(GetStockObject(DEFAULT_GUI_FONT), sizeof(LOGFONT), &lfPrevData);
}
else
{
GetObject(hfPrevFont, sizeof(LOGFONT), &lfPrevData);
}
// Hier kannst du lfPrevData anpassen, also (ums FETT zu machen):
lfPrevData.lfWeight = _weight;
// Danach die neue Schrift setzen
static HFONT hfNewFont = CreateFontIndirect(&lfPrevData);
SendMessage(idhandle, WM_SETFONT, 0, reinterpret_cast<LPARAM>(hfNewFont));
}