WTL : add HexEdit to CPaneContainerImpl

本文介绍了一个HexEditor的实现案例,该案例通过在C++中使用CFrame进行封装,并将其作为变量嵌入到切分面板中。文章详细展示了如何创建并使用HexEditor控件,包括其消息映射及窗口创建过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

找到一个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);
}



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值