//方案1
function Fun1: HCURSOR;
var
hCur : TCursorInfo;
begin
ZeroMemory(@hCur,sizeof(hCur));
hCur.cbSize:=SizeOf(hCur);
GetCursorInfo(hCur);
result:=hCur.hCursor;
end;
//方案2
function Fun2: HCURSOR;
var
wid : HWND;
tid : DWORD;
begin
wid:=GetForegroundWindow; //获取最前面的窗口
tid:=GetWindowThreadProcessId(wid,nil); //获取窗口所在的进程
AttachThreadInput(GetCurrentThreadId,tid,true);
result:=GetCursor;
AttachThreadInput(GetCurrentThreadId,tid,false);
end;