📄 xpath.cpp
字号:
//////////////////////////////////////////////////////////////////////
// Implemented by Samuel Gonzalo
//
// You may freely use or modify this code
//////////////////////////////////////////////////////////////////////
//
// Path.cpp: implementation of the CXPath class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include <Shlwapi.h>
#include <tchar.h>
#include "XPath.h"
#define NULL_WSTRING _T("")
//////////////////////////////////////////////////////////////////////////
CString UXPGetModulePath()
{
CString strFileBuf;
HMODULE hModule = GetModuleHandle(NULL);
GetModuleFileName(hModule, strFileBuf.GetBuffer(2048), 2048);
strFileBuf.ReleaseBuffer();
int nPos = strFileBuf.ReverseFind(_T('\\'));
if (nPos != -1)
{
strFileBuf = strFileBuf.Left(nPos+1);
}
return strFileBuf;
}
BOOL XTFuncPathExists(LPCTSTR lpszFileName)
{
WIN32_FIND_DATA fd;
HANDLE hFind = ::FindFirstFile(lpszFileName, &fd);
if (hFind != INVALID_HANDLE_VALUE)
{
::FindClose(hFind);
return TRUE;
}
return FALSE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -