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函数谢谢啊!

解决方案 »

  1.   

    代码不全吧,mp,drawpos都不知道是什么。
      

  2.   

    var
      Cursorx, Cursory: integer;
      dc: hdc;
      Mycan: Tcanvas;
      R: TRect;
      DrawPos: TPoint;
      MyCursor: TIcon;
      hld: hwnd;
      Threadld: dword;
      mp: tpoint;
      pIconInfo: TIconInfo;
      

  3.   


        WindowFromPoint(xx); 
        GetWindowThreadProcessId(xx, nil); 
        AttachThreadInput(xx, xx, True);
        GetIconInfo(xx, xx);
        说简单点吧。。上面四个Api什么意思?(详细说明)谢谢!!
      

  4.   

    WindowFromPoint(xx); 从Point所在位置获得句柄(Handle)
    GetWindowThreadProcessId(xx, nil); 得到给定句柄的线程IDAttachThreadInput(xx, xx, True); 没有用过。GetIconInfo(xx, xx);得到ICON文件的有关信息。