Bill,

Try this -

===================== start example ==================

' All possible Windows cursor constants
' Example uses only "Wait" cursor

' define IDC_APPSTARTING 32650
' define IDC_ARROW 32512      
' define IDC_CROSS 32515      
' define IDC_IBEAM 32513      
' define IDC_ICON 32641       
' define IDC_NO 32648         
' define IDC_SIZE 32640       
' define IDC_SIZEALL 32646    
' define IDC_SIZENESW 32643   
' define IDC_SIZENS 32645     
' define IDC_SIZENWSE 32642   
' define IDC_SIZEWE 32644     
' define IDC_UPARROW 32516    
define IDC_WAIT 32514

Declare Function SetCursor Lib "user32.dll" 
  (ByVal hCursor As Integer) As Integer
Declare Function LoadCursor Lib "user32.dll" Alias "LoadCursorA" 
  (ByVal hInstance As Integer, ByVal lpCursorName As Integer) As Integer
Declare Sub Sleep Lib "kernel32.dll" 
  (ByVal dwMilliseconds As Integer)

Declare Sub Main 

Sub Main

  Dim hcursor As Integer     ' receives handle to wait cursor
  Dim holdcursor As Integer  ' receives handle to previously used cursor
  Dim retval As Integer      ' throw-away return value

  Note ("Cursor changes for 3 sec. to wait and then reverts")

  hcursor = LoadCursor(0, IDC_WAIT) ' load Windows's wait cursor
  holdcursor = SetCursor(hcursor)   ' set cursor to "wait" cursor
  Call Sleep (3000)                 ' wait for 3 seconds
  retval = SetCursor(holdcursor)    ' set cursor to original cursor

End Sub
===================== end example ==================


Regards

Bo Thomsen
GeoConsult I/S
Denmark

-----Oprindelig meddelelse-----
Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] På vegne af Bill Thoen
Sendt: 2. august 2006 17:24
Til: [email protected]
Emne: [MI-L] Setting Hourglass Cursor in MapBasic

I'm working on a MapBasic/Access hybrid application that uses DDE to
communicate between the applications. A key element in the design is that
MapInfo is not directly linked to any Access tables, but because of this
independence sometimes when a process is started in Access (e.g. display
some data in a form) it takes more than a few seconds to complete.
Meanwhile, the user is looking at a MapInfo interface wondering what, if
anything, is happening since he clicked on the map feature or menu to
display some informaiton in a dialog form.

So I need some way to alert the user that the process is actually working
in the background and to just sit tight until the expected result
happens. Typically you do this by changing the cursor to an hourglass and
disabling cursor clicks. Does anyone know a way to do this in MapBaisc?
Is this a job for Windows API functions or is there a simpler way?

TIA,

- Bill Thoen

_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l




_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l

Reply via email to