📄 resourcebar.cpp
字号:
// .cpp : implementation file
//
#include "stdafx.h"
#include "GreenBrowser.h"
#include "Resourcebar.h"
#include "mainfrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//#pragma optimize( "s", on )
/////////////////////////////////////////////////////////////////////////////
// CResourcebarTree
CResourcebar::CResourcebar()
{
}
CResourcebar::~CResourcebar()
{
}
/////////////////////////////////////////////////////////////////////////////
// CHistoryTree message handlers
LPCSTR CResourcebar::GetTitle()
{
LOADSTR(strTitle ,IDS_TITLE_RESOURCE);
return (LPCSTR)strTitle;
}
BOOL CResourcebar::Initialize()
{
HINSTANCE hInstance = AfxGetResourceHandle();
ASSERT(hInstance != NULL);
CString strResourceURL;
BOOL bRetVal = TRUE;
LPTSTR lpszModule = NULL;
try
{
lpszModule = new TCHAR[_MAX_PATH];
}
catch(...)
{
return FALSE;
}
if (GetModuleFileName(hInstance, lpszModule, _MAX_PATH))
{
//check if resource.htm exists
CString strSearchRes(lpszModule);
int i = strSearchRes.ReverseFind('\\');
strSearchRes = strSearchRes.Left(i+1);
strSearchRes += "Resource\\resource.htm";
OFSTRUCT fst;
if(OpenFile(strSearchRes,&fst ,OF_EXIST)!=HFILE_ERROR)
m_wndResource.Navigate(strSearchRes, 0, 0, 0,NULL);
else
m_wndResource.Navigate("about:blank", 0, 0, 0,NULL);
}
else
bRetVal = FALSE;
delete [] lpszModule;
return bRetVal;
}
BOOL CResourcebar::Create(CWnd* pParent)
{
m_wndResource.Create(NULL, "", WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN, CRect(0,0,0,0), pParent, IDS_TITLE_RESOURCE,NULL);
return TRUE;
}
CWnd* CResourcebar::GetWindow()
{
return (CWnd*)&m_wndResource;
}
void CResourcebar::Destroy()
{
return;
}
BOOL CResourcebar::Update(int nLevel)
{
return TRUE;
}
//#pragma optimize( "s", off)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -