Skip to content

Commit

Permalink
Latest ListEx adaptation. Slow files loading due to the HexCtrl's Get…
Browse files Browse the repository at this point in the history
…WndHandle method is fixed.

This method by default did create requested dialog window, now it doesn't.
g_vecHexDlgs from vector to plain array.
Copyright year bumping.
  • Loading branch information
jovibor committed Jan 10, 2024
1 parent 588c3e9 commit c97bdc1
Show file tree
Hide file tree
Showing 26 changed files with 114 additions and 126 deletions.
4 changes: 3 additions & 1 deletion Pepper/CChildFrm.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************************************
* Copyright © 2018-2023 Jovibor https://github.com/jovibor/ *
* Copyright © 2018-2024 Jovibor https://github.com/jovibor/ *
* This software is available under the Apache-2.0 License. *
* Official git repository: https://github.com/jovibor/Pepper/ *
* Pepper is a PE32 (x86) and PE32+ (x64) binares viewer/editor. *
Expand All @@ -15,6 +15,8 @@
#include <algorithm>
#include <cmath>

import Utility;

IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWndEx)

BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWndEx)
Expand Down
5 changes: 2 additions & 3 deletions Pepper/CChildFrm.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
/****************************************************************************************************
* Copyright © 2018-2023 Jovibor https://github.com/jovibor/ *
* Copyright © 2018-2024 Jovibor https://github.com/jovibor/ *
* This software is available under the Apache-2.0 License. *
* Official git repository: https://github.com/jovibor/Pepper/ *
* Pepper is a PE32 (x86) and PE32+ (x64) binares viewer/editor. *
****************************************************************************************************/
#pragma once
#include "CSplitterEx.h"

class CChildFrame : public CMDIChildWndEx
{
class CChildFrame : public CMDIChildWndEx {
public:
[[nodiscard]] auto GetSplitRight() -> CSplitterEx&;
[[nodiscard]] auto GetSplitRightTop() -> CSplitterEx&;
Expand Down
10 changes: 5 additions & 5 deletions Pepper/CFileLoader.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************************************
* Copyright © 2018-2023 Jovibor https://github.com/jovibor/ *
* Copyright © 2018-2024 Jovibor https://github.com/jovibor/ *
* This software is available under the Apache-2.0 License. *
* Official git repository: https://github.com/jovibor/Pepper/ *
* Pepper is a PE32 (x86) and PE32+ (x64) binares viewer/editor. *
Expand Down Expand Up @@ -99,7 +99,7 @@ HRESULT CFileLoader::ShowOffsetInWholeFile(ULONGLONG ullOffset, ULONGLONG ullSel

//If floating HexCtrl is in use we bring it to the front.
if (pHexCtrl == m_pHex.get()) {
::SetForegroundWindow(pHexCtrl->GetWindowHandle(EHexWnd::WND_MAIN));
::SetForegroundWindow(pHexCtrl->GetWndHandle(EHexWnd::WND_MAIN));
}

return S_OK;
Expand Down Expand Up @@ -174,7 +174,7 @@ void CFileLoader::CreateHexCtrlWnd()
{
m_pHex->Create(m_hcs);

const auto hWndHex = m_pHex->GetWindowHandle(EHexWnd::WND_MAIN);
const auto hWndHex = m_pHex->GetWndHandle(EHexWnd::WND_MAIN);
const auto iWidthActual = m_pHex->GetActualWidth() + GetSystemMetrics(SM_CXVSCROLL);
CRect rcHex(0, 0, iWidthActual, iWidthActual); //Square window.
AdjustWindowRectEx(rcHex, m_dwStyle, FALSE, m_dwExStyle);
Expand All @@ -187,8 +187,8 @@ void CFileLoader::CreateHexCtrlWnd()
const auto hIconSmall = static_cast<HICON>(LoadImageW(AfxGetInstanceHandle(), MAKEINTRESOURCEW(IDI_HEXCTRL_LOGO), IMAGE_ICON, 0, 0, 0));
const auto hIconBig = static_cast<HICON>(LoadImageW(AfxGetInstanceHandle(), MAKEINTRESOURCEW(IDI_HEXCTRL_LOGO), IMAGE_ICON, 96, 96, 0));
if (hIconSmall != nullptr) {
::SendMessageW(m_pHex->GetWindowHandle(EHexWnd::WND_MAIN), WM_SETICON, ICON_SMALL, reinterpret_cast<LPARAM>(hIconSmall));
::SendMessageW(m_pHex->GetWindowHandle(EHexWnd::WND_MAIN), WM_SETICON, ICON_BIG, reinterpret_cast<LPARAM>(hIconBig));
::SendMessageW(m_pHex->GetWndHandle(EHexWnd::WND_MAIN), WM_SETICON, ICON_SMALL, reinterpret_cast<LPARAM>(hIconSmall));
::SendMessageW(m_pHex->GetWndHandle(EHexWnd::WND_MAIN), WM_SETICON, ICON_BIG, reinterpret_cast<LPARAM>(hIconBig));
}
}

Expand Down
2 changes: 1 addition & 1 deletion Pepper/CFileLoader.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************************************
* Copyright © 2018-2023 Jovibor https://github.com/jovibor/ *
* Copyright © 2018-2024 Jovibor https://github.com/jovibor/ *
* This software is available under the Apache-2.0 License. *
* Official git repository: https://github.com/jovibor/Pepper/ *
* Pepper is a PE32 (x86) and PE32+ (x64) binares viewer/editor. *
Expand Down
2 changes: 1 addition & 1 deletion Pepper/CMainFrm.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************************************
* Copyright © 2018-2023 Jovibor https://github.com/jovibor/ *
* Copyright © 2018-2024 Jovibor https://github.com/jovibor/ *
* This software is available under the Apache-2.0 License. *
* Official git repository: https://github.com/jovibor/Pepper/ *
* Pepper is a PE32 (x86) and PE32+ (x64) binares viewer/editor. *
Expand Down
5 changes: 2 additions & 3 deletions Pepper/CMainFrm.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************************************
* Copyright © 2018-2023 Jovibor https://github.com/jovibor/ *
* Copyright © 2018-2024 Jovibor https://github.com/jovibor/ *
* This software is available under the Apache-2.0 License. *
* Official git repository: https://github.com/jovibor/Pepper/ *
* Pepper is a PE32 (x86) and PE32+ (x64) binares viewer/editor. *
Expand All @@ -10,8 +10,7 @@
import Utility;
using namespace Utility;

class CMainFrame : public CMDIFrameWndEx
{
class CMainFrame : public CMDIFrameWndEx {
public:
BOOL LoadFrame(UINT nIDResource, DWORD dwDefaultStyle = WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE,
CWnd* pParentWnd = nullptr, CCreateContext* pContext = nullptr)override;
Expand Down
7 changes: 3 additions & 4 deletions Pepper/CPepper.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************************************
* Copyright © 2018-2023 Jovibor https://github.com/jovibor/ *
* Copyright © 2018-2024 Jovibor https://github.com/jovibor/ *
* This software is available under the Apache-2.0 License. *
* Official git repository: https://github.com/jovibor/Pepper/ *
* Pepper is a PE32 (x86) and PE32+ (x64) binares viewer/editor. *
Expand All @@ -14,8 +14,7 @@

import Utility;

class CAboutDlg : public CDialogEx
{
class CAboutDlg : public CDialogEx {
public:
CAboutDlg() : CDialogEx(IDD_ABOUTBOX) {};
protected:
Expand Down Expand Up @@ -152,7 +151,7 @@ void CPepperApp::OnFileOpen()
return fOpened;
}
return true;
};
};

while (!lmbFOD()) { }; //If no file has been opened (if multiple selection) we show the Open File Dialog again.
}
Expand Down
5 changes: 2 additions & 3 deletions Pepper/CPepper.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
/****************************************************************************************************
* Copyright © 2018-2023 Jovibor https://github.com/jovibor/ *
* Copyright © 2018-2024 Jovibor https://github.com/jovibor/ *
* This software is available under the Apache-2.0 License. *
* Official git repository: https://github.com/jovibor/Pepper/ *
* Pepper is a PE32 (x86) and PE32+ (x64) binares viewer/editor. *
****************************************************************************************************/
#pragma once

class CPepperApp : public CWinAppEx
{
class CPepperApp : public CWinAppEx {
public:
void OpenNewFile();
private:
Expand Down
2 changes: 1 addition & 1 deletion Pepper/CPepperDoc.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************************************
* Copyright © 2018-2023 Jovibor https://github.com/jovibor/ *
* Copyright © 2018-2024 Jovibor https://github.com/jovibor/ *
* This software is available under the Apache-2.0 License. *
* Official git repository: https://github.com/jovibor/Pepper/ *
* Pepper is a PE32 (x86) and PE32+ (x64) binares viewer/editor. *
Expand Down
2 changes: 1 addition & 1 deletion Pepper/CPepperDoc.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************************************
* Copyright © 2018-2023 Jovibor https://github.com/jovibor/ *
* Copyright © 2018-2024 Jovibor https://github.com/jovibor/ *
* This software is available under the Apache-2.0 License. *
* Official git repository: https://github.com/jovibor/Pepper/ *
* Pepper is a PE32 (x86) and PE32+ (x64) binares viewer/editor. *
Expand Down
2 changes: 1 addition & 1 deletion Pepper/CSplitterEx.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************************************
* Copyright © 2018-2023 Jovibor https://github.com/jovibor/ *
* Copyright © 2018-2024 Jovibor https://github.com/jovibor/ *
* This software is available under the Apache-2.0 License. *
* Official git repository: https://github.com/jovibor/Pepper/ *
* Pepper is a PE32 (x86) and PE32+ (x64) binares viewer/editor. *
Expand Down
2 changes: 1 addition & 1 deletion Pepper/CSplitterEx.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************************************
* Copyright © 2018-2023 Jovibor https://github.com/jovibor/ *
* Copyright © 2018-2024 Jovibor https://github.com/jovibor/ *
* This software is available under the Apache-2.0 License. *
* Official git repository: https://github.com/jovibor/Pepper/ *
* Pepper is a PE32 (x86) and PE32+ (x64) binares viewer/editor. *
Expand Down
2 changes: 1 addition & 1 deletion Pepper/CTreeEx.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************************************
* Copyright © 2018-2023 Jovibor https://github.com/jovibor/ *
* Copyright © 2018-2024 Jovibor https://github.com/jovibor/ *
* This software is available under the Apache-2.0 License. *
* Official git repository: https://github.com/jovibor/Pepper/ *
* Pepper is a PE32 (x86) and PE32+ (x64) binares viewer/editor. *
Expand Down
2 changes: 1 addition & 1 deletion Pepper/CTreeEx.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************************************
* Copyright © 2018-2023 Jovibor https://github.com/jovibor/ *
* Copyright © 2018-2024 Jovibor https://github.com/jovibor/ *
* This software is available under the Apache-2.0 License. *
* Official git repository: https://github.com/jovibor/Pepper/ *
* Pepper is a PE32 (x86) and PE32+ (x64) binares viewer/editor. *
Expand Down
2 changes: 1 addition & 1 deletion Pepper/CViewLeft.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************************************
* Copyright © 2018-2023 Jovibor https://github.com/jovibor/ *
* Copyright © 2018-2024 Jovibor https://github.com/jovibor/ *
* This software is available under the Apache-2.0 License. *
* Official git repository: https://github.com/jovibor/Pepper/ *
* Pepper is a PE32 (x86) and PE32+ (x64) binares viewer/editor. *
Expand Down
2 changes: 1 addition & 1 deletion Pepper/CViewLeft.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************************************
* Copyright © 2018-2023 Jovibor https://github.com/jovibor/ *
* Copyright © 2018-2024 Jovibor https://github.com/jovibor/ *
* This software is available under the Apache-2.0 License. *
* Official git repository: https://github.com/jovibor/Pepper/ *
* Pepper is a PE32 (x86) and PE32+ (x64) binares viewer/editor. *
Expand Down
Loading

0 comments on commit c97bdc1

Please sign in to comment.