views:

1428

answers:

4

Windows Mobile pops up a "busy wheel" - a rotating colour disk - when things are happening . I can't find in the documentation how this is done - can someone point me in the right direction?

We have a situation where we need to prompt the user to say we're doing stuff for a while, but we don't know how long it will take. So we can't do a progress bar, hence the proposal to use this busy wheel.

+2  A: 

I'm just guessing here, but I'd imagine it is CWaitCursor. Basically, you just create one on the stack, it appears, and disapppears when it is destructed as it goes out of scope e.g.

void DoSomethingSlow()
{
  CWaitCursor cw;
.
.
.
.
}
Shane MacLaughlin
This is true only if you're using MFC
ctacke
@ctacke: ...and WTL!
Johann Gerell
+5  A: 

Use SetCursor/LoadCursor/ShowCursor APIs, like this:

SetCursor(LoadCursor(NULL, IDC_WAIT));

// my code

ShowCursor(FALSE);
ctacke
+1  A: 

Using compactframework.

Spining wheel:

System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;

Return to normal:

System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;

mliesen
Note the poster's tag is C++, so the managed Cursor class does him no good.
ctacke
A: 

From: http://mobiledeveloper.wordpress.com/2006/07/05/wait-cursor/

Have a look at Cursor.Current = Cursors.WaitCursor;

try {
 Cursor.Current = Cursors.WaitCursor;
 //Do something time consuming…
}
finally {
 Cursor.Current = Cursors.Default;
}
Mat Nadrofsky
The poster is looking for a C++ solution, not a managed solution
ctacke