1 /*---------------------------------------------------------------------------*
2 Project: HIO2 demos - multi
3 File: MainFrm.cpp
4
5 (C)2005 HUDSON SOFT
6
7 $Header: /home/cvsroot/SDK/build/demos/hio2demo/vc++/multi/MainFrm.cpp,v 1.3 2006/03/15 06:31:26 mitu Exp $
8
9 $NoKeywords: $
10 *---------------------------------------------------------------------------*/
11
12 // MainFrm.cpp : implementation of the CMainFrame class
13 //
14
15 #include "stdafx.h"
16 #include "multi.h"
17
18 #include "MainFrm.h"
19
20 #ifdef _DEBUG
21 #define new DEBUG_NEW
22 #endif
23
24
25 // CMainFrame
26
27 IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
28
29 BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
30 ON_WM_CREATE()
31 END_MESSAGE_MAP()
32
33 static UINT indicators[] =
34 {
35 ID_SEPARATOR, // status line indicator
36 ID_INDICATOR_CAPS,
37 ID_INDICATOR_NUM,
38 ID_INDICATOR_SCRL,
39 };
40
41
42 // CMainFrame construction/destruction
43
CMainFrame()44 CMainFrame::CMainFrame()
45 {
46 // TODO: add member initialization code here
47 }
48
~CMainFrame()49 CMainFrame::~CMainFrame()
50 {
51 }
52
53
OnCreate(LPCREATESTRUCT lpCreateStruct)54 int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
55 {
56 if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
57 return -1;
58
59 if (!m_wndStatusBar.Create(this) ||
60 !m_wndStatusBar.SetIndicators(indicators,
61 sizeof(indicators)/sizeof(UINT)))
62 {
63 TRACE0("Failed to create status bar\n");
64 return -1; // fail to create
65 }
66
67 ///////// for multiApp /////////
68 #ifdef PROTOCOL_USED
69 LPCSTR lpszProtocol = "protocol used";
70 #else // PROTOCOL_USED
71 LPCSTR lpszProtocol = "non protocol";
72 #endif // PROTOCOL_USED
73 CString cAppTitle, cTitle;
74 cAppTitle.LoadString(AFX_IDS_APP_TITLE);
75 cTitle.Format("HIO2 %s ( %s )",
76 (LPCSTR)cAppTitle, lpszProtocol);
77 SetWindowText((LPCSTR)cTitle);
78
79 return 0;
80 }
81
PreCreateWindow(CREATESTRUCT & cs)82 BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
83 {
84 ///////// for multiApp /////////
85 cs.style &= ~FWS_ADDTOTITLE;
86
87 if( !CMDIFrameWnd::PreCreateWindow(cs) )
88 return FALSE;
89 // TODO: Modify the Window class or styles here by modifying
90 // the CREATESTRUCT cs
91
92 return TRUE;
93 }
94
95
96 // CMainFrame diagnostics
97
98 #ifdef _DEBUG
AssertValid() const99 void CMainFrame::AssertValid() const
100 {
101 CMDIFrameWnd::AssertValid();
102 }
103
Dump(CDumpContext & dc) const104 void CMainFrame::Dump(CDumpContext& dc) const
105 {
106 CMDIFrameWnd::Dump(dc);
107 }
108
109 #endif //_DEBUG
110
111
112 // CMainFrame message handlers
113
114