请问怎么用SPY++看一个程序类名啊?(20分)

  • 主题发起人 主题发起人 aliangzl
  • 开始时间 开始时间
A

aliangzl

Unregistered / Unconfirmed
GUEST, unregistred user!
比如:WINDOWS优化大师的类名!
 
自己试试不就知道了,点第5个按钮(一个小窗体+一个望远镜),然后用鼠标拖动那个<br>瞄准镜一样的东西。
 
在DELPHI里面有个WINSIGHT,也可以用啊!
 
自己做一个都可以:<br><br>unit Unit1;<br><br>interface<br><br>uses<br>&nbsp; Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,<br>&nbsp; ExtCtrls, StdCtrls;<br><br>type<br>&nbsp; TForm1 = class(TForm)<br>&nbsp; &nbsp; Timer1: TTimer;<br>&nbsp; &nbsp; labHandle: TLabel;<br>&nbsp; &nbsp; labclassname: TLabel;<br>&nbsp; &nbsp; labParent: TLabel;<br>&nbsp; &nbsp; Label1: TLabel;<br>&nbsp; &nbsp; Label2: TLabel;<br>&nbsp; &nbsp; Label3: TLabel;<br>&nbsp; &nbsp; Label4: TLabel;<br>&nbsp; &nbsp; Bevel1: TBevel;<br>&nbsp; &nbsp; labColor: TLabel;<br>&nbsp; &nbsp; Label5: TLabel;<br>&nbsp; &nbsp; labDelphiColor: TLabel;<br>&nbsp; &nbsp; Label6: TLabel;<br>&nbsp; &nbsp; labHtmlColor: TLabel;<br>&nbsp; &nbsp; Shape1: TShape;<br>&nbsp; &nbsp; procedure Timer1Timer(Sender: TObject);<br>&nbsp; &nbsp; procedure FormCreate(Sender: TObject);<br>&nbsp; private<br>&nbsp; &nbsp; { Private declarations }<br>&nbsp; public<br>&nbsp; &nbsp; { Public declarations }<br>&nbsp; end;<br><br>var<br>&nbsp; Form1: TForm1;<br><br>implementation<br><br>{$R *.DFM}<br><br>function ColorToHTMLHex(Color: TColor): string;<br>begin <br>&nbsp; Result := IntToHex(ColorToRGB(Color),6); <br>&nbsp; Result := Copy(Result,5,2)+Copy(Result,3,2)+Copy(Result,1,2); &nbsp;<br>end;<br><br>procedure TForm1.Timer1Timer(Sender: TObject);<br>var<br>&nbsp; p:TPoint;<br>&nbsp; h:HWND;<br>&nbsp; s:array [0..255] of char;<br>&nbsp; DC: HDC;<br>&nbsp; clr: COLORREF;<br>begin<br><br>&nbsp; GetCursorPos(p);<br><br>&nbsp; //Get Class Name<br>&nbsp; h:=WindowFromPoint(p);<br>&nbsp; GetClassName(h,s,255);<br>&nbsp; labHandle.Caption:=format('0x%x',[h]);<br>&nbsp; labclassname.Caption:=s;<br>&nbsp; h:=GetParent(h);<br>&nbsp; GetClassName(h,s,255);<br>&nbsp; labParent.Caption:=s;<br><br>&nbsp; //Get Color<br>&nbsp; DC := GetDC(HWND(nil));<br>&nbsp; clr := GetPixel(DC, p.x, p.y);<br>&nbsp; labColor.Caption := format('R:%d G:%d B:%d',[GetRValue(clr),GetGValue(clr),GetBValue(clr)]);<br>&nbsp; labDelphiColor.Caption := format('%d ($%x)',[clr,clr]);<br>&nbsp; labHtmlColor.Caption := '#'+ColorToHTMLHex(clr);<br>&nbsp; Shape1.Brush.Color := clr;<br><br>end;<br><br><br>procedure TForm1.FormCreate(Sender: TObject);<br>begin<br>&nbsp; SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0,SWP_NOSIZE or SWP_NOMOVE or SWP_NOACTIVATE);<br>end;<br><br>end.<br>
 
应该是看窗口(控件)的类名。<br>先运行它,然后你应该能看明白。
 
接受答案了.
 
后退
顶部