October 28, 2020, 05:44:50 AM

Author Topic: [bb] Change Cursor Icon by Binary_Moon [ 1+ years ago ]  (Read 1201 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bb] Change Cursor Icon by Binary_Moon [ 1+ years ago ]
« on: June 29, 2017, 12:28:42 AM »
Title : Change Cursor Icon
Author : Binary_Moon
Posted : 1+ years ago

Description : requires the userlibs

Code: [Select]
.lib "user32.dll"
LoadCursor%( ID, Cursor ):"LoadCursorA"
SetCursor%( ID ):"SetCursor"


Code :
Code: BlitzBasic
  1. window = CreateWindow("Cursor Test",200,200,200,200,0,1)
  2. canvas = CreateCanvas(0,0,200,200,window)
  3.  
  4. quit = False
  5.  
  6. ; Mouse Pointers
  7. Const IDC_ARROW                 = 32512
  8. Const IDC_IBEAM                 = 32513
  9. Const IDC_WAIT                  = 32514
  10. Const IDC_CROSS                 = 32515
  11. Const IDC_UPARROW               = 32516
  12. Const IDC_SIZENWSE              = 32642
  13. Const IDC_SIZENESW              = 32643
  14. Const IDC_SIZEWE                = 32644
  15. Const IDC_SIZENS                = 32645
  16. Const IDC_SIZEALL               = 32646
  17. Const IDC_NO                    = 32648
  18. Const IDC_HAND                  = 32649
  19. Const IDC_APPSTARTING   = 32650
  20. Const IDC_HELP                  = 32651
  21. Const IDC_ICON                  = 32641
  22. Const IDC_SIZE                  = 32640
  23.  
  24. cursor = LoadCursor(0,IDC_IBEAM)
  25.  
  26. Repeat
  27.  
  28.         Select WaitEvent()
  29.  
  30.         Case $201 ;mouse down
  31.        
  32.                 SetCursor cursor
  33.        
  34.         Case $803 ; window close
  35.        
  36.                 quit = True
  37.        
  38.         End Select
  39.  
  40. Until quit = True
  41.  
  42. End


Comments :


Dabbede(Posted 1+ years ago)

 Wonderful!


Steve0(Posted 1+ years ago)

 Where can I get the "user32.dll"?


Binary_Moon(Posted 1+ years ago)

 <div class="quote"> Where can I get the "user32.dll"? </div>Erm... you're running windows yeah? Well its part of the operating system so you already have it. Just stick a text file with the lib information into the userlibs directory. Name it something like user32.decls and run the code.


thelizardking(Posted 1+ years ago)

 awsome


Andres(Posted 1+ years ago)

 Weird, as long as i held down mouse button my cursor wasn't displayed. Tryied even most of the cursors.


ShadowTurtle(Posted 1+ years ago)

 Adres: you must call "SetCursor" after and before "flip"


 

SimplePortal 2.3.6 © 2008-2014, SimplePortal