Solved

OnIdle() doesn't work

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
deburging in oracle form 12 112
sumNumber challenge 16 140
fix34  challenge 9 166
Updating statistics with error notification email in SQL server 4 120
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

733 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