| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- // IMTDEMO.cpp : implementation for the IMTDemo application
- //
- #include "stdafx.h"
- #include "IMTDemo.h"
- #include "MainFrm.h"
- // CIMTDemoApp
- BEGIN_MESSAGE_MAP(CIMTDemoApp, CWinApp)
- END_MESSAGE_MAP()
- // CIMTDemoApp constructor
- CIMTDemoApp::CIMTDemoApp()
- : m_Mutex( FALSE, _T( "IMTDemoApp" ) ),
- m_block( FALSE )
- {
- }
- CIMTDemoApp::~CIMTDemoApp()
- {
- if ( m_block )
- m_Mutex.Unlock();
- }
- // the only CIMTDemoApp object instance
- CIMTDemoApp theApp;
- // initialization of CIMTDemoApp
- BOOL CIMTDemoApp::InitInstance()
- {
- if ( !( m_block = m_Mutex.Lock( 0 ) ) )
- return FALSE;
- InitCommonControls();
- CWinApp::InitInstance();
- // Create main window
- RECT m_winArea;
- m_winArea.left = 20;
- m_winArea.top = 20;
- m_winArea.right = 788;
- m_winArea.bottom = 596;
- CMainFrame* pFrame = new CMainFrame;
- pFrame->SetRect( m_winArea );
- pFrame->LoadFrame(IDR_MAINFRAME, WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL, NULL);
- if ( !pFrame->GetSafeHwnd() )
- {
- return FALSE;
- }
- m_pMainWnd = pFrame;
- CCommandLineInfo cmdInfo;
- ParseCommandLine(cmdInfo);
- if (!ProcessShellCommand(cmdInfo))
- return FALSE;
- m_pMainWnd->MoveWindow( &m_winArea );
- m_pMainWnd->SetWindowText(_T( "IMT Demo" ));
- m_pMainWnd->UpdateWindow();
- return TRUE;
- }
|