كود تغيير ألوان النظام
#1
كود :
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls; type TForm1 = class(TForm) Button1: TButton; Timer1: TTimer; Label1: TLabel; Label2: TLabel; Label3: TLabel; Button2: TButton; Button3: TButton; procedure Timer1Timer(Sender: TObject); procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); function issam:DWORD; procedure Button3Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Timer1Timer(Sender: TObject); begin //Label1.Caption:=FormatCurr('',GetWindowDC(GetACP)); end; procedure TForm1.Button1Click(Sender: TObject); const aielements:array[0..2] of integer=(COLOR_3DSHADOW,COLOR_ACTIVECAPTION,COLOR_WINDOW); acololrs:array[0..2] of DWORD=(255,255,16777215); begin //aielements[0]:=COLOR_ACTIVEBORDER; //aielements[1]:=COLOR_ACTIVECAPTION; //aielements[2]:=COLOR_WINDOW; //acololrs[0]:=RGB(127,0,127); //acololrs[1]:=RGB(0,127,127); //acololrs[2]:=RGB(192,192,192); SetSysColors(3,aielements,acololrs); end; procedure TForm1.Button2Click(Sender: TObject); begin Label1.Caption:=FormatCurr('',RGB(255,255,255)); Label2.Caption:=FormatCurr('',RGB(0,128,128)); Label3.Caption:=FormatCurr('',RGB(192,0,192)); end; function TForm1.issam: DWORD; var nsize:integer; dwresult:DWORD; tcharbuff:PChar; begin dwresult:=GetSysColor(COLOR_WINDOW); GetMem(tcharbuff,1000); //StrCopy(tcharbuff,pchar(GetRValue(dwresult)+pchar(GetgValue(dwresult))+pchar(GetBValue(dwresult))) ; //MessageBox(null,tcharbuff,'GET system color',MB_ICONINFORMATION); MessageDlg(FormatFloat('',GetRValue(dwresult))+' '+FormatFloat('',GetgValue(dwresult))+' '+FormatFloat('',GetBValue(dwresult)),mtInformation,[mbyes],0); //================= end; procedure TForm1.Button3Click(Sender: TObject); begin issam; end; end.
الرد


التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم