GetCursorPos(DrawPos); //
MyCursor := TIcon.Create;
Getcursorpos(mp);
hld := WindowFromPoint(mp); //
Threadld := GetWindowThreadProcessId(hld, nil); //返回窗口线索及过程ID
AttachThreadInput(GetCurrentThreadId, Threadld, True);
MyCursor.Handle := Getcursor();
AttachThreadInput(GetCurrentThreadId, threadld, False);
GetIconInfo(Mycursor.Handle, pIconInfo);
cursorx := DrawPos.x - round(pIconInfo.xHotspot);
cursory := DrawPos.y - round(pIconInfo.yHotspot);这段代码什么意思啊有谁能给详细解释解释。。尤其是其中的Api函数谢谢啊!
MyCursor := TIcon.Create;
Getcursorpos(mp);
hld := WindowFromPoint(mp); //
Threadld := GetWindowThreadProcessId(hld, nil); //返回窗口线索及过程ID
AttachThreadInput(GetCurrentThreadId, Threadld, True);
MyCursor.Handle := Getcursor();
AttachThreadInput(GetCurrentThreadId, threadld, False);
GetIconInfo(Mycursor.Handle, pIconInfo);
cursorx := DrawPos.x - round(pIconInfo.xHotspot);
cursory := DrawPos.y - round(pIconInfo.yHotspot);这段代码什么意思啊有谁能给详细解释解释。。尤其是其中的Api函数谢谢啊!
解决方案 »
- 为什么用SPY++捕捉不到TListView里的LVM_XXXXX这些消息?
- Merry Christmas
- 如何每次只打开一个子窗体?
- 程序员联盟 群号:3546259 欢迎it界从事计算机程序的加盟
- 帮忙找一下错误,有分数的!
- XPMenu控件的问题!!!
- 关于server端连接多个client端
- DELPHI 里有什么控件在背景上可以显示文本,我用的是image做的背景!
- 窗体移动时,窗体上的控件会收到什么消息呢?
- DateTimePicker控件可以连接到SQL数据库吗?可以可话那代码又是什么?程序中``急
- 自定义chekbox组件
- dll 中指定Exitproc 为什么不起作用(高分求解)?
Cursorx, Cursory: integer;
dc: hdc;
Mycan: Tcanvas;
R: TRect;
DrawPos: TPoint;
MyCursor: TIcon;
hld: hwnd;
Threadld: dword;
mp: tpoint;
pIconInfo: TIconInfo;
WindowFromPoint(xx);
GetWindowThreadProcessId(xx, nil);
AttachThreadInput(xx, xx, True);
GetIconInfo(xx, xx);
说简单点吧。。上面四个Api什么意思?(详细说明)谢谢!!
GetWindowThreadProcessId(xx, nil); 得到给定句柄的线程IDAttachThreadInput(xx, xx, True); 没有用过。GetIconInfo(xx, xx);得到ICON文件的有关信息。