WinAPI函数 function WindowFromPoint(Point: TPoint): HWND;
procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
p: TPoint;
wclss: array [0..255] of char;
state: integer;
wnd: HWND;
begin
p.x := x;
p.y := y;
p := ClientToScreen(p);
wnd := WindowFromPoint(p);
state := GetClassName(wnd,wclss,254);
ShowMessage(format('当前窗口: %X; WindowClass: %s',[wnd,wclass]);
end;