home *** CD-ROM | disk | FTP | other *** search
/ Windows Graphics Programming / Feng_Yuan_Win32_GDI_DirectX.iso / Samples / Chapt_05 / FrameWindow / FrameTest.cpp next >
Encoding:
C/C++ Source or Header  |  2000-05-11  |  2.1 KB  |  57 lines

  1. //-----------------------------------------------------------------------------------//
  2. //              Windows Graphics Programming: Win32 GDI and DirectDraw               //
  3. //                             ISBN  0-13-086985-6                                   //
  4. //                                                                                   //
  5. //  Written            by  Yuan, Feng                             www.fengyuan.com   //
  6. //  Copyright (c) 2000 by  Hewlett-Packard Company                www.hp.com         //
  7. //  Published          by  Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com      //
  8. //                                                                                   //
  9. //  FileName   : frametest.cpp                                                         //
  10. //  Description: SDI frame window demo, Chapter 5                                    //
  11. //  Version    : 1.00.000, May 31, 2000                                              //
  12. //-----------------------------------------------------------------------------------//
  13.  
  14. #define STRICT
  15. #define WIN32_LEAN_AND_MEAN
  16.  
  17. #include <windows.h>
  18. #include <assert.h>
  19. #include <tchar.h>
  20.  
  21. #include "..\..\include\win.h"
  22. #include "..\..\include\Toolbar.h"
  23. #include "..\..\include\Canvas.h"
  24. #include "..\..\include\Status.h"
  25. #include "..\..\include\FrameWnd.h"
  26.  
  27. #include "Resource.h"
  28.  
  29.  
  30. const TBBUTTON tbButtons[] =
  31. {
  32.     { STD_FILENEW,     IDM_FILE_NEW,   TBSTATE_ENABLED, TBSTYLE_BUTTON, { 0, 0 }, IDS_FILENEW,   0 },
  33.     { STD_HELP,      IDM_APP_ABOUT,  TBSTATE_ENABLED, TBSTYLE_BUTTON, { 0, 0 }, IDS_HELPABOUT, 0 }
  34. };
  35.  
  36.  
  37. int WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR lpCmd, int nShow)
  38. {
  39.     KToolbar       toolbar;
  40.     KCanvas        canvas;
  41.     KStatusWindow  status;
  42.  
  43.     KFrame frame(hInst, tbButtons, 2, & toolbar, & canvas, & status);
  44.  
  45.     frame.CreateEx(0, _T("ClassName"), _T("Program Name"),
  46.                  WS_OVERLAPPEDWINDOW,
  47.                  CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 
  48.                  NULL, LoadMenu(hInst, MAKEINTRESOURCE(IDR_MAIN)), hInst);
  49.  
  50.     frame.ShowWindow(nShow);
  51.     frame.UpdateWindow();
  52.  
  53.     frame.MessageLoop();
  54.  
  55.     return 0;
  56. }
  57.