Big Cross Mouse Cursor [Windows]
Posted: Thu Aug 23, 2012 7:44 pm
Tested with PB v4.61 x86 Windows XP x86 -Windows 7 x64
Escape to quit
Escape to quit
Code: Select all
Global hWnd_0,hWnd_1,hhkLLMouse,Width,Height
ExamineDesktops()
Width = DesktopWidth(0)
Height = DesktopHeight(0)
Procedure MouseHook(nCode, wParam, lParam)
Select wParam
Case #WM_LBUTTONDOWN
Debug "OK"
Case #WM_MOUSEMOVE
GetCursorPos_(p.POINT)
MoveWindow_(hWnd_0,0,p\y+2,Width,2,1)
MoveWindow_(hWnd_1,p\x+2,0,2,Height,1)
SetWindowPos_(hWnd_0, #HWND_TOPMOST, 0, 0, 0, 0,#SWP_NOSIZE|#SWP_NOMOVE| #SWP_SHOWWINDOW|#SWP_NOACTIVATE)
SetWindowPos_(hWnd_1, #HWND_TOPMOST, 0, 0, 0, 0,#SWP_NOSIZE|#SWP_NOMOVE| #SWP_SHOWWINDOW|#SWP_NOACTIVATE)
EndSelect
ProcedureReturn CallNextHookEx_(0, nCode, wParam, lParam)
EndProcedure
hWnd_0 = OpenWindow(0,0,Height/2,Width,1,"",#PB_Window_BorderLess)
hWnd_1 = OpenWindow(1,Width/2,0,1,Height,"",#PB_Window_BorderLess,WindowID(0))
SetWindowColor(0,$0000FF)
SetWindowColor(1,$0000FF)
hhkLLMouse = SetWindowsHookEx_(#WH_MOUSE_LL, @MouseHook(), GetModuleHandle_(0), 0)
Repeat
Select WaitWindowEvent()
EndSelect
Until GetAsyncKeyState_(#VK_ESCAPE) & 1
UnhookWindowsHookEx_(hhkLLMouse)