您是什么意思?
是返回桌面和任务条的句柄么?
private
{ Private declarations }
procedure GetMousePosHwndAndClassName(Sender : TPoint);
procedure TForm1.GetMousePosHwndAndClassName(Sender: TPoint);
var
hWnd: THandle;
aName: array [0..255] of char;
begin
hWnd := WindowFromPoint(Sender);
Label1.Caption := 'Handle : ' + IntToStr(hWnd);
if boolean(GetClassName(hWnd, aName, 256)) then
Label2.Caption := 'ClassName : ' + string(aName)
else
Label2.Caption := 'ClassName : not found';
end;
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;