Solved

WaitCursor, display over function scope

Posted on 1998-09-30
3
193 Views
Last Modified: 2013-11-20
Hi all!

I have a function that startups a Waitcursor. After this
I use a Timer to check when a Smartcard is removed from
its reader. Of course, the Waitcursor disappears when the
first function goes out of scope.

I would like the Waitcursor to hold its Waitstate until
the timer function tells it to go back to its normal state.

I've had a look at DoWaitCursor and BeginWaitCursor EndWaitCursor functions but the Cursor still resumes its
normal pointer state when the first function goes out of scope.

Any ideas?

// Anders
0
Comment
Question by:Kalle 2
3 Comments
 
LVL 3

Accepted Solution

by:
plaroche earned 100 total points
ID: 1322739
You can try with OnSetCursor, it is called when the mouse moves over your window, or everytime if you captured the mouse cursor.

In that call check for a boolean value which your timer function will reset to FALSE.  In your timer function you might force a call to OnSetCursor since the user may not force a call to the function if he doesn't move the mouse.

The cursor comes back to normal in your case because of OnSetCursor, which resets it to normal state.
0
 
LVL 7

Expert Comment

by:psdavis
ID: 1322740
Have you considered creating the CWaitCursor on the heap?

Try this, add a CWaitCursor pointer to your header file like

CWaitCursor* m_pWaitCursor;

Now inside of your .cpp file, start the cursor with

m_pWaitCursor = new CWaitCursor;

and delete it when you're done!

delete m_pWaitCursor;
m_pWaitCursor = NULL;

Hope this works!

Phillip
0
 

Author Comment

by:Kalle 2
ID: 1322741
Ok, worked like a treat!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Tab names are off by one 5 53
How to determine file rename from EventLog ? 2 42
method notes when mouse over in eclipse 5 83
Line meaning 9 82
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now