?? dialogfileview.cpp
字號:
// DialogFileView.cpp : implementation file
//
#include "stdafx.h"
#include "FileDialogView.h"
#include "DialogFileView.h"
#include "DialogThread.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#define WM_USR_INIT_FINISHED (WM_USER + 101)
/////////////////////////////////////////////////////////////////////////////
// CDialogFileView
IMPLEMENT_DYNAMIC(CDialogFileView, CFileDialog)
CDialogFileView::CDialogFileView(CDialogThread& rThreadRunningDlg)
: m_rThreadRunningDlg(rThreadRunningDlg),
CFileDialog(TRUE, NULL, _T("*.*"),
OFN_ALLOWMULTISELECT | OFN_ENABLEHOOK | OFN_HIDEREADONLY,
{
m_ofn.Flags &= ~OFN_ENABLESIZING;
}
BEGIN_MESSAGE_MAP(CDialogFileView, CFileDialog)
//{{AFX_MSG_MAP(CDialogFileView)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
ON_MESSAGE(WM_USR_INIT_FINISHED, OnInitFinished)
END_MESSAGE_MAP()
BOOL CDialogFileView::EnumChildProc(HWND hWnd, LPARAM)
{
CString szClassName;
::GetClassName(hWnd,szClassName.GetBuffer(32),32);
if(strcmp(strlwr((LPSTR)(LPCTSTR)szClassName),"toolbarwindow32") == 0)
{
CDialogFileWnd::hWndToolBar = hWnd;
return FALSE;
}
return TRUE;
}
void CDialogFileView::OnInitDone()
{
ASSERT_VALID(this);
ASSERT(!GetParent()->IsWindowVisible());
PostMessage(WM_USR_INIT_FINISHED);
LocationToolbar();
}
BOOL CDialogFileView::OnInitDialog()
{
CWnd* pParent = GetParent();
VERIFY(::SetWindowLong(*pParent, GWL_STYLE, WS_CHILD | WS_CLIPCHILDREN));
VERIFY(::SetParent(*pParent, m_rThreadRunningDlg.m_hWndParent));
VERIFY(::SetWindowPos(*pParent, NULL, 0, 0, 0, 0,SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_FRAMECHANGED ));
if(pParent)
pParent->SetDlgCtrlID(m_rThreadRunningDlg.m_nID);
CFileDialog::OnInitDialog();
HideControl(IDOK);
HideControl(IDCANCEL);
HideControl(stc2);
HideControl(stc3);
HideControl(stc4);
HideControl(cmb1);
HideControl(edt1);
return TRUE; // return TRUE unless you set the focus to a control
}
BOOL CDialogFileView::OnFileNameOK()
{
return TRUE;
}
void CDialogFileView::LocationToolbar()
{
EnumChildWindows((HWND)::GetParent(m_hWnd), CDialogFileView::EnumChildProc, (LPARAM)NULL);
}
void CDialogFileView::OnFolderChange()
{
CRect rect;
GetParent()->GetClientRect(&rect);
GetParent()->SendMessage(WM_SIZE,0,MAKELPARAM(rect.Width(), rect.Height()));
}
LRESULT CDialogFileView::OnInitFinished(WPARAM, LPARAM)
{
m_rThreadRunningDlg.m_wndFileBrowse.SubclassWindow(*GetParent());
m_rThreadRunningDlg.m_pMainWnd = &m_rThreadRunningDlg.m_wndFileBrowse;
VERIFY(SetEvent(m_rThreadRunningDlg.m_hEventCreated));
return 1;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -