Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing mouse pointer

Status
Not open for further replies.

arlequin

Programmer
Sep 21, 1999
232
UY
Hello, there!

I have to keep the user waiting just for a second while my application processes some DBFs...

And I don't want the user to start click here & there trying to find out if the app crashed or the PC is about to hang.

So, I want to set the pointer to HourGlass and then, after the processes finish, re-set the standard arrow-like mouse pointer.

I've found the
Code:
MousePointer
property which applies to, for example, a form. But I want to set the mouse pointer in an object-agnostic way, not depending on a form or combo or any other control.

Hope have been clear :)

Regards,

Arlequín
arlequin@montevideo.com.uy
 
Hi Arlequín

I'm afraid you cannot do what you want. Each control/object in VFP have MousePointer property, which means that you have to set for each control

There is an API to set pointer that applies to entire application but it will set back (by VFP object) according to its property.


-- AirCon --
 
arlequin

Why not just prevent the mouse to do anything until the operation if finished?
DECLARE INTEGER BlockInput IN user32 INTEGER fBlockIt
=blockinput(1) && Block the mouse
**Do stuff
=blockinput(0) && Unblock the mouse.



Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Couldn't you use the _screen like

_screen.MousePointer= 11

Mike Pastore

Hats off to (Roy) Harper
 
mpastore

It only change to screen. When you move the cursor to the form, it will change back according to the form.mousepointer

-- AirCon --
 
Right, I understand, maybe an API call?

Mike Pastore

Hats off to (Roy) Harper
 
Have you read my post above :-D
Ok, there are actually two ways from API call that can be use to set it.

1. only works for the current application (entire object in that application only). This cannot be use in VFP

2. apply to the whole system. This function actually works for Arlequin case.
Note: it will set the pointer not only for VFP, but for the whole system. This function also dangerous because it destroy the current system pointer and you can't get back to the default pointer unless you load it again from cursor file. Sorry, but I won't recommend this


-- AirCon --
 
Conclusion:

VFP does not give me an easy way to manage the mouse pointer.... :-(

Arlequín
arlequin@montevideo.com.uy
 
Sorry Arlequin, but how about Mike Gagnon suggestion ?
Or use SetAll() method ?

ThisForm.SetAll('MousePointer', 11, 'TextBox')
ThisForm.SetAll('MousePointer', 11, 'ComboBox')
** so on


-- AirCon --
 
Thanks guys.

The matter is I only want to put the HourGlass only for the scope of my app not for all the environment.



Arlequín
arlequin@montevideo.com.uy
 
What's the matter with doing something like:
Code:
*....... pauser.prg  .....
PUBLIC Pauseform

Pauseform = NEWOBJECT("pauser")
Pauseform.Show
 
RETURN

DEFINE CLASS pauser AS form
    Autocenter = .T.
    Height = 36
    Width = 300
    DoCreate = .T.
    Caption = "Doing something right now!!!"
    BackColor = RGB(128,128,128)
    Name = "pauser"

Add object pauser1 as label with ;
    AutoSize = .T., ;
    FontBold = .T., ;
    FontSize = 9, ;
    Caption = "One moment please....", ;
    Height = 79, ;
    Left = 20, ;
    Top = 10, ;
    Width = 200, ;
    Name = "pauser1", ;
    ForeColor = RGB(192,192,192), ;
    BackColor = RGB(0,0,64)

ENDDEFINE

Do some stuff here......

Then:

Pauseform.Release


-Dave S.-
[cheers]
Even more Fox stuff at:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top