Direct-X에서 테스트는 안해봤지만..
아래 소스를 참고하셔서 시도해보세요..
------------------------------------------------------------------
Function GetCursorInfo2:TCursorInfo;
Var
hWindow: HWND;
pt: TPoint;
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;
asfasfd 님이 쓰신 글 :
: 다이렉트x화면에서 마우스 모양감지하는 방법이 궁금합니다.
: 마우스를 움직였을 때, 특정 위치에서 마우스 모양이 변하는지 그렇지 않은지만 확인하면됩니다. 마우스 모양이 어떤지는 관심도 없구요.
:
: 4시간이 넘게 강좌면 질답란을 기웃거려봐도, 못찾겠네요. 답변부탁드릴께요.(__)
|