Newsgroups: comp.windows.ms.programmer
Path: funic!news.funet.fi!sunic!psinntp!psinntp!rpi!usenet.coe.montana.edu!saimiri.primate.wisc.edu!hp9000.csc.cuhk.hk!cucs5.cs.cuhk.hk!hclam
From: hclam@cuse1.se.cuhk.hk (LAM Ho Cheong)
Subject: Let the System Process Input Messages 
Message-ID: <1993Jan24.034245.17565@cucs5.cs.cuhk.hk>
Sender: news@cucs5.cs.cuhk.hk
Organization: Faculty of Engineering, The Chinese U. of Hong Kong
Date: Sun, 24 Jan 1993 03:42:45 GMT
Lines: 33

   I'm writing a demonstration program on Windows.  I incur a problem
   in allowing users to choose a menu item, say 'pause', while the
   program is showing a demonstration.

   It's because when the system executes my Demonstrate (), the
   system is no longer able to process any input message.  As MS 
   windows isn't really multi-tasking, I have to find a way to add
   something to my Demonstrate (), which will handle the input on my
   own or return the control to the system to process the input for
   some time.  But I don't know how to achieve this.

   WndMainProc (...)
   {
      case IDM_Demonstrate:
         Demonstrate(); -----------------> void Demonstration()
         break;         <-------+          {
                                |             ...
      case IDM_Pause:           |             /* The control is here, in
         ...                    |                this function.  So, the  
   }                            |                system is unable to
                                |                process further input
                                |                until this function
                                |                returns. */
                                +--------- }

   So, how can I change my program so that the users can 'pause' the 
   demonstration?

   Could anyone kindly send me any advice via hclam@se.cuhk.hk?

   Thanks in advance!

HC
