home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / msysjour / vol04 / 01b / macsl / mpmfig1.txt < prev    next >
Text File  |  1988-10-27  |  3KB  |  102 lines

  1. HMQ APIENTRY WinCreateMsgQueue( hab, sSize )
  2.     HAB         hab;
  3.     SHORT       sSize;
  4. {
  5.     PMYWND      pwnd;
  6.  
  7.     /* Generic Macintosh initialization (already did memory stuff) */
  8.     
  9.     InitGraf( &thePort );
  10.     InitFonts();
  11.     FlushEvents( everyEvent, 0 );
  12.     SetEventMask( everyEvent );
  13.     InitWindows();
  14.     InitMenus();
  15.     TEInit();
  16.     InitDialogs( 0L );
  17.     InitCursor();
  18.  
  19.     /* Initialize the SV_ values and register the predefined
  20.        window classes */
  21.  
  22.     MpmInitSysValues();
  23.  
  24.     if( ! WinRegisterClass( hab, WC_BUTTON, MpmFnwpButton,
  25.                             CS_MOVENOTIFY | CS_PUBLIC, 0 ) )
  26.       return NULL;
  27.  
  28.     if( ! WinRegisterClass( hab, WC_DESKTOP, MpmFnwpDesktop,
  29.                             CS_PUBLIC, 0 ) )
  30.       return NULL;
  31.  
  32. #ifdef FUTURE
  33.     if( ! WinRegisterClass( hab, WC_DIALOG, MpmFnwpDialog,
  34.                             CS_MOVENOTIFY | CS_PUBLIC, 0 ) )
  35.       return NULL;
  36. #endif
  37.  
  38.     if( ! WinRegisterClass( hab, WC_ENTRYFIELD, MpmFnwpEntryField,
  39.                             CS_MOVENOTIFY | CS_PUBLIC, 0 ) )
  40.       return NULL;
  41.  
  42.     if( ! WinRegisterClass( hab, WC_FRAME, MpmFnwpFrame,
  43.                             CS_MOVENOTIFY | CS_PUBLIC, 0x20 /*??*/ ) )
  44.       return NULL;
  45.  
  46.     if( ! WinRegisterClass( hab, WC_LISTBOX, MpmFnwpListBox,
  47.                             CS_MOVENOTIFY | CS_PUBLIC, 0 ) )
  48.       return NULL;
  49.  
  50.     if( ! WinRegisterClass( hab, WC_MENU, MpmFnwpMenu,
  51.                             CS_MOVENOTIFY | CS_PUBLIC, 0 ) )
  52.       return NULL;
  53.  
  54.     if( ! WinRegisterClass( hab, WC_SCROLLBAR, MpmFnwpScrollBar,
  55.                             CS_MOVENOTIFY | CS_PUBLIC, 0 ) )
  56.       return NULL;
  57.  
  58.     if( ! WinRegisterClass( hab, WC_SIZEBORDER, MpmFnwpSizeBorder,
  59.                             CS_MOVENOTIFY | CS_PUBLIC, 0 ) )
  60.       return NULL;
  61.  
  62.     if( ! WinRegisterClass( hab, WC_STATIC, MpmFnwpStatic,
  63.                             CS_MOVENOTIFY | CS_PUBLIC, 0 ) )
  64.       return NULL;
  65.  
  66.     if( ! WinRegisterClass( hab, WC_TITLEBAR, MpmFnwpTitleBar,
  67.                             CS_MOVENOTIFY | CS_PUBLIC, 0 ) )
  68.       return NULL;
  69.  
  70.     /* Create the object and desktop windows */
  71.  
  72.     _hwndObject =
  73.       WinCreateWindow(
  74.         NULL, WC_DESKTOP, _szNull,
  75.         0, 0, 0, 0, 0,
  76.         NULL, NULL, 0, NULL, NULL
  77.       );
  78.     if( ! _hwndObject )
  79.       return NULL;
  80.  
  81.     pwnd = PMYWNDOF(_hwndObject);
  82.     pwnd->ucKind = WK_OBJECT;
  83.     pwnd->pfnwp  = MpmFnwpObject;
  84.  
  85.     _hwndDesktop =
  86.       WinCreateWindow(
  87.         NULL, WC_DESKTOP, _szNull,
  88.         WS_DISABLED,
  89.         0, 0, 0, 0,
  90.         NULL, NULL, 0, NULL, NULL
  91.       );
  92.     if( ! _hwndDesktop )
  93.       return NULL;
  94.  
  95.     pwnd = PMYWNDOF(_hwndDesktop);
  96.     pwnd->cx = _alSysVal[SV_CXSCREEN];
  97.     pwnd->cy = _alSysVal[SV_CYSCREEN];
  98.     pwnd->flStyle |= WS_VISIBLE;
  99.  
  100.     return (HMQ)1;
  101. }
  102.