home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 23 / IOPROG_23.ISO / SOFT / MSGTRACE.ZIP / MyProjects / MsgTrace / MsgTracer / MainFrm.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-05-30  |  3.5 KB  |  143 lines

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // File        : MainFrm.cpp
  4. // Project     : MsgTrace
  5. // Component   : MsgTracer
  6. //---------------------------------------------------------------------------
  7. // Description : main-frame-window
  8. //
  9. /////////////////////////////////////////////////////////////////////////////
  10. //
  11. // SourceSafe Strings. Do not change.
  12. //---------------------------------------------------------------------------
  13. // $Author: jeskes $
  14. // $Date: $
  15. // $Revision: $
  16. //
  17. /////////////////////////////////////////////////////////////////////////////
  18.  
  19. #include "stdafx.h"
  20. #include "MsgTracerApp.h"
  21.  
  22. #include "MainFrm.h"
  23.  
  24. #ifdef _DEBUG
  25. #define new DEBUG_NEW
  26. #undef THIS_FILE
  27. static char THIS_FILE[] = __FILE__;
  28. #endif
  29.  
  30. /////////////////////////////////////////////////////////////////////////////
  31. // CMainFrame
  32. /////////////////////////////////////////////////////////////////////////////
  33.  
  34. IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
  35.  
  36. BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
  37.     //{{AFX_MSG_MAP(CMainFrame)
  38.     ON_WM_CREATE()
  39.     ON_WM_CLOSE()
  40.     //}}AFX_MSG_MAP
  41. END_MESSAGE_MAP()
  42.  
  43. static UINT indicators[] =
  44. {
  45.     ID_SEPARATOR,           // status line indicator
  46.     ID_INDICATOR_PROCESS,
  47.     ID_INDICATOR_RUNNING,
  48. };
  49.  
  50. /////////////////////////////////////////////////////////////////////////////
  51. // CMainFrame: construction
  52. /////////////////////////////////////////////////////////////////////////////
  53.  
  54. CMainFrame::CMainFrame()
  55. {
  56. }
  57.  
  58. /////////////////////////////////////////////////////////////////////////////
  59.  
  60. CMainFrame::~CMainFrame()
  61. {
  62. }
  63.  
  64. /////////////////////////////////////////////////////////////////////////////
  65.  
  66. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  67. {
  68.     if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
  69.         return -1;
  70.     
  71.     DWORD dwCoolBarStyles = WS_CHILD |
  72.                             WS_VISIBLE |
  73.                             WS_BORDER |
  74.                             WS_CLIPSIBLINGS |
  75.                             WS_CLIPCHILDREN |
  76.                             RBS_TOOLTIPS |
  77.                             RBS_BANDBORDERS |
  78.                             RBS_VARHEIGHT;
  79.  
  80.     if( !m_wndCoolBar.Create( this, dwCoolBarStyles ) ) 
  81.     {
  82.         TRACE0("Failed to create cool bar\n");
  83.         return( -1 );
  84.     }
  85.  
  86.  
  87.     if (!m_wndStatusBar.Create(this) ||
  88.         !m_wndStatusBar.SetIndicators(indicators,
  89.           sizeof(indicators)/sizeof(UINT)))
  90.     {
  91.         TRACE0("Failed to create status bar\n");
  92.         return -1;      // fail to create
  93.     }
  94.  
  95.     return( 0 );
  96. }
  97.  
  98. /////////////////////////////////////////////////////////////////////////////
  99.  
  100. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
  101. {
  102.     return( CFrameWnd::PreCreateWindow( cs ) );
  103. }
  104.  
  105. /////////////////////////////////////////////////////////////////////////////
  106.  
  107. void CMainFrame::OnUpdateFrameTitle( BOOL bAddToTitle )
  108. {
  109.     CFrameWnd::OnUpdateFrameTitle( FALSE );
  110. }
  111.  
  112. /////////////////////////////////////////////////////////////////////////////
  113. // CMainFrame: diagnostics
  114. /////////////////////////////////////////////////////////////////////////////
  115.  
  116. #ifdef _DEBUG
  117. void CMainFrame::AssertValid() const
  118. {
  119.     CFrameWnd::AssertValid();
  120. }
  121.  
  122. /////////////////////////////////////////////////////////////////////////////
  123.  
  124. void CMainFrame::Dump(CDumpContext& dc) const
  125. {
  126.     CFrameWnd::Dump(dc);
  127. }
  128.  
  129. #endif //_DEBUG
  130.  
  131. /////////////////////////////////////////////////////////////////////////////
  132. // CMainFrame message handlers
  133. /////////////////////////////////////////////////////////////////////////////
  134.  
  135. void CMainFrame::OnClose() 
  136. {
  137.     if( AfxOleCanExitApp() ||
  138.         ( IDYES == AfxMessageBox( IDS_CANNOT_CLOSE, MB_YESNO|MB_ICONQUESTION ) ) )
  139.     {
  140.         CFrameWnd::OnClose();
  141.     }
  142. }
  143.