UnderwareDESIGN

PlayBASIC => Resources => Source Codes => Topic started by: Adaz on October 20, 2008, 08:44:44 AM

Title: Hand pointer
Post by: Adaz on October 20, 2008, 08:44:44 AM
Hi,

How can I change the mouse pointer to "hand" icon? Do I have to call a dll?

Thanks,
Title: Re: Hand pointer
Post by: Adaz on October 20, 2008, 08:51:30 AM
[pbcode]
Constant IDC_HAND = 32649
constant IDC_ARROW = 32512

LinkDll "user32.dll"
 LoadCursor (hInstance, lpCursorName) alias "LoadCursorA" As integer
 SetCursorA (hCursor) alias "SetCursor"  As integer
EndLinkDll


do
cls 0
   if leftmousebutton()
      SetCursorA (LoadCursor(0,IDC_HAND))
   else
      SetCursorA (LoadCursor(0,IDC_ARROW))
   endif
sync
loop
[/pbcode]
Title: Re: Hand pointer
Post by: thaaks on October 20, 2008, 10:57:39 AM
You could of course also switch off the mouse pointer using
Mouse off
and draw any sprite at the cursor position...