home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / S12315.ZIP / HELLO.C < prev    next >
C/C++ Source or Header  |  1988-11-10  |  1KB  |  58 lines

  1. #define INCL_PM
  2.  
  3. #include <os2.h>
  4. #include "stdio.h"
  5. #include <stddef.h>
  6. #include "hello.h"
  7.  
  8.  
  9. HAB     hAB;
  10. HMQ     hmqHello;
  11. HWND    hwndHello;
  12. HWND    hwndHelloFrame;
  13.  
  14. CHAR    szClassName[] = "Hello";
  15. CHAR    szScrollClass[] = "scroller";
  16. CHAR    szMessage[]   = "Hello World";
  17.  
  18. int     nFontHeight,nFontWidth;
  19.  
  20.  
  21. int cdecl main( )
  22. {
  23.     QMSG qmsg;
  24.     ULONG ctldata;
  25.  
  26.     hAB = WinInitialize(NULL);
  27.  
  28.     hmqHello = WinCreateMsgQueue(hAB, 0);
  29.  
  30.     if (!WinRegisterClass( hAB,(PCH)szClassName,(PFNWP)HelloWndProc,
  31.                CS_SYNCPAINT | CS_SIZEREDRAW,
  32.                            0))
  33.         return( 0 );
  34.  
  35.     ctldata = FCF_STANDARD & ~FCF_ACCELTABLE;
  36.  
  37.     hwndHelloFrame = WinCreateStdWindow( HWND_DESKTOP,
  38.                      WS_VISIBLE  | FS_ICON,
  39.                      &ctldata,
  40.                                          (PCH)szClassName,
  41.                                          (PCH)szMessage,
  42.                                          0L,
  43.                                          (HMODULE)NULL,
  44.                                          ID_HELLO,
  45.                                          (HWND FAR *)&hwndHello );
  46.  
  47.     WinShowWindow( hwndHelloFrame, TRUE );
  48.  
  49.     while( WinGetMsg( hAB, (PQMSG)&qmsg, (HWND)NULL, 0, 0 ) )
  50.     {
  51.         WinDispatchMsg( hAB, (PQMSG)&qmsg );
  52.     }
  53.  
  54.     WinDestroyWindow( hwndHelloFrame );
  55.     WinDestroyMsgQueue( hmqHello );
  56.     WinTerminate( hAB );
  57. }
  58.