找到一个HexEditor实现, Demo是在CFrame中直接用的,为了封装挪到切分面板中作为一个变量.
/// @file LsPaneContainerPeContent.h
#ifndef __LS_PANECONTAINER_PECONTENT_H__
#define __LS_PANECONTAINER_PECONTENT_H__
#include "LsPaneContainer.h"
#include "HexEditor.h"
class CLsPaneContainerPeContent :
public CLsPaneContainer
{
public:
CLsPaneContainerPeContent(void);
virtual ~CLsPaneContainerPeContent(void);
BEGIN_MSG_MAP(CLsPaneContainerPeContent)
MESSAGE_HANDLER(WM_SIZE, OnSize)
CHAIN_MSG_MAP(CLsPaneContainer)
END_MSG_MAP()
HWND Create(
HWND hWndParent,
LPCTSTR lpstrTitle = NULL,
DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
DWORD dwExStyle = 0,
UINT nID = 0,
LPVOID lpCreateParam = NULL);
LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
private:
CHexEditorCtrl m_HexEditCtrl; ///< http://www.viksoe.dk/code/hexeditor.htm
};
#endif // #ifndef __LS_PANECONTAINER_PECONTENT_H__
/// @file LsPaneContainerPeContent.cpp
#include "stdafx.h"
#include "LsPaneContainerPeContent.h"
CLsPaneContainerPeContent::CLsPaneContainerPeContent(void)
{
}
CLsPaneContainerPeContent::~CLsPaneContainerPeContent(void)
{
}
HWND CLsPaneContainerPeContent::Create(
HWND hWndParent,
LPCTSTR lpstrTitle,
DWORD dwStyle,
DWORD dwExStyle,
UINT nID,
LPVOID lpCreateParam)
{
HWND hWnd = NULL;
HWND hWndCtrl = NULL;
hWnd = CLsPaneContainer::Create(
hWndParent,
lpstrTitle,
dwStyle,
dwExStyle,
nID,
lpCreateParam);
hWndCtrl = m_HexEditCtrl.Create(
m_hWnd,
rcDefault,
NULL,
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
WS_EX_CLIENTEDGE);
this->SetClient(hWndCtrl); ///< !
return hWnd;
}
LRESULT CLsPaneContainerPeContent::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
return CLsPaneContainer::OnSize(uMsg, wParam, lParam, bHandled);
}