// MainFrm.cpp : implementation of the CMainFrame class // #include "stdafx.h" #include "GetStamp.h" #include "MainFrm.h" #include "GetStpVw.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CMainFrame IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd) BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd) //{{AFX_MSG_MAP(CMainFrame) ON_WM_CREATE() ON_WM_PALETTECHANGED() ON_WM_QUERYNEWPALETTE() ON_WM_SYSCOLORCHANGE() ON_WM_PALETTEISCHANGING() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CMainFrame construction/destruction CMainFrame::CMainFrame() { LBase::LoadLibraries (LT_ALL_LEADLIB); WRPUNLOCKSUPPORT(); LDialogBase::Initialize(DLG_INIT_COLOR); } CMainFrame::~CMainFrame() { LDialogBase::Free(); LBase::UnloadLibraries (LT_ALL_LEADLIB); } BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) { cs.style = WS_CAPTION | WS_OVERLAPPEDWINDOW; cs.lpszName = _T("LEAD Class Library Sample Application Win32"); if( !CFrameWnd::PreCreateWindow(cs) ) return FALSE; // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs return TRUE; } ///////////////////////////////////////////////////////////////////////////// // CMainFrame diagnostics #ifdef _DEBUG void CMainFrame::AssertValid() const { CFrameWnd::AssertValid(); } void CMainFrame::Dump(CDumpContext& dc) const { CFrameWnd::Dump(dc); } #endif //_DEBUG ///////////////////////////////////////////////////////////////////////////// // CMainFrame message handlers int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; // TODO: Add your specialized creation code here return 0; } void CMainFrame::OnPaletteChanged(CWnd* pFocusWnd) { CFrameWnd::OnPaletteChanged(pFocusWnd); // TODO: Add your message handler code here CGetStampView* pCView; pCView = (CGetStampView*) GetActiveView(); if(pCView) pCView->m_LBitmapWnd.HandlePalette(WM_PALETTECHANGED, (L_INT32)pFocusWnd->m_hWnd, 0); } BOOL CMainFrame::OnQueryNewPalette() { // TODO: Add your message handler code here and/or call default CGetStampView* pCView; pCView = (CGetStampView*) GetActiveView(); if(pCView) pCView->m_LBitmapWnd.HandlePalette(WM_QUERYNEWPALETTE, 0, 0); return CFrameWnd::OnQueryNewPalette(); } void CMainFrame::OnSysColorChange() { OnQueryNewPalette(); } void CMainFrame::OnPaletteIsChanging(CWnd* pRealizeWnd) { OnPaletteChanged (pRealizeWnd); }