Solved

OnIdle() doesn't work

Posted on 1998-02-20
3
411 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

760 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

19 Experts available now in Live!

Get 1:1 Help Now