📄 stdafx.cpp
字号:
// stdafx.cpp : source file that includes just the standard includes
// FTPServer.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
/********************************************************************/
/* */
/* Function name : GetAppDir */
/* Description : Get application directory. */
/* */
/********************************************************************/
void GetAppDir(CString& strAppDir)
{
TCHAR szFullPath[MAX_PATH];
TCHAR szDir[_MAX_DIR];
TCHAR szDrive[_MAX_DRIVE];
// Get application's full path.
::GetModuleFileName(NULL, szFullPath, MAX_PATH);
// Break full path into seperate components.
_splitpath(szFullPath, szDrive, szDir, NULL, NULL);
// Store application's drive and path
strAppDir.Format(_T("%s%s"), szDrive, szDir);
}
void AutoSizeColumns(CListCtrl *pListCtrl)
{
// Call this after your the control is filled
pListCtrl->SetRedraw(FALSE);
int mincol = 0;
int maxcol = pListCtrl->GetHeaderCtrl()->GetItemCount()-1;
for (int col = mincol; col <= maxcol; col++)
{
pListCtrl->SetColumnWidth(col, LVSCW_AUTOSIZE);
int wc1 = pListCtrl->GetColumnWidth(col);
pListCtrl->SetColumnWidth(col, LVSCW_AUTOSIZE_USEHEADER);
int wc2 = pListCtrl->GetColumnWidth(col);
// 10 is minumim column width
int wc = max(10, max(wc1,wc2));
pListCtrl->SetColumnWidth(col,wc);
}
pListCtrl->SetRedraw(TRUE);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -