怎样抓取当前鼠标形状: 怎样抓取当前鼠标形状: 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 鼠标的形状??是鼠标的指针吧??用GetCursor 或者你先Load一个Icon,将他的Handle传给GetIconInfo这个API来获得更加详细的资料 先用image edit做一个鼠标。用上面的api调用就ok 了 ,给你个例子先 const crhehe=1;implementation{$R *.dfm} {$R BIT.res} {$R CUR.res}procedure TForm1.Button4Click(Sender: TObject);beginscreen.Cursors[crhehe]:=loadcursor(Hinstance,'CUR');screen.Cursor:=crhehe;end; 先定义一个cursor变量:var GlobalCur:TIcon; windowhld:hwnd; threadld:dword;begin windowhld:=GetForegroundWindow; threadld:=GetWindowThreadProcessId(Windowhld,nil); AttachThreadInput(GetCurrentThreadId,threadld,true); GlobalCur:=TIcon.Create; GlobalCur.handle:=GetCursor; AttachThreadInput(GetCurrentThreadId,threadld,false);然后bitmap.canvas.brush.Style:=bsclear;bitmap.canvas.draw(x,y,GlobalCur); //x,y的值可以通过GetCursorPos得到 procedure TForm1.Timer1Timer(Sender: TObject);var ico:Ticon; hld:hwnd; threadld:dword; mp:tpoint;begin getcursorpos(mp); canvas.FillRect(rect(0,0,32,32)); hld:=Windowfrompoint(mp); threadld:=GetWindowThreadProcessId(hld,nil); AttachThreadInput(GetCurrentThreadId,threadld,true); ico:=ticon.Create; ico.Handle:=getcursor; AttachThreadInput(GetCurrentThreadId,threadld,false); canvas.Draw(0,0,ico); ico.free;end; 请问delphi做串口通讯是mscomm好还是spcomm好? 小弟能否把 Adobe的PDF阅读控件(acropdf.dll)与我的软件一起发发布吗? MODEN拨号? 新手请教,如何让一个Editbox只能输入数字? 如何复制某一文件夹内所有的word文档到两一目录中? 我要用网络编程,但是我想隐藏我的IP,如果还能隐藏MAC地址就更好了!( 哪位记得调用系统日历\计算器的函数怎么用了? 终于突破1000分了, 散分, 10分钟后结!!!!! 小妹?^_^?捉虫:两条语句? 使用C++Biulder4,怎样在一个新的工程中使用已开发好的旧form? 如何最小化所有窗口 gb--big
const
crhehe=1;
implementation{$R *.dfm}
{$R BIT.res}
{$R CUR.res}
procedure TForm1.Button4Click(Sender: TObject);
begin
screen.Cursors[crhehe]:=loadcursor(Hinstance,'CUR');
screen.Cursor:=crhehe;
end;
var GlobalCur:TIcon;
windowhld:hwnd;
threadld:dword;
begin
windowhld:=GetForegroundWindow;
threadld:=GetWindowThreadProcessId(Windowhld,nil);
AttachThreadInput(GetCurrentThreadId,threadld,true);
GlobalCur:=TIcon.Create;
GlobalCur.handle:=GetCursor;
AttachThreadInput(GetCurrentThreadId,threadld,false);
然后
bitmap.canvas.brush.Style:=bsclear;
bitmap.canvas.draw(x,y,GlobalCur); //x,y的值可以通过GetCursorPos得到
var ico:Ticon;
hld:hwnd;
threadld:dword;
mp:tpoint;
begin
getcursorpos(mp);
canvas.FillRect(rect(0,0,32,32));
hld:=Windowfrompoint(mp);
threadld:=GetWindowThreadProcessId(hld,nil);
AttachThreadInput(GetCurrentThreadId,threadld,true);
ico:=ticon.Create;
ico.Handle:=getcursor;
AttachThreadInput(GetCurrentThreadId,threadld,false);
canvas.Draw(0,0,ico);
ico.free;
end;