Solved

WaitCursor, display over function scope

Posted on 1998-09-30
3
189 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Decoding 32 bit binary streams 6 31
matchUp  challenge 6 48
modThree challenge 4 64
sumHeights2  challenge 7 78
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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

744 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

13 Experts available now in Live!

Get 1:1 Help Now