www.pudn.com > DiskInfo.tgz > MainFrm.cpp


// MainFrm.cpp : implementation of the CMainFrame class 
// 
 
#include "stdafx.h" 
#include "DiskInfo.h" 
 
#include "MainFrm.h" 
#include "Common/Useful.h" 
 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CMainFrame 
 
IMPLEMENT_DYNAMIC(CMainFrame, CFrameWnd) 
 
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd) 
	//{{AFX_MSG_MAP(CMainFrame) 
	ON_WM_CREATE() 
	ON_WM_SETFOCUS() 
	ON_WM_CLOSE() 
	ON_WM_SIZE() 
	ON_WM_PAINT() 
	ON_WM_GETMINMAXINFO() 
	//}}AFX_MSG_MAP 
	ON_MESSAGE(WM_OUTBAR_NOTIFY, OnOutbarNotify) 
	ON_MESSAGE(WM_FOLDER_RESELECTED, UpdateBarStatus) 
	/*ON_COMMAND(ID_SINGLE_VIEW, OnSingleView) 
	ON_UPDATE_COMMAND_UI(ID_SINGLE_VIEW, OnUpdateSingleView) 
	ON_COMMAND(ID_TWO_VIEW_HOR, OnTwoViewHor) 
	ON_UPDATE_COMMAND_UI(ID_TWO_VIEW_HOR, OnUpdateTwoViewHor) 
	ON_COMMAND(ID_TWO_VIEW_VER, OnTwoViewVer) 
	ON_UPDATE_COMMAND_UI(ID_TWO_VIEW_VER, OnUpdateTwoViewVer)*/ 
	ON_MESSAGE(WM_USER_SCANPROGRESS, OnScanProgressNotify)	 
END_MESSAGE_MAP() 
 
static UINT indicators[] = 
{ 
	ID_SEPARATOR,           // status line indicator 
	//ID_INDICATOR_SCRL, 
}; 
 
///////////////////////////////////////////////////////////////////////////// 
// CMainFrame construction/destruction 
 
CMainFrame::CMainFrame() 
{ 
	// TODO: add member initialization code here 
	//m_nViewType = 0; // 0=Single view, 1=Double hor 2=Double ver 
} 
 
CMainFrame::~CMainFrame() 
{ 
} 
 
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{ 
	if (CFrameWnd::OnCreate(lpCreateStruct) == -1) 
		return -1; 
 
	if (!m_wndSplitterVer.CreateStatic(this, 1, 2)) return false; 
 
	//if (!m_wndSplitter.CreateView(0, 1, pContext->m_pNewViewClass, CSize(0,0), pContext)) return false; 
	 
	DWORD dwf = CGfxOutBarCtrl::fRemoveItems|CGfxOutBarCtrl::fAddGroups|CGfxOutBarCtrl::fSelHighlight; 
 
	m_wndBar.Create(WS_CHILD|WS_VISIBLE, CRect(0,0,0,0), &m_wndSplitterVer, m_wndSplitterVer.IdFromRowCol(0, 0), dwf); 
	m_wndBar.SetOwner(this); 
	m_wndBar.SetFont(CFont::FromHandle((HFONT)GetStockObject(DEFAULT_GUI_FONT))); 
	m_menuManager.m_bAutoAccel = TRUE; 
	m_menuManager.Install(this); 
	//m_menuManager.LoadToolbar(IDR_SAFECLN); 
	 
	HINSTANCE hIns = AfxGetResourceHandle(); 
	AfxSetResourceHandle(AfxGetInstanceHandle()); 
	m_imaLarge.Create(IDB_TYPE_LIST,32,0,RGB(255, 0, 255)); 
	 
	if (!m_wndToolBar.Create(this) || 
		!m_wndToolBar.LoadToolBar(IDR_DISKINFO)) 
	{ 
		TRACE0("Failed to create toolbar\n"); 
		return -1;      // fail to create 
	} 
	m_menuManager.LoadToolbar(IDR_DISKINFO); 
 
	AfxSetResourceHandle(hIns); 
 
	m_wndBar.SetImageList(&m_imaLarge, CGfxOutBarCtrl::fLargeIcon); 
	m_wndBar.SetAnimationTickCount(1); 
	//m_wndBar.SetAnimSelHighlight(20);	 
 
	// TODO: Remove this if you don't want tool tips or a resizeable toolbar 
	m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() | 
		CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); 
 
	EnableToolTips(); 
 
	CString strTemp, strFace, strTooltip; 
	strTemp.LoadString(ID_SWITCH); 
	AfxExtractSubString(strFace, strTemp, 2);    // the third sub-string 
	AfxExtractSubString(strTooltip, strTemp, 1); 
	m_wndSwitchButton.Create(strFace, WS_CHILD|WS_VISIBLE, CRect(0,0,0,0), this, ID_SWITCH); 
	m_wndSwitchButton.SetFont(m_wndToolBar.GetFont()); 
	m_wndSwitchButton.ModifyFlag(CFlatButton::FBS_BORDER|CFlatButton::FBS_FOCUS,  
		NULL); 
	m_wndSwitchButton.SetTooltipText(strTooltip); 
 
	if (!m_wndStatusBar.CreateStatusBar(this, indicators, 
		sizeof(indicators)/sizeof(UINT))) 
	{ 
		TRACE0("Failed to create status bar\n"); 
		return -1;      // fail to create 
	} 
 
	//m_wndStatusBar.SetMode(1, XSB_TEXT | DT_CENTER); 
	//m_wndStatusBar.SetMode(2, XSB_TEXT | DT_CENTER);		// Fest (Caps) 
 
	// TODO: Delete these three lines if you don't want the toolbar to 
	//  be dockable 
/*	m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY); 
	EnableDocking(CBRS_ALIGN_ANY); 
	DockControlBar(&m_wndToolBar); 
*/ 
	CString strShortCuts; 
	strShortCuts.LoadString(IDS_SHORTCUTS); 
 
	m_wndBar.AddFolder(strShortCuts, 0); 
	m_wndBar.SetSelFolder(0); 
 
	UpdateShortCutBar(); 
 
	m_wndBar.SetCurSel(-1); 
 
	CRect r; 
	GetClientRect(&r); 
 
	int cxCur = AfxGetApp()->GetProfileInt("Settings", "ShortcutBarWidth",  65); 
	if (cxCur<=10) 
		cxCur = 65; 
	m_wndSplitterVer.SetColumnInfo( 0, cxCur, 0 ); 
	//m_wndSplitter.SetColumnInfo( 1, w2, 0 ); 
 
	//ReCreateViews(); 
	//m_wndSplitterVer.RecalcLayout(); 
	m_pwndView = new CDetailView(); 
	if (!m_pwndView->Create(NULL, NULL, AFX_WS_DEFAULT_VIEW|WS_CLIPCHILDREN, 
		CRect(0, 0, 0, 0), &m_wndSplitterVer, m_wndSplitterVer.IdFromRowCol(0, 1), NULL)) 
	{ 
		TRACE0("Failed to create view window\n"); 
		return -1; 
	} 
 
	m_pwndView->m_bVerMode = TRUE;	 
 
	/* 
	UINT nID[] = 
	{ 
		ID_WEB_MINISTARS, 
		ID_WEB_SAFECLEAN, 
		ID_E_MAIL, 
	}; 
 
	m_menuManager.AddSingleBitmap(IDB_WEB_LINK, 3, nID); 
*/ 
 
	return 0; 
} 
 
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) 
{ 
	if( !CFrameWnd::PreCreateWindow(cs) ) 
		return FALSE; 
	// TODO: Modify the Window class or styles here by modifying 
	//  the CREATESTRUCT cs 
 
	cs.dwExStyle &= ~WS_EX_CLIENTEDGE; 
	cs.lpszClass = AfxRegisterWndClass(0); 
 
	CWinApp* app = AfxGetApp(); 
    int s, t, b, r, l; 
 
    // only restore if there is a previously saved position 
    if ( -1 != (s = app->GetProfileInt("Position", "Status",   -1)) && 
         -1 != (t = app->GetProfileInt("Position", "Top",      -1)) && 
         -1 != (l = app->GetProfileInt("Position", "Left",     -1)) && 
         -1 != (b = app->GetProfileInt("Position", "Bottom",   -1)) && 
         -1 != (r = app->GetProfileInt("Position", "Right",    -1)) 
       ) { 
 
        // restore the window's status 
        app->m_nCmdShow = s; 
 
        // restore the window's width and height 
        cs.cx = r - l; 
        cs.cy = b - t; 
 
        // the following correction is needed when the taskbar is 
        // at the left or top and it is not "auto-hidden" 
        RECT workArea; 
        SystemParametersInfo(SPI_GETWORKAREA, 0, &workArea, 0); 
        l += workArea.left; 
        t += workArea.top; 
 
        // make sure the window is not completely out of sight 
        int max_x = GetSystemMetrics(SM_CXSCREEN) - 
                        GetSystemMetrics(SM_CXICON); 
        int max_y = GetSystemMetrics(SM_CYSCREEN) - 
                        GetSystemMetrics(SM_CYICON); 
        cs.x = min(l, max_x); 
        cs.y = min(t, max_y); 
    } 
 
	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 
void CMainFrame::OnSetFocus(CWnd* pOldWnd) 
{ 
	// forward focus to the view window 
	/*if (m_pwndView1 && m_pwndView->m_hWnd) 
		m_pwndView->SetFocus();*/ 
} 
 
BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo) 
{ 
	// let the view have first crack at the command 
	if (m_pwndView->m_hWnd && m_pwndView->OnCmdMsg(nID, nCode, pExtra, pHandlerInfo)) 
		return TRUE; 
/* 
	if (m_pwndView2->m_hWnd && m_pwndView2->OnCmdMsg(nID, nCode, pExtra, pHandlerInfo)) 
		return TRUE; 
*/ 
	// otherwise, do default handling 
	return CFrameWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo); 
} 
 
 
void CMainFrame::OnClose()  
{ 
	if (m_pwndView->m_hWnd) 
		m_pwndView->OnStop(); 
 
	CWinApp* app = AfxGetApp(); 
    WINDOWPLACEMENT wp; 
 
    GetWindowPlacement(&wp); 
    app->WriteProfileInt("Position", "Status", wp.showCmd); 
    app->WriteProfileInt("Position", "Top",    wp.rcNormalPosition.top); 
    app->WriteProfileInt("Position", "Left",   wp.rcNormalPosition.left); 
    app->WriteProfileInt("Position", "Bottom", wp.rcNormalPosition.bottom); 
    app->WriteProfileInt("Position", "Right",  wp.rcNormalPosition.right); 
 
	app->WriteProfileInt("Position", "MainFrameVisible",  IsWindowVisible()); 
 
 
	// InfoFrame 
    ((CDiskInfoApp*)app)->m_infoFrame.GetWindowPlacement(&wp); 
    app->WriteProfileInt("Position", "InfoStatus", wp.showCmd); 
    app->WriteProfileInt("Position", "InfoTop",    wp.rcNormalPosition.top); 
    app->WriteProfileInt("Position", "InfoLeft",   wp.rcNormalPosition.left); 
    app->WriteProfileInt("Position", "InfoBottom", wp.rcNormalPosition.bottom); 
    app->WriteProfileInt("Position", "InfoRight",  wp.rcNormalPosition.right); 
 
	//Save Bar width 
	int cxCur, cxMin; 
	m_wndSplitterVer.GetColumnInfo( 0, cxCur, cxMin ); 
	if (cxCur>10) 
		app->WriteProfileInt("Settings", "ShortcutBarWidth",  cxCur); 
	 
	CFrameWnd::OnClose(); 
} 
 
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)  
{ 
	return TRUE; 
} 
 
 
//#define _nMargin_	3 
void CMainFrame::OnSize(UINT nType, int cx, int cy)  
{ 
	CFrameWnd::OnSize(nType, cx, cy); 
	 
	CRect rcToolbar; 
	m_wndToolBar.GetWindowRect(&rcToolbar); 
	ScreenToClient(&rcToolbar); 
 
	CRect rect; 
	m_wndToolBar.GetItemRect((m_wndToolBar.GetToolBarCtrl()).GetButtonCount()-1, &rect); 
	m_wndToolBar.ClientToScreen(&rect); 
	ScreenToClient(&rect); 
 
	int nWidth = (int)(rect.Height()*2.8); 
	 
	m_wndSwitchButton.SetWindowPos(&wndTop, rcToolbar.right-nWidth,  
		rect.top , nWidth,rect.Height(),  
		SWP_NOOWNERZORDER); 
} 
/* 
void CMainFrame::OnSingleView()  
{ 
	if (m_nViewType != 0) 
	{ 
		m_nViewType = 0; // 0=Single view, 1=Double hor 2=Double ver 
		ReCreateViews(); 
	} 
} 
 
void CMainFrame::OnUpdateSingleView(CCmdUI* pCmdUI)  
{ 
	pCmdUI->SetCheck(m_nViewType == 0); 
} 
 
void CMainFrame::OnTwoViewHor()  
{ 
	if (m_nViewType != 1) 
	{ 
		m_nViewType = 1; // 0=Single view, 1=Double hor 2=Double ver 
		ReCreateViews(); 
	} 
} 
 
void CMainFrame::OnUpdateTwoViewHor(CCmdUI* pCmdUI)  
{ 
	pCmdUI->SetCheck(m_nViewType == 1); 
} 
 
void CMainFrame::OnTwoViewVer()  
{ 
	if (m_nViewType != 2) 
	{ 
		m_nViewType = 2; // 0=Single view, 1=Double hor 2=Double ver 
		ReCreateViews(); 
	} 
} 
 
void CMainFrame::OnUpdateTwoViewVer(CCmdUI* pCmdUI)  
{ 
	pCmdUI->SetCheck(m_nViewType == 2); 
} 
*/ 
/*void CMainFrame::ReCreateViews() 
{ 
	CRect rc; 
 
	if (m_pwndView1 && m_pwndView->m_hWnd) 
	{ 
		m_pwndView->DestroyWindow(); 
		delete m_pwndView1; 
		m_pwndView1 = NULL; 
	} 
	if (m_pwndView2 && m_pwndView2->m_hWnd) 
	{ 
		m_pwndView2->DestroyWindow(); 
		delete m_pwndView2; 
		m_pwndView2 = NULL; 
	} 
 
	//if (!wndSplitter.CreateStatic(this, 1, 2)) return false; 
	// create a view to occupy the client area of the frame 
	if (m_pwndSplitterView) 
	{ 
		if (m_pwndSplitterView->m_hWnd) 
			m_pwndSplitterView->DestroyWindow(); 
		delete m_pwndSplitterView; 
		m_pwndSplitterView = NULL; 
	} 
 
	//m_pwndView->Reset(); 
	//m_pwndView2->Reset(); 
 
	if (m_nViewType == 0) 
	{ 
		m_pwndView1 = new CDetailView(); 
		if (!m_pwndView->Create(NULL, NULL, AFX_WS_DEFAULT_VIEW|WS_CLIPCHILDREN, 
			CRect(0, 0, 0, 0), &m_wndSplitterVer, m_wndSplitterVer.IdFromRowCol(0, 1), NULL)) 
		{ 
			TRACE0("Failed to create view window\n"); 
 
			return; 
		} 
 
		m_pwndView->m_bVerMode = TRUE; 
		//m_pwndView2->m_bVerMode = TRUE; 
	} 
 
	if (m_nViewType == 1) // Horrisontal 
	{ 
		m_pwndSplitterView = new CGfxSplitterWnd; 
 
		if (m_pwndSplitterView->CreateStatic(&m_wndSplitterVer, 2, 1, 
			WS_CHILD | WS_VISIBLE, m_wndSplitterVer.IdFromRowCol(0, 1))) 
		{ 
			m_pwndSplitterView->EnableUpBorder(FALSE); 
			m_pwndSplitterView->bWhiteLine = FALSE; 
 
			m_pwndView1 = new CDetailView(); 
			m_pwndView2 = new CDetailView(); 
			if (!m_pwndView->Create(NULL, NULL, AFX_WS_DEFAULT_VIEW|WS_CLIPCHILDREN, 
				CRect(0, 0, 0, 0), m_pwndSplitterView, m_pwndSplitterView->IdFromRowCol(0, 0), NULL)) 
			{ 
				TRACE0("Failed to create view window\n"); 
 
				return; 
			} 
 
			if (!m_pwndView2->Create(NULL, NULL, AFX_WS_DEFAULT_VIEW|WS_CLIPCHILDREN, 
				CRect(0, 0, 0, 0), m_pwndSplitterView, m_pwndSplitterView->IdFromRowCol(1, 0), NULL)) 
			{ 
				TRACE0("Failed to create view window\n"); 
 
				return; 
			} 
 
			m_pwndView->m_bVerMode = TRUE; 
			m_pwndView2->m_bVerMode = TRUE; 
 
			m_wndSplitterVer.GetWindowRect(&rc); 
			 
			m_pwndSplitterView->SetRowInfo( 0, (rc.Height()-4)/2, 0 ); 
		} 
	} 
 
	if (m_nViewType == 2) // Verticle 
	{ 
		m_pwndSplitterView = new CGfxSplitterWnd; 
		if (m_pwndSplitterView->CreateStatic(&m_wndSplitterVer, 1, 2, 
			WS_CHILD | WS_VISIBLE, m_wndSplitterVer.IdFromRowCol(0, 1))) 
		{ 
			m_pwndSplitterView->EnableUpBorder(FALSE); 
			m_pwndSplitterView->bWhiteLine = FALSE; 
 
			m_pwndView1 = new CDetailView(); 
			m_pwndView2 = new CDetailView(); 
 
			if (!m_pwndView->Create(NULL, NULL, AFX_WS_DEFAULT_VIEW, 
				CRect(0, 0, 0, 0), m_pwndSplitterView, m_pwndSplitterView->IdFromRowCol(0, 0), NULL)) 
			{ 
				TRACE0("Failed to create view window\n"); 
 
				return; 
			} 
 
			if (!m_pwndView2->Create(NULL, NULL, AFX_WS_DEFAULT_VIEW, 
				CRect(0, 0, 0, 0), m_pwndSplitterView, m_pwndSplitterView->IdFromRowCol(0, 1), NULL)) 
			{ 
				TRACE0("Failed to create view window\n"); 
 
				return; 
			} 
 
			m_pwndView->m_bVerMode = FALSE; 
			m_pwndView2->m_bVerMode = FALSE; 
 
			m_wndSplitterVer.GetWindowRect(&rc); 
 
			m_pwndSplitterView->SetColumnInfo( 0, (rc.Width()- 4*2 - m_nBarWidth)/2, 0 ); 
		} 
	} 
 
	if (m_pwndSplitterView && m_pwndSplitterView->m_hWnd) 
		m_pwndSplitterView->RecalcLayout(); 
	 
	if (m_wndSplitterVer.m_hWnd) 
		m_wndSplitterVer.RecalcLayout();	 
} 
*/ 
void CMainFrame::OnPaint()  
{ 
	CPaintDC dc(this); // device context for painting 
} 
 
void CMainFrame::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)  
{ 
	lpMMI->	ptMinTrackSize.x = 435; 
	lpMMI->	ptMinTrackSize.y = 280; 
 
	CFrameWnd::OnGetMinMaxInfo(lpMMI); 
} 
 
void CMainFrame::OnOptionChanged() 
{ 
	m_wndBar.SetCurSel(-1); 
	UpdateShortCutBar(); 
	UpdateBarStatus(0,0); 
} 
 
void CMainFrame::UpdateShortCutBar() 
{ 
	CWinApp* app = AfxGetApp(); 
	BOOL bRemovable= app->GetProfileInt("Settings", "EnableRemovable", 1); 
	BOOL bFixed = app->GetProfileInt("Settings", "EnableFixed", 1); 
	BOOL bCDROM = app->GetProfileInt("Settings", "EnableCDROM", 1); 
	BOOL bRemote = app->GetProfileInt("Settings", "EnableRemote", 0); 
	BOOL bRamDrive = app->GetProfileInt("Settings", "EnableRAMDisk", 0);	 
	CString strExclude = app->GetProfileString("Settings", "Exclude", "A:\\ B:\\"); 
 
	BOOL bEnableFolder = app->GetProfileInt("Settings", "EnableFolder",   1); 
	 
	// Load Folder data 
	CStringArray strArray; 
	CString str, strData; 
	int n = 0; 
	str.Format("FolderData%d", n); 
	strData = app->GetProfileString("Settings", str, ""); 
 
	while (!strData.IsEmpty()) 
	{ 
		strArray.Add(strData); 
		n++; 
		str.Format("FolderData%d", n); 
		strData = app->GetProfileString("Settings", str, ""); 
	} 
 
	strExclude.MakeLower(); 
	str = strExclude; 
	str.MakeUpper(); 
	strExclude += str; 
 
	int nPos=0; 
	CString strDrive = "?:\\"; 
	UINT nType; 
 
	int nCount = m_wndBar.GetItemCount(); 
	for (int i=0; i>= 1; 
		nPos ++; 
	} 
 
	if (bEnableFolder) 
	{ 
		int nSize = strArray.GetSize(); 
		CString strFolder; 
 
		for (int i=0; iSetTitle(str); 
			m_pwndView->SetCurrentFolder(str); 
 
			break; 
		} 
		return 0; 
	} 
	return 0; 
} 
 
void CMainFrame::DoSwitch(BOOL bShow) 
{ 
	if (bShow) 
	{ 
		m_pwndView->ShowMe(); 
	}else 
		m_pwndView->OnStop(); 
		 
} 
 
void CMainFrame::SetCurrentFolder(CString &str) 
{ 
	m_pwndView->m_strTitle = str; 
} 
 
void CMainFrame::UpdateBarStatus(WPARAM wParam, LPARAM lParam) 
{ 
	CString str = m_pwndView->m_strTitle; 
 
	POSITION pos = m_listShortcut.Find(str); 
 
	if (!pos) 
	{ 
		m_wndBar.SetCurSel(-1); 
		return; 
	} 
	int n = 0; 
	POSITION posHead = m_listShortcut.GetHeadPosition(); 
	while (pos != posHead) 
	{ 
		m_listShortcut.GetPrev(pos); 
		n++; 
	} 
 
	m_wndBar.SetCurSel(n); 
} 
 
void CMainFrame::EnableSwitchButton(BOOL b) 
{ 
	m_wndSwitchButton.EnableWindow(b); 
	//m_wndSwitchButton.ShowWindow(SW_HIDE); 
	m_wndSwitchButton.ShowWindow((b)?SW_SHOW:SW_HIDE); 
	PumpMessages(); 
} 
 
void CMainFrame::OnWebSafeclean()  
{ 
	GotoURL(_T("http://www.ministars.com/safeclean/"));	 
} 
 
void CMainFrame::OnEMail()  
{ 
	// 
} 
 
void CMainFrame::OnHelpHelp()  
{ 
} 
 
void CMainFrame::OnRegwizard()  
{ 
} 
 
void CMainFrame::OnScanProgressNotify(WPARAM wParam, LPARAM lParam) 
{ 
	WORD nLower, nHigher; 
	UINT nPos; 
	CString str; 
 
	switch ((UINT)wParam) 
	{ 
	case SCAN_PROGRESS_SET_RANGE: 
		nLower = LOWORD(lParam); 
		nHigher = HIWORD(lParam); 
 
		m_wndStatusBar.SavePane(0); 
		m_wndStatusBar.SetMode(0, XSB_PROGRESS); 
		m_wndStatusBar.SetRange(0, nLower, nHigher); 
		m_wndStatusBar.SetPos(0, 0); 
		break; 
	case SCAN_PROGRESS_SET_POS: 
		nPos = m_wndStatusBar.GetPos(0); 
		if (nPos != (UINT)lParam) 
			m_wndStatusBar.SetPos(0, (UINT)lParam); 
		break; 
	case SCAN_PROGRESS_FINISHED: 
		m_wndStatusBar.RestorePane(0); 
		break; 
	} 
}