Process Windows Messages during lengthy process 
Author Message
 Process Windows Messages during lengthy process

Hi,

Which is is easiest way to process windows messages while running a lengthy
process ?

I want to allow the user to:
(1) Minimize/ maximize main window ..
(2) Provide a cancel button to stop the process.

Do I have to use a seperate thread ?



Sun, 02 Feb 2003 03:00:00 GMT  
 Process Windows Messages during lengthy process

Greets,

    You don't necessarily need a separate thread to do this, although
ideally, another thread would make your interface a bit more responsive.
Instead, you can supply a function which can pump a few messages from the
message queue of the current thread.  (Using PeekMessage(),
TranslateMessage() (for accellerators) and DispatchMessage()).  Then, in
your lengthy process (for instance, if this is in a loop), call this
function to process some of the waiting messages.

Regards,

Joe


Quote:
> Hi,

> Which is is easiest way to process windows messages while running a
lengthy
> process ?

> I want to allow the user to:
> (1) Minimize/ maximize main window ..
> (2) Provide a cancel button to stop the process.

> Do I have to use a seperate thread ?



Sun, 02 Feb 2003 03:00:00 GMT  
 Process Windows Messages during lengthy process

Quote:

>I want to allow the user to:
>(1) Minimize/ maximize main window ..
>(2) Provide a cancel button to stop the process.

>Do I have to use a seperate thread ?

Not necessarily. I provide a reasoned discussion of your options,
ranging from the ridiculous to the sublime, here:

www.mooremvp.freeserve.co.uk/Win32/w32tip39.htm

--
Bob Moore [MVP]
http://www.mooremvp.freeserve.co.uk
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Due to an unreasonable amount of queries, I no
longer answer unsolicited email questions. Sorry,
no exceptions.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Sun, 02 Feb 2003 03:00:00 GMT  
 Process Windows Messages during lengthy process
Yes, you need to use a seperate thread.

David Kay


Quote:
> Hi,

> Which is is easiest way to process windows messages while running a
lengthy
> process ?

> I want to allow the user to:
> (1) Minimize/ maximize main window ..
> (2) Provide a cancel button to stop the process.

> Do I have to use a seperate thread ?



Sun, 02 Feb 2003 03:00:00 GMT  
 Process Windows Messages during lengthy process

Start your "a lengthy process" in another thread.

--
===================

===================

Quote:
> Hi,

> Which is is easiest way to process windows messages while running a
lengthy
> process ?

> I want to allow the user to:
> (1) Minimize/ maximize main window ..
> (2) Provide a cancel button to stop the process.

> Do I have to use a seperate thread ?



Mon, 03 Feb 2003 00:20:05 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Closing application during lengthy process

2. Windows.Forms.Message - processing a user defined Windows-message - 2nd try

3. Q: Force message queues to be processed during while loop

4. Valid way to process messages during intensive loop

5. Error during merge replication :- Error Message-The process could not bulk copy

6. What is the best way to perform lengthy processing in the background

7. How do I send a user message to a windows process

8. ON_COMMAND() message processing in child windows

9. How to process windows messages in C#?

10. how to insert my own message process function into message map

11. Appearance dialogbox-controls during lengthy job

12. Locking dialog during lengthy operation

 

 
Powered by phpBB® Forum Software