A SERVICE OF

logo

Y u can use the SetMainWindow function to change your main windowo
Changing the main
during the course of your application. SetMainWindow takes one parameter,
window
a TFrameWindow *, and returns a pointer to the old main window (if this is
a new application that hasn’t yet set up a main window the return value is,
0). Y u can use this pointer to keep the old main window in case you wanto
to restore it. Alternatively you can use this pointer to delete the old main,
window object.
Application message handling
Once your application is initialized, the application object’ MessageLoops
starts running. MessageLoop is responsible for processing incoming
messages from Windows. There are two ways you can refine message
processing in an ObjectWindows application:
Extra message processing, by overriding default message handling
functions
Idle processing
T pplication has member functions that provide the message-handlingA
Extra message
functionality for any ObjectWindows application. These functions are
processing
MessageLoop, IdleAction, P eP ocessMenu, and P ocessAppMsg. See ther r r
ObjectWindows Reference Guide for more information.
Idle processing lets your application take advantage of the idle time when
Idle processing
there are no messages waiting (including user input). If there are no
waiting messages, MessageLoop calls IdleAction.
T perform idle processing, override IdleAction to perform the actual idleo
processing. Remember that idle processing takes place while the user isn’t
doing anything. Therefore, idle processing should be short-lasting. If you
need to do anything that takes longer than a few tenths of a second, you
should split it up into several processes.
IdleAction’ parameter (idleCount) is a
long specifying the number of timess
IdleAction was called between messages. Y u can use idleCount to chooseo
between low-priority and high-priority idle processing. If idleCount reaches
a high value, you know that a long period without user input has passed,
so it’ safe to perform low-priority idle processing.s
Return TRUE from IdleAction to call IdleAction back sooner.
Chapter 3, Application objects
127