Solved

OnIdle() doesn't work

Posted on 1998-02-20
3
412 Views
Last Modified: 2013-11-20
I've a problem with the CApp::OnIdle()-routine:

In my SDI-App I installed an OnIdle() that works perfectly. Now I want to show a fullscreen-animation after a button is pushed and I want to use the OnIdle -routine to check for updating the (full) screen (20Hz or so). Therefore I create a new Wnd (with WS_POPUP|WS_MAXIMIZE|WS_VISIBLE style and all the stuff) and draw a bitmap to it. That's ok. But from then on my OnIdle() won't be called unless I move the mouse or press a key. As far as I found out this behaviour depends on the size of the created Wnd. If the mouse isn't in the client-area of the new Wnd during the creation, OnIdle is called. But only as long as I don't move the mouse(!) (no matter if inside or outside the new Wnd). Keypressing is ok.

Has anyone an idea of how to work around that?

Thanks
Elrond
0
Comment
Question by:elrond
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 100 total points
ID: 1316440
OnIdle will only be called while you return TRUE.

The other possibility would be to create a timer and use WM_TIMER to do your animation.


0
 

Author Comment

by:elrond
ID: 1316441
Excellent! I returned CWinApp::OnIdle(lCount)
as suggested by the class-wizzard. (Another example of "You better don't rely on things like class-wizzard if you haven't coded the stuff by hand yet and know exactly what's going on".)

Thanks
elrond


0
 

Author Comment

by:elrond
ID: 1316442
Excellent! I returned CWinApp::OnIdle(lCount)
as suggested by the class-wizzard. (Another example of "You better don't rely on things like class-wizzard if you haven't coded the stuff by hand yet and know exactly what's going on".)
btw OnTimer is too slow for animations....

Thanks
elrond


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
notReplace  challenge 53 116
only14 challenge 19 68
twoTwo  challenge 35 93
abstract class with all non abstract mentods 6 76
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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 Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
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.

910 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

22 Experts available now in Live!

Get 1:1 Help Now