Solved

OnIdle() doesn't work

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Host to IP 7 80
fizzArray  challenge 1 95
twoTwo  challenge 35 107
Making an alias 7 101
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: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.

839 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