home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / prog_pm / chap02 / welcom.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-01-09  |  1.6 KB  |  44 lines

  1. /*------------------------------------------------
  2.    WELCOM.C -- A Program that has a Standard Icon
  3.   ------------------------------------------------*/
  4.  
  5. #define INCL_WIN
  6. #include <os2.h>
  7.  
  8. int main (void)
  9.      {
  10.      static ULONG flFrameFlags = FCF_TITLEBAR      | FCF_SYSMENU |
  11.                                  FCF_SIZEBORDER    | FCF_MINMAX  |
  12.                                  FCF_SHELLPOSITION | FCF_TASKLIST ;
  13.      HAB          hab ;
  14.      HMQ          hmq ;
  15.      HWND         hwndFrame ;
  16.      QMSG         qmsg ;
  17.  
  18.      hab = WinInitialize (0) ;
  19.      hmq = WinCreateMsgQueue (hab, 0) ;
  20.  
  21.      hwndFrame = WinCreateStdWindow (
  22.                     HWND_DESKTOP,       // Parent window handle
  23.                     WS_VISIBLE,         // Style of frame window
  24.                     &flFrameFlags,      // Pointer to control data
  25.                     NULL,               // Client window class name
  26.                     NULL,               // Title bar text
  27.                     0L,                 // Style of client window
  28.                     NULL,               // Module handle for resources
  29.                     0,                  // ID of resources
  30.                     NULL) ;             // Pointer to client window handle
  31.  
  32.      WinSendMsg (hwndFrame, WM_SETICON,
  33.                  WinQuerySysPointer (HWND_DESKTOP, SPTR_APPICON, FALSE),
  34.                  NULL) ;
  35.  
  36.      while (WinGetMsg (hab, &qmsg, NULL, 0, 0))
  37.           WinDispatchMsg (hab, &qmsg) ;
  38.  
  39.      WinDestroyWindow (hwndFrame) ;
  40.      WinDestroyMsgQueue (hmq) ;
  41.      WinTerminate (hab) ;
  42.      return 0 ;
  43.      }
  44.