Autor Beitrag
MephistoFFF
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 60

Win 7

BeitragVerfasst: Do 15.01.15 22:51 
Hallo!

Ich versuche gerade ein kleines Programm zu schreiben welches mir einen Rahmen aus TLabels um bzw über ein anderes, fremdes Fenster legt.
Ich positionere dazu 4 TLabels in Rahmenform auf einer Form (Borderstyle bsnone) und lasse die Form über besagtes Fenster legen.
Ich muss nun den Bereich innerhalb des Rahmens transparent und vor allem auch "durchklickbar" bekommen, dass ich das Programm hinter meinem Rahmen immer noch bedienen kann. Ich habe Google nun weit über eine Stunde lang gequält aber habe nichts brauchbares gefunden.

Ist das überhaupt möglich? Vielen dank schon mal im Voraus!


Moderiert von user profile iconNarses: Topic aus Delphi Language (Object-Pascal) / CLX verschoben am Do 15.01.2015 um 22:27
Martok
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: Do 15.01.15 23:59 
Moin!

Du suchst Layered Windows. Eigentlich konnte ich mich noch an SetWindowRgn erinnern, aber so wie die das in diesem Artikel schreiben, war das schon 2000 nicht mehr cool :lol:

Je nach Anwendungsfall (einfache Formen) könnte SetWindowRgn allerdings trotzdem einfacher sein. Wenn du das nur einmal machen musst, kannst du die Region prinzipiell auch aus einem Bitmap generieren. An der Stelle lohnt sich dann allerdings ein LayeredWindow schon fast wieder.

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
WasWeißDennIch
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 653
Erhaltene Danke: 160



BeitragVerfasst: Fr 16.01.15 09:24 

Für diesen Beitrag haben gedankt: Martok
MephistoFFF Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 60

Win 7

BeitragVerfasst: Sa 17.01.15 20:24 
Danke, hat funktioniert!

ausblenden Quelltext
1:
2:
3:
4:
CLFRgn:=CreateRectRgn(0,0,Form1.Width,Form1.Height);
CLFRgnTmp:=CreateRectRgn(PanelLeft.width,PanelTop.Height,Form1.Width-PanelRight.width,panelBottom.top);
CombineRgn(CLFRgn,CLFRgn,CLFRgnTmp,RGN_DIFF);
SetWindowRgn(Form1.Handle,CLFRgn,True);