自己做一个都可以:<br><br>unit Unit1;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,<br> ExtCtrls, StdCtrls;<br><br>type<br> TForm1 = class(TForm)<br> Timer1: TTimer;<br> labHandle: TLabel;<br> labclassname: TLabel;<br> labParent: TLabel;<br> Label1: TLabel;<br> Label2: TLabel;<br> Label3: TLabel;<br> Label4: TLabel;<br> Bevel1: TBevel;<br> labColor: TLabel;<br> Label5: TLabel;<br> labDelphiColor: TLabel;<br> Label6: TLabel;<br> labHtmlColor: TLabel;<br> Shape1: TShape;<br> procedure Timer1Timer(Sender: TObject);<br> procedure FormCreate(Sender: TObject);<br> private<br> { Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> Form1: TForm1;<br><br>implementation<br><br>{$R *.DFM}<br><br>function ColorToHTMLHex(Color: TColor): string;<br>begin <br> Result := IntToHex(ColorToRGB(Color),6); <br> Result := Copy(Result,5,2)+Copy(Result,3,2)+Copy(Result,1,2); <br>end;<br><br>procedure TForm1.Timer1Timer(Sender: TObject);<br>var<br> p:TPoint;<br> h:HWND;<br> s:array [0..255] of char;<br> DC: HDC;<br> clr: COLORREF;<br>begin<br><br> GetCursorPos(p);<br><br> //Get Class Name<br> h:=WindowFromPoint(p);<br> GetClassName(h,s,255);<br> labHandle.Caption:=format('0x%x',[h]);<br> labclassname.Caption:=s;<br> h:=GetParent(h);<br> GetClassName(h,s,255);<br> labParent.Caption:=s;<br><br> //Get Color<br> DC := GetDC(HWND(nil));<br> clr := GetPixel(DC, p.x, p.y);<br> labColor.Caption := format('R:%d G:%d B:%d',[GetRValue(clr),GetGValue(clr),GetBValue(clr)]);<br> labDelphiColor.Caption := format('%d ($%x)',[clr,clr]);<br> labHtmlColor.Caption := '#'+ColorToHTMLHex(clr);<br> Shape1.Brush.Color := clr;<br><br>end;<br><br><br>procedure TForm1.FormCreate(Sender: TObject);<br>begin<br> SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0,SWP_NOSIZE or SWP_NOMOVE or SWP_NOACTIVATE);<br>end;<br><br>end.<br>