home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / c / WINCLASS.ZIP / TEST.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1991-05-28  |  1.5 KB  |  52 lines

  1. #include <windows.h>
  2. #include "swin.h"
  3. #include "dlgbase.h"
  4. #include "test.h"
  5. #include "testm.h"
  6.  
  7. #pragma argsused
  8. int PASCAL WinMain(HANDLE hInstance,HANDLE hPrevInstance,
  9.            LPSTR lpszCmdLine,int nCmdShow)
  10. {
  11.     StdWindow TheTestWindow("Test",        // Title to appear in window
  12.                             hInstance,     // This instance of "Test" program
  13.                             hPrevInstance, // Any prev instances of "Test"
  14.                             "AMENU",       // Our menu
  15.                             "TEST");       // Our icon
  16.  
  17.     return 0;
  18. }
  19.  
  20. #pragma argsused
  21. long FAR PASCAL _export StdWindow::WndProc(HWND hwnd,WORD message,WORD wParam,
  22.                                 LONG lParam)
  23. {
  24.     HANDLE hInstance; 
  25.  
  26.     switch(message)
  27.     {
  28.  
  29.     case WM_CREATE:
  30.         hInstance = ((LPCREATESTRUCT)lParam)->hInstance;
  31.         static TDlg Testdlg(hInstance, "aboutbox", hwnd); //MUST be static !
  32.         return 0;                           // Create dialog
  33.  
  34.     case WM_COMMAND:
  35.         switch(wParam)
  36.         {
  37.             case IDM_SILLY:
  38.                 MessageBox(hwnd,"Feature not implemented",NULL,
  39.                             MB_OK | MB_ICONQUESTION);
  40.                 return 0;
  41.  
  42.             case IDM_ABOUT:
  43.                 Testdlg.Show();             // Show it
  44.                 return 0;
  45.         }
  46.     case WM_DESTROY:
  47.         PostQuitMessage(0);
  48.         return 0;
  49.     }
  50.     return DefWindowProc(hwnd,message,wParam, lParam);
  51. }
  52.