Taktaky
Messages postés31Date d'inscriptionlundi 21 mai 2007StatutMembreDernière intervention21 août 2008
-
4 juil. 2008 à 21:00
f0xi
Messages postés4205Date d'inscriptionsamedi 16 octobre 2004StatutModérateurDernière intervention12 mars 2022
-
5 juil. 2008 à 11:53
Salut
cett code prendere la Position de la Serie (Cursor position)
mais je voudrais un peut deplacer la Position de Cursor avec 30 pixcel, 30 pixcel
alors left+30, top+30 (point.x, point.y) !
CursorPosition ?
// 1. Get the handle to the current mouse-cursor and its position
function GetCursorInfo2: TCursorInfo; var hWindow: HWND;
pt: TPoint;
pIconInfo: TIconInfo;
dwThreadID, dwCurrentThreadID: DWORD;
begin Result.hCursor := 0;
ZeroMemory(@Result, SizeOf(Result));
// Find out which window owns the cursor
if GetCursorPos(pt)then
begin
Result.ptScreenPos : = pt;
hWindow := WindowFromPoint(pt);
if IsWindow(hWindow)then
begin
// Get the thread ID for the cursor owner.
dwThreadID : = GetWindowThreadProcessId(hWindow, nil);
// Get the thread ID for the current thread
dwCurrentThreadID := GetCurrentThreadId;
// If the cursor owner is not us then we must attach to
// the other thread in so that we can use GetCursor() to
// return the correct hCursor
if(dwCurrentThreadID <> dwThreadID)then
begin
if AttachThreadInput(dwCurrentThreadID, dwThreadID, True)then
begin
// Get the handle to the cursor
Result.hCursor : = GetCursor;
AttachThreadInput(dwCurrentThreadID, dwThreadID, False);
end;
end
else
begin
Result.hCursor := GetCursor;
end;
end;
end;
end;