Code: Select all
SetClassLong_(hWnd, #GCL_HCURSOR, LoadCursor_(0, #IDC_HAND))
SOLVED:
Code: Select all
SetClassLongPtr_(WindowID(0), #GCL_HCURSOR, 0)
SetCursor_(LoadCursor_(0, #IDC_HAND))
Code: Select all
SetClassLong_(hWnd, #GCL_HCURSOR, LoadCursor_(0, #IDC_HAND))
Code: Select all
SetClassLongPtr_(WindowID(0), #GCL_HCURSOR, 0)
SetCursor_(LoadCursor_(0, #IDC_HAND))
Code: Select all
setcursor_(hCursor)Code: Select all
If InitSprite() = #Null
MessageRequester("Error", "InitSprite failed.", #PB_MessageRequester_Error)
End
EndIf
#_WINDOW_WIDTH = 720
#_WINDOW_HEIGHT = 640
OpenWindow(0, 0, 0, #_WINDOW_WIDTH, #_WINDOW_HEIGHT, "", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
OpenWindowedScreen(WindowID(0), 0, 0, #_WINDOW_WIDTH, #_WINDOW_HEIGHT)
CreateSprite(0, 100, 100, #PB_Sprite_AlphaBlending)
Repeat
Repeat
Define event = WindowEvent()
Select event
Case #PB_Event_CloseWindow
End
EndSelect
Until event = #Null
FlipBuffers()
ClearScreen(#Black)
If WindowMouseX(0) >= 0 And WindowMouseX(0) < 100 And WindowMouseY(0) >= 0 And WindowMouseY(0) < 100
DisplayTransparentSprite(0, 0, 0, 255, #Green)
SetCursor_(LoadCursor_(0, #IDC_HAND))
Else
DisplayTransparentSprite(0, 0, 0, 255, #Gray)
SetCursor_(LoadCursor_(0, #IDC_ARROW))
EndIf
Delay(1)
ForEver
Code: Select all
If InitSprite() = #Null
MessageRequester("Error", "InitSprite failed.", #PB_MessageRequester_Error)
End
EndIf
#_WINDOW_WIDTH = 720
#_WINDOW_HEIGHT = 640
OpenWindow(0, 0, 0, #_WINDOW_WIDTH, #_WINDOW_HEIGHT, "", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
OpenWindowedScreen(WindowID(0), 0, 0, #_WINDOW_WIDTH, #_WINDOW_HEIGHT)
CreateSprite(0, 100, 100, #PB_Sprite_AlphaBlending)
Repeat
Repeat
Define event = WindowEvent()
Select event
Case #PB_Event_CloseWindow
End
EndSelect
Until event = #Null
FlipBuffers()
ClearScreen(#Black)
If WindowMouseX(0) >= 0 And WindowMouseX(0) < 100 And WindowMouseY(0) >= 0 And WindowMouseY(0) < 100
DisplayTransparentSprite(0, 0, 0, 255, #Green)
SetClassLongPtr_(WindowID(0), #GCL_HCURSOR, 0)
SetCursor_(LoadCursor_(0, #IDC_HAND))
Else
DisplayTransparentSprite(0, 0, 0, 255, #Gray)
SetClassLongPtr_(WindowID(0), #GCL_HCURSOR, 0)
SetCursor_(LoadCursor_(0, #IDC_ARROW))
EndIf
Delay(1)
ForEver