Einzelnen Beitrag anzeigen

Benutzerbild von Flocke
Flocke

Registriert seit: 9. Jun 2005
Ort: Unna
1.172 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#8

Re: NonVCL - Hintergrundfarbe eines "Labels" ände

  Alt 1. Sep 2005, 13:50
Zitat von Olli:
Leider hat Flocke wohl ein veraltetes PSDK.
Ja, das in meinem Kopf 8)
Sorry dafür (aber eine Suche nach WM_CTLCOLOR hätte ihm Aufklärung gebracht).

Zitat von Luckie:
Delphi-Quellcode:
WM_CTLCOLORSTATIC:
      begin
        case GetDlgCtrlId(lParam) of
          IDC_STC_BANNER: { color the banner white }
            begin
              whitebrush := CreateBrushIndirect(WhiteLB);
              SetBkColor(wParam, WhiteLB.lbColor);
              result := BOOL(whitebrush);
            end;
        else
          Result := False;
        end;
      end;
Gibt das kein Ressourcen-Leck? Du erzeugst doch jedes Mal einen HBRUSH.
Zitat von MSDN:
The system does not automatically destroy the returned brush. It is the application's responsibility to destroy the brush when it is no longer needed.
Volker
Besucht meine Garage
Aktuell: RtfLabel 1.3d, PrintToFile 1.4
  Mit Zitat antworten Zitat