Dobry den, potreboval bych poradit s upravou vzhledu aplikace v Delphi. Potrebuju zmenit vzhled neklintske oblasti Formulare -titulkoveho pruhu a ramecku okna. Pro predstavu chci dosahnout neceho jako je vzhled ve Windows XP -ovsem svuj vlastni a pouze v ramci sve aplikace. (Reseni napriklad pomoci DLL knihovny).
Jeste bych chtel rict ze se mi nejedna o nejake rychle reseni -pridavani komponent -bitmap do klientske oblasti, skryti puvodniho titulkovehu pruhu a nasledne presouvani puvodnich komponent (pricteni hodnoty k jejich parametru Width a Height) takovych reseni sem jiz vyzkousel vice avsak celkem bez uspechu (neustale potize s nekterou komponentou apod.)
Takze nevadi kdyz program bude slozitejsi -ba naopak.
Doufam ze podobny problem jiz nekdo resil a podeli se o skusenosti.
Mnohokrat dekuji.
Fórum › Delphi
DELPHI - vlastni vzhled neklientske oblasti
prakticky nemožné,
něco ti tu ale napíšu. musíš si to domakat, já na tom dělám už půl roku, až to bude, tak to vydám - free..
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtDlgs, StdCtrls, ExtCtrls, jpeg, Buttons, XPMan,
AppEvnts ;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
TitleButton: TRect;
procedure WMNCActivate(var Msg: TWMNCActivate); message WM_NCActivate;
procedure WMNCPaint(var Msg: TWMNCPaint); message WM_NCPAINT;
procedure WMSetText(var Msg: TWMSetText); message WM_SETTEXT;
procedure Kresli;
procedure Click(var Msg: TWMNCLButtonDown); message WM_NCLBUTTONDOWN;
procedure Up(var Msg: TWMNCLBUTTONUP); message WM_NCLBUTTONUP;
procedure MOVE(var Msg: TWMNCMOUSEMOVE); message WM_NCMOUSEMOVE;
public
{ Public declarations }
end;
var
Form1: TForm1;
const
htTitleBtn = htSizeLast + 1;
implementation
uses Unit2;
{$R *.dfm}
procedure TForm1.WMNCActivate(var Msg: TWMNCActivate);
begin
inherited;
kresli;
end;
procedure TForm1.WMNCPaint(var Msg: TWMNCPaint);
begin
// inherited;
kresli;
end;
procedure TForm1.WMSetText(var Msg: TWMSetText);
begin
inherited;
kresli;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
form2.showmodal;
end;
procedure TForm1.Kresli;
var tox,x,toy:integer;
bmap: TBitmap;
XFrame, XTtlBit, YTtlBit: Integer;
ndc:longint;
d:TControlcanvas;
begin
x:=-10;
tox:=self.Width;
toy:=self.Height;
Canvas.Handle := GetWindowDC(self.Handle);
canvas.Pen.Color:=$00746253;
MoveToEx(canvas.Handle, x,0,nil);
LineTo(Canvas.Handle, tox,0);
canvas.Pen.Color:=$00B79F8C;
MoveToEx(canvas.Handle, x,1,nil);
LineTo(Canvas.Handle, tox,1);
canvas.Pen.Color:=$00B79F8C;
MoveToEx(canvas.Handle, x,2,nil);
LineTo(Canvas.Handle, tox,2);
canvas.Pen.Color:=$00B39E8B;
MoveToEx(canvas.Handle, x,3,nil);
LineTo(Canvas.Handle, tox,3);
canvas.Pen.Color:=$00B19A88;
MoveToEx(canvas.Handle, x,4,nil);
LineTo(Canvas.Handle, tox,4);
canvas.Pen.Color:=$00AF9986;
MoveToEx(canvas.Handle, x,5,nil);
LineTo(Canvas.Handle, tox,5);
canvas.Pen.Color:=$00AA9682;
MoveToEx(canvas.Handle, x,6,nil);
LineTo(Canvas.Handle, tox,6);
canvas.Pen.Color:=$00A6907F;
MoveToEx(canvas.Handle, x,7,nil);
LineTo(Canvas.Handle, tox,7);
canvas.Pen.Color:=$00A48F7D;
MoveToEx(canvas.Handle, x,8,nil);
LineTo(Canvas.Handle, tox,8);
canvas.Pen.Color:=$00A08C7C;
MoveToEx(canvas.Handle, x,9,nil);
LineTo(Canvas.Handle, tox,9);
canvas.Pen.Color:=$009D8877;
MoveToEx(canvas.Handle, x,10,nil);
LineTo(Canvas.Handle, tox,10);
canvas.Pen.Color:=$009C8776;
MoveToEx(canvas.Handle, x,11,nil);
LineTo(Canvas.Handle, tox,11);
canvas.Pen.Color:=$00988573;
MoveToEx(canvas.Handle, x,12,nil);
LineTo(Canvas.Handle, tox,12);
canvas.Pen.Color:=$00978472;
MoveToEx(canvas.Handle, x,13,nil);
LineTo(Canvas.Handle, tox,13);
canvas.Pen.Color:=$0093806E;
MoveToEx(canvas.Handle, x,14,nil);
LineTo(Canvas.Handle, tox,14);
canvas.Pen.Color:=$00917D6C;
MoveToEx(canvas.Handle, x,15,nil);
LineTo(Canvas.Handle, tox,15);
canvas.Pen.Color:=$00746253;
MoveToEx(canvas.Handle, x,16,nil);
LineTo(Canvas.Handle, tox,16);
canvas.Pen.Color:=$00766455;
MoveToEx(canvas.Handle, x,17,nil);
LineTo(Canvas.Handle, tox,17);
canvas.Pen.Color:=$00786857;
MoveToEx(canvas.Handle, x,18,nil);
LineTo(Canvas.Handle, tox,18);
canvas.Pen.Color:=$007C695A;
MoveToEx(canvas.Handle, x,19,nil);
LineTo(Canvas.Handle, tox,19);
canvas.Pen.Color:=$007E6D5C;
MoveToEx(canvas.Handle, x,20,nil);
LineTo(Canvas.Handle, tox,20);
canvas.Pen.Color:=$007F6D5D;
MoveToEx(canvas.Handle, x,21,nil);
LineTo(Canvas.Handle, tox,21);
canvas.Pen.Color:=$00837061;
MoveToEx(canvas.Handle, x,22,nil);
LineTo(Canvas.Handle, tox,22);
canvas.Pen.Color:=$00867463;
MoveToEx(canvas.Handle, x,23,nil);
LineTo(Canvas.Handle, tox,23);
canvas.Pen.Color:=$00887664;
MoveToEx(canvas.Handle, x,24,nil);
LineTo(Canvas.Handle, tox,24);
canvas.Pen.Color:=$00897666;
MoveToEx(canvas.Handle, x,25,nil);
LineTo(Canvas.Handle, tox,25);
canvas.Pen.Color:=$008D7968;
MoveToEx(canvas.Handle, x,26,nil);
LineTo(Canvas.Handle, tox,26);
canvas.Pen.Color:=$008D7969;
MoveToEx(canvas.Handle, x,27,nil);
LineTo(Canvas.Handle, tox,27);
canvas.Pen.Color:=$008F7C6A;
MoveToEx(canvas.Handle, x,28,nil);
LineTo(Canvas.Handle, tox,28);
canvas.Pen.Color:=$008F7C6A;
MoveToEx(canvas.Handle, x,29,nil);
LineTo(Canvas.Handle, tox,29);
/////////
canvas.Pen.Color:=$008F7C6A;
MoveToEx(canvas.Handle, 3,30,nil);
LineTo(Canvas.Handle, 3,toy);
canvas.Pen.Color:=$008F7C6A;
MoveToEx(canvas.Handle, 2,30,nil);
LineTo(Canvas.Handle, 2,toy);
canvas.Pen.Color:=$008F7C6A;
MoveToEx(canvas.Handle, 1,30,nil);
LineTo(Canvas.Handle, 1,toy);
canvas.Pen.Color:=$008F7C6A;
MoveToEx(canvas.Handle, 0,30,nil);
LineTo(Canvas.Handle, 0,toy);
canvas.Pen.Color:=$008F7C6A;
MoveToEx(canvas.Handle, tox-4,30,nil);
LineTo(Canvas.Handle, tox-4,toy);
canvas.Pen.Color:=$008F7C6A;
MoveToEx(canvas.Handle, tox-3,30,nil);
LineTo(Canvas.Handle, tox-3,toy);
canvas.Pen.Color:=$008F7C6A;
MoveToEx(canvas.Handle, tox-2,30,nil);
LineTo(Canvas.Handle, tox-2,toy);
canvas.Pen.Color:=$008F7C6A;
MoveToEx(canvas.Handle, tox-1,30,nil);
LineTo(Canvas.Handle, tox-1,toy);
canvas.Pen.Color:=$008F7C6A;
MoveToEx(canvas.Handle, x,toy-4,nil);
LineTo(Canvas.Handle, tox,toy-4);
canvas.Pen.Color:=$008F7C6A;
MoveToEx(canvas.Handle, x,toy-3,nil);
LineTo(Canvas.Handle, tox,toy-3);
canvas.Pen.Color:=$008F7C6A;
MoveToEx(canvas.Handle, x,toy-2,nil);
LineTo(Canvas.Handle, tox,toy-2);
canvas.Pen.Color:=$008F7C6A;
MoveToEx(canvas.Handle, x,toy-1,nil);
LineTo(Canvas.Handle, tox,toy-1);
canvas.Brush.Style:=bsclear;
canvas.TextOut(10,10,form1.Caption);
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
self.WindowState:=wsmaximized;
end;
procedure TForm1.Click(var Msg: TWMNCLButtonDown);
begin
caption:='klik';
inherited;
kresli;
end;
procedure TForm1.Up(var Msg: TWMNCLBUTTONUP);
begin
caption:='up';
inherited;
kresli;
end;
procedure TForm1.MOVE(var Msg: TWMNCMOUSEMOVE);
begin
caption:='move';
inherited;
kresli;
end;
end.
přes zprávu hittest musíš odchytat pozici nad ikonami na minimaliziace apod. a kreslit vlastně..
není to žádnej zázrak..
Čus
http://jan.skrasek.com – @hrachcz – webdeveloper
Zjistit počet nových příspěvků
Přidej příspěvek
Toto téma je starší jak čtvrt roku – přidej svůj příspěvek jen tehdy, máš-li k tématu opravdu co říct!
Ano, opravdu chci reagovat → zobrazí formulář pro přidání příspěvku
×Vložení zdrojáku
×Vložení obrázku
×Vložení videa
Aktuálně jsou podporována videa ze serverů YouTube, Vimeo a Dailymotion.
×
Uživatelé prohlížející si toto vlákno
Uživatelé on-line: 0 registrovaných, 9 hostů
Podobná vlákna
Vlastní vzhled oken a komponent — založil Claustrophobic
Vlastní vzhled okna. Klasický obdélník - NE! — založil Sipar
Grafický vzhled — založil Hranicarrr
PHP vzhled — založil PHP