Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi STATIC Control transparent? (https://www.delphipraxis.net/54992-static-control-transparent.html)

Rastaman 14. Okt 2005 18:05

Re: STATIC Control transparent?
 
Ich merk schon, das wird nix ^^
Dann muss ich eben wissen, was man bei TWndClassEx beim Brush angeben muss, um die Windows Standardfarbe für 3D Objekte zu bekommen.
COLOR_BTNFACE is dunkelblau und COLOR_APPWORKSPACE is braun.
Normalerweise sind meine Fenster Hell Grau und die MDI BGs sind dunkel Grau.
Was muss ich da denn angeben :gruebel:

//Edit: Grad rausgefunden: COLOR_BTNSHADOW ergibt bei mir die Standardfarbe für Fenster. Kann das sein?

Olli 14. Okt 2005 18:21

Re: STATIC Control transparent?
 
Häh? Was soll der Quark denn hier im Thema :lol:

Das Ding ist doch schon "transparent", es sei denn du änderst die Farbe. In diesem Fall nimmste WM_CTLCOLORSTATIC ;) ... Wenn es wieder eines Beispiels bedarf, gib mal kurz deinen aktuellen Source.

Zitat:

Zitat von Gerrit89
Ich merk schon, das wird nix ^^
Dann muss ich eben wissen, was man bei TWndClassEx beim Brush angeben muss, um die Windows Standardfarbe für 3D Objekte zu bekommen.
COLOR_BTNFACE is dunkelblau und COLOR_APPWORKSPACE is braun.
Normalerweise sind meine Fenster Hell Grau und die MDI BGs sind dunkel Grau.
Was muss ich da denn angeben :gruebel:

//Edit: Grad rausgefunden: COLOR_BTNSHADOW ergibt bei mir die Standardfarbe für Fenster. Kann das sein?

:wall: die genannten Werte sind Indeces deren Farbwerte (RGB) man mit MSDN-Library durchsuchenGetSysColor herausbekommt.

Luckie 14. Okt 2005 18:27

Re: STATIC Control transparent?
 
Zitat:

Zitat von Gerrit89
COLOR_BTNFACE is dunkelblau und COLOR_APPWORKSPACE is braun.
Normalerweise sind meine Fenster Hell Grau und die MDI BGs sind dunkel Grau.
Was muss ich da denn angeben :gruebel:

aber nur, wenn du es so eingestellt hast, bzw. eine entsprechende Theme verwendest,

Zitat:

//Edit: Grad rausgefunden: COLOR_BTNSHADOW ergibt bei mir die Standardfarbe für Fenster. Kann das sein?
Eigentlich nicht. Wie der Name schon sagt, hndelt es sich dabei um die Schattenfarbe der Schaltfläche für den 3D Effekt.

Unter Wiondows 2000 müsste es so aussehen:
Delphi-Quellcode:
  wc: TWndClassEx = (
    cbSize: SizeOf(TWndClassEx);
    Style: CS_HREDRAW or CS_VREDRAW;
    lpfnWndProc: @WndProc;
    cbClsExtra: 0;
    cbWndExtra: 0;
    hbrBackground: COLOR_APPWORKSPACE;
    lpszMenuName: nil;
    lpszClassName: ClassName;
    hIconSm: 0;
    );
Das ergibt das normale Fenstergrau von Windows.

Rastaman 14. Okt 2005 18:46

Re: STATIC Control transparent?
 
Zitat:

Zitat von Olli
Das Ding ist doch schon "transparent", es sei denn du änderst die Farbe. In diesem Fall nimmste WM_CTLCOLORSTATIC :Wink:

Ach ja :wall:

Zitat:

Zitat von Olli
:wall: die genannten Werte sind Indeces deren Farbwerte (RGB) man mit Suche im Microsoft Developers NetworkGetSysColor herausbekommt.

Wussti net :)

NicoDE 14. Okt 2005 18:53

Re: STATIC Control transparent?
 
Zitat:

Zitat von Luckie
Delphi-Quellcode:
hbrBackground: COLOR_APPWORKSPACE;
Das ergibt das normale Fenstergrau von Windows.

Nope, das ergibt die Farbe des inaktiven Fensterrandes (COLOR_APPWORKSPACE = COLOR_INACTIVEBORDER + 1).

Zitat:

hbrBackground

Identifies the class background brush. This member can be a handle to the physical brush to be used for painting the background, or it can be a color value. A color value must be one of the following standard system colors (the value 1 must be added to the chosen color).
Korrekt wäre also COLOR_BTNFACE + 1.

Luckie 15. Okt 2005 15:27

Re: STATIC Control transparent?
 
Also bei mir (Windows 2000) macht das keinen Unterschied. :gruebel:

NicoDE 17. Okt 2005 11:45

Re: STATIC Control transparent?
 
Zitat:

Zitat von Luckie
Also bei mir (Windows 2000) macht das keinen Unterschied. :gruebel:

Weil für beide standardmäßig der gleiche Farbwert eingestellt ist...

D4rk4ng3l_md 3. Mai 2007 17:38

Re: STATIC Control transparent?
 
Hi,

hmm, schon 'n bissel alt das Thema, hab aber noch einen Lösungsvorschlag, der eigentlich immer funktionieren sollte.

Delphi-Quellcode:
    WM_CTLCOLORSTATIC:
      begin
        SetBkMode(wParam, TRANSPARENT);
        SelectObject(wParam, GetStockObject(NULL_BRUSH));
      end;
Das ganze kann man dann noch via GetCDlgtrlID(lParam) nur auf bestimmte Statics anwenden.

Gruß D4rk4ng3l Stefan


Alle Zeitangaben in WEZ +1. Es ist jetzt 03:53 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz