你是说主界面吧其实什么也没有,我曾经模仿过。至于用的什么控件由于我现在的机器没装
没法测,我这有一个取鼠标位置的类名的小程序可以测出来 你可以试试
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
nameLb: TLabel;
classlb: TLabel;
Timer1: TTimer;
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure GetMousePosHwndAndClassName(Sender : TPoint);
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
begin
Form1.FormStyle := fsStayOnTop;
Timer1.Interval := 50;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var
rPos: TPoint;
begin
if boolean(GetCursorPos(rPos)) then
GetMousePosHwndAndClassName(rPos);
end;
procedure TForm1.GetMousePosHwndAndClassName(Sender: TPoint);
var
hWnd: THandle;
aName: array [0..255] of char;
begin
hWnd := WindowFromPoint(Sender);
NameLB.Caption := 'Handle : ' + IntToStr(hWnd);
if boolean(GetClassName(hWnd, aName, 256)) then
ClassLB.Caption :='ClassName : ' + string(aName)
else
ClassLB.Caption :='ClassName : not found';
end;
end.
Form代码
object Form1: TForm1
Left = 464
Top = 164
Width = 215
Height = 229
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object nameLb: TLabel
Left = 32
Top = 32
Width = 38
Height = 13
Caption = 'nameLb'
end
object classlb: TLabel
Left = 24
Top = 64
Width = 32
Height = 13
Caption = 'classlb'
end
object Timer1: TTimer
OnTimer = Timer1Timer
Left = 88
Top = 112
end
end