Solved

WaitCursor, display over function scope

Posted on 1998-09-30
3
198 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

622 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