我写了段程序,能够得到鼠标光标的状态。<br>可是发现在游戏里的鼠标光标的句柄不管变化与否,全是0,也就是说没有办法获取其鼠标变化状态?<br>在游戏以外的鼠标状态变化能准确捕获。<br><br>procedure TfrmMain.Timer2Timer(Sender: TObject);<br>var<br>cursor :TCursorINFO;<br>CurHandle :cardinal;<br>ActiveHandle :cardinal;<br>begin<br> CurHandle := GetCurrentThreadID;<br> ActiveHandle := GetWindowThreadProcessID(hnd, nil);<br> //AttachThreadInput(CurHandle, ActiveHandle, True);<br> cursor.cbSize:=sizeof(cursor);<br> GetCursorInfo(cursor);<br> frmMain.Label31.Caption:=inttostr(cursor.hCursor);<br> frmMain.Label32.Caption:=inttostr(cursor.ptScreenPos.X);<br> frmMain.Label33.Caption:=inttostr(cursor.ptScreenPos.Y);<br> frmMain.Label34.Caption:=inttostr(cursor.flags);<br> frmMain.Label39.Caption:=inttostr(cursor.cbSize);<br>end;