home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / S12659.ZIP / CLIENTMN.C < prev    next >
Text File  |  1989-01-06  |  2KB  |  61 lines

  1. /*
  2.  *  Graphics Exchange example OS/2 PM DDE Client program - Source Code
  3.  *
  4.  *  The Graphics Exchange client application serves as an application
  5.  *  which displays graphics representing the running server
  6.  *  applications.  Server applications may differ greatly in the
  7.  *  function provided, but they all use DDE to transfer their graphics
  8.  *  data to the client.  In our model, the client always establishes
  9.  *  a permanent data link with the server to receive updates as the
  10.  *  state of the server application warrants a change in the graphics'
  11.  *  appearance.  Both multiple clients and servers may be executed
  12.  *  simultaneously.
  13.  *
  14.  *  Note that the DDE techniques demonstrated in this program are a
  15.  *  simplification of the general specification and is provided for
  16.  *  tutorial purposes.  In ALL cases where you may observe
  17.  *  differences between these applications and the DDE
  18.  *  specification, please follow the published protocol.
  19.  *
  20.  *  Special thanks to Viktor Grabner, Tony Williams, Ed Fries, and
  21.  *  Tandy Trower for their help and support with OS/2 PM DDE.
  22.  */
  23.  
  24.  
  25. #include "os2.h"
  26. #include "st.h"
  27. #include "client.h"
  28.  
  29. /*
  30.  *  Graphics Exchange client main program & message processing loop
  31.  *
  32.  *  This main routine controls the Presentation Manager
  33.  *  initialization and termination as well as implementing the main
  34.  *  polling loop for the client application.
  35.  */
  36.  
  37. HAB  hab1;         /* Presentation Manager anchor block handle */
  38.  
  39. int cdecl main()
  40. {
  41.     QMSG qmsg;     /* input message structure definition       */
  42.     HMQ hmq;       /* message queue handle                     */
  43.     HWND hFrame;   /* frame window handle                      */
  44.  
  45.     hab1 = WinInitialize(NULL);
  46.  
  47.     hmq = WinCreateMsgQueue(hab1,0);
  48.  
  49.     if ((hFrame = ClientInit()) == 0)
  50.         return(FALSE);
  51.  
  52.     /* Poll messages from event queue */
  53.     while(WinGetMsg(hab1,(PQMSG)&qmsg,(HWND)NULL,0,0)){
  54.         WinDispatchMsg(hab1,(PQMSG)&qmsg);
  55.     }
  56.  
  57.     WinDestroyWindow(hFrame);
  58.     WinDestroyMsgQueue(hmq);
  59.     WinTerminate(hab1);
  60. }
  61.