From 46af190fd53836aa93589bbe1e44b396474f48dd Mon Sep 17 00:00:00 2001 From: Jovibor Date: Sat, 6 Mar 2021 12:56:10 +1000 Subject: [PATCH] [Fixes] List column names centering in CViewRightBL. Latest HexCtrl. --- Pepper/ListEx/ListEx.h | 2 +- Pepper/ListEx/src/CListEx.cpp | 45 +++++++++++++++++++++------ Pepper/ListEx/src/CListEx.h | 9 ++++-- Pepper/Pepper.cpp | 2 +- Pepper/ViewRightBL.cpp | 18 +++++------ Pepper/include/HexCtrl.h | 7 +++-- Pepper/include/HexCtrlDefs.h | 58 +++++++++++++++++++---------------- Pepper/res/Pepper.rc | 14 ++++----- 8 files changed, 94 insertions(+), 61 deletions(-) diff --git a/Pepper/ListEx/ListEx.h b/Pepper/ListEx/ListEx.h index 4beb65c..0430a13 100644 --- a/Pepper/ListEx/ListEx.h +++ b/Pepper/ListEx/ListEx.h @@ -89,7 +89,7 @@ namespace LISTEX ********************************************/ struct LISTEXHDRICON { - POINT pt { }; //Point of the top-left corner. + POINT pt { }; //Coords of the icon's top-left corner in the header item's rect. int iIndex { }; //Icon index in the header's image list. bool fClickable { true }; //Is icon sending LISTEX_MSG_HDRICONCLICK message when clicked. }; diff --git a/Pepper/ListEx/src/CListEx.cpp b/Pepper/ListEx/src/CListEx.cpp index edb5e5e..2856c72 100644 --- a/Pepper/ListEx/src/CListEx.cpp +++ b/Pepper/ListEx/src/CListEx.cpp @@ -123,27 +123,35 @@ bool CListEx::Create(const LISTEXCREATESTRUCT& lcs) if (!m_stWndTtCell.CreateEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, nullptr, TTS_BALLOON | TTS_NOANIMATE | TTS_NOFADE | TTS_NOPREFIX | TTS_ALWAYSTIP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, nullptr, nullptr)) return false; - SetWindowTheme(m_stWndTtCell, nullptr, L""); //To prevent Windows from changing theme of Balloon window. - m_stTInfoCell.cbSize = TTTOOLINFOW_V1_SIZE; m_stTInfoCell.uFlags = TTF_TRACK; - m_stTInfoCell.uId = 0x1; + m_stTInfoCell.uId = 0x01; m_stWndTtCell.SendMessageW(TTM_ADDTOOL, 0, reinterpret_cast(&m_stTInfoCell)); m_stWndTtCell.SendMessageW(TTM_SETMAXTIPWIDTH, 0, static_cast(400)); //to allow use of newline \n. m_stWndTtCell.SendMessageW(TTM_SETTIPTEXTCOLOR, static_cast(m_stColors.clrTooltipText), 0); m_stWndTtCell.SendMessageW(TTM_SETTIPBKCOLOR, static_cast(m_stColors.clrTooltipBk), 0); - if (!m_stWndTtLink.CreateEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, nullptr, TTS_NOANIMATE | TTS_NOFADE | TTS_NOPREFIX | TTS_ALWAYSTIP, + if (!m_stWndTtLink.CreateEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, nullptr, TTS_NOPREFIX | TTS_ALWAYSTIP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, nullptr, nullptr)) return false; - m_stTInfoLink.cbSize = TTTOOLINFOW_V1_SIZE; m_stTInfoLink.uFlags = TTF_TRACK; - m_stTInfoLink.uId = 0x2; + m_stTInfoLink.uId = 0x02; m_stWndTtLink.SendMessageW(TTM_ADDTOOL, 0, reinterpret_cast(&m_stTInfoLink)); m_stWndTtLink.SendMessageW(TTM_SETMAXTIPWIDTH, 0, static_cast(400)); //to allow use of newline \n. + if (m_fHighLatency) //Tooltip for HighLatency mode. + { + if (!m_stWndTtRow.CreateEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, nullptr, TTS_NOANIMATE | TTS_NOFADE | TTS_NOPREFIX | TTS_ALWAYSTIP, + CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, m_hWnd, nullptr)) + return false; + m_stToolInfoRow.cbSize = TTTOOLINFOW_V1_SIZE; + m_stToolInfoRow.uFlags = TTF_TRACK; + m_stToolInfoRow.uId = 0x03; + m_stWndTtRow.SendMessageW(TTM_ADDTOOL, 0, reinterpret_cast(&m_stToolInfoRow)); + } + m_dwGridWidth = lcs.dwListGridWidth; LOGFONTW lf; @@ -957,6 +965,22 @@ void CListEx::TtCellHide() KillTimer(ID_TIMER_TT_CELL_CHECK); } +void CListEx::TtRowShow(bool fShow, UINT uRow) +{ + if (fShow) + { + CPoint ptScreen; + GetCursorPos(&ptScreen); + + static wchar_t warrOffset[32] { L"Row: " }; + swprintf_s(&warrOffset[5], 24, L"%u", uRow); + m_stToolInfoRow.lpszText = warrOffset; + m_stWndTtRow.SendMessageW(TTM_TRACKPOSITION, 0, static_cast(MAKELONG(ptScreen.x - 5, ptScreen.y - 20))); + m_stWndTtRow.SendMessageW(TTM_UPDATETIPTEXT, 0, reinterpret_cast(&m_stToolInfoRow)); + } + m_stWndTtRow.SendMessageW(TTM_TRACKACTIVATE, static_cast(fShow), reinterpret_cast(&m_stToolInfoRow)); +} + void CListEx::MeasureItem(LPMEASUREITEMSTRUCT lpMIS) { //Set row height according to current font's height. @@ -1298,7 +1322,7 @@ void CListEx::OnPaint() DefWindowProcW(WM_PAINT, reinterpret_cast(rDC.m_hDC), static_cast(0)); } -void CListEx::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar * pScrollBar) +void CListEx::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) { if (m_fVirtual && m_fHighLatency) { @@ -1317,6 +1341,7 @@ void CListEx::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar * pScrollBar) Scroll(size); flag = false; } + TtRowShow(false, 0); CMFCListCtrl::OnVScroll(nSBCode, nPos, pScrollBar); } else @@ -1327,6 +1352,7 @@ void CListEx::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar * pScrollBar) si.fMask = SIF_ALL; GetScrollInfo(SB_VERT, &si); uItem = si.nTrackPos; //si.nTrackPos is in fact a row number. + TtRowShow(true, uItem); } } else @@ -1374,8 +1400,8 @@ BOOL CListEx::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT * pResult) void CListEx::OnLvnColumnClick(NMHDR* /*pNMHDR*/, LRESULT* /*pResult*/) { /******************************************************************************* - * Just an empty handler. - * Without it all works fine, but assert triggers in Debug mode, when clicking + * Just an empty handler. + * Without it all works fine, but assert triggers in Debug mode, when clicking * on header, if list is in Virtual mode (LVS_OWNERDATA). * ASSERT((GetStyle() & LVS_OWNERDATA)==0) *******************************************************************************/ @@ -1401,6 +1427,7 @@ void CListEx::OnDestroy() m_stWndTtCell.DestroyWindow(); m_stWndTtLink.DestroyWindow(); + m_stWndTtRow.DestroyWindow(); m_fontList.DeleteObject(); m_fontListUnderline.DeleteObject(); m_penGrid.DeleteObject(); diff --git a/Pepper/ListEx/src/CListEx.h b/Pepper/ListEx/src/CListEx.h index 2a34d64..7c5ff18 100644 --- a/Pepper/ListEx/src/CListEx.h +++ b/Pepper/ListEx/src/CListEx.h @@ -34,8 +34,8 @@ namespace LISTEX::INTERNAL [[nodiscard]] int GetSortColumn()const override; [[nodiscard]] bool GetSortAscending()const override; void HideColumn(int iIndex, bool fHide)override; - int InsertColumn(int nCol, const LVCOLUMN* pColumn); - int InsertColumn(int nCol, LPCTSTR lpszColumnHeading, int nFormat = LVCFMT_LEFT, int nWidth = -1, int nSubItem = -1); + int InsertColumn(int nCol, const LVCOLUMN* pColumn)override; + int InsertColumn(int nCol, LPCTSTR lpszColumnHeading, int nFormat = LVCFMT_LEFT, int nWidth = -1, int nSubItem = -1)override; [[nodiscard]] bool IsCreated()const override; [[nodiscard]] bool IsColumnSortable(int iColumn)override; void ResetSort()override; //Reset all the sort by any column to its default state. @@ -66,6 +66,7 @@ namespace LISTEX::INTERNAL auto ParseItemText(int iItem, int iSubitem)->std::vector; void TtLinkHide(); void TtCellHide(); + void TtRowShow(bool fShow, UINT uRow); //Tooltips for HighLatency mode. void DrawItem(LPDRAWITEMSTRUCT pDIS)override; afx_msg void OnPaint(); afx_msg BOOL OnEraseBkgnd(CDC* pDC); @@ -95,6 +96,8 @@ namespace LISTEX::INTERNAL TTTOOLINFOW m_stTInfoCell { }; //Cells' tool-tip info struct. CWnd m_stWndTtLink; //Link tool-tip window. TTTOOLINFOW m_stTInfoLink { }; //Link's tool-tip info struct. + CWnd m_stWndTtRow { }; //Tooltip window for row in m_fHighLatency mode. + TTTOOLINFOW m_stToolInfoRow { };//Tooltips struct. std::wstring m_wstrTtText { }; //Link's tool-tip current text. HCURSOR m_cursorHand { }; //Hand cursor handle. HCURSOR m_cursorDefault { }; //Standard (default) cursor handle. @@ -105,6 +108,7 @@ namespace LISTEX::INTERNAL long m_lSizeFont { }; //Font size. PFNLVCOMPARE m_pfnCompare { nullptr }; //Pointer to user provided compare func. EListExSortMode m_enDefSortMode { EListExSortMode::SORT_LEX }; //Default sorting mode. + CRect m_rcLinkCurr { }; //Current link's rect; std::unordered_map> m_umapCellTt { }; //Cell's tooltips. std::unordered_map> m_umapCellData { }; //Cell's custom data. std::unordered_map> m_umapCellColor { }; //Cell's colors. @@ -122,7 +126,6 @@ namespace LISTEX::INTERNAL bool m_fTtCellShown { false }; //Is cell's tool-tip shown atm. bool m_fTtLinkShown { false }; //Is link's tool-tip shown atm. bool m_fLDownAtLink { false }; //Left mouse down on link. - CRect m_rcLinkCurr { }; //Current link's rect; }; /*******************Setting a manifest for ComCtl32.dll version 6.***********************/ diff --git a/Pepper/Pepper.cpp b/Pepper/Pepper.cpp index 4336e0f..1fe74fc 100644 --- a/Pepper/Pepper.cpp +++ b/Pepper/Pepper.cpp @@ -29,7 +29,7 @@ BOOL CAboutDlg::OnInitDialog() std::wstring wstrlibpeVer = L"libpe - PE/PE+ binaries library v"; wstrlibpeVer += libpeInfo()->pwszVersion; GetDlgItem(IDC_LINK_LIBPE)->SetWindowTextW(wstrlibpeVer.data()); - wstrlibpeVer = L"HexCtrl - Hex Control for MFC/Win32 v"; + wstrlibpeVer = L"HexCtrl - "; wstrlibpeVer += GetHexCtrlInfo()->pwszVersion; GetDlgItem(IDC_LINK_HEXCTRL)->SetWindowTextW(wstrlibpeVer.data()); diff --git a/Pepper/ViewRightBL.cpp b/Pepper/ViewRightBL.cpp index 0b35bcd..fb06d14 100644 --- a/Pepper/ViewRightBL.cpp +++ b/Pepper/ViewRightBL.cpp @@ -474,10 +474,10 @@ int CViewRightBL::CreateListImportEntry(DWORD dwEntry) LVCOLUMNW stCol { LVCF_FMT, LVCFMT_CENTER }; m_listImportEntry->SetColumn(0, &stCol); m_listImportEntry->SetHdrColumnColor(0, g_clrOffset); - m_listImportEntry->InsertColumn(1, L"Function Name", 0, 175); - m_listImportEntry->InsertColumn(2, L"Ordinal / Hint", 0, 100); - m_listImportEntry->InsertColumn(3, L"AddressOfData", 0, 150); - m_listImportEntry->InsertColumn(4, L"Thunk RVA", 0, 150); + m_listImportEntry->InsertColumn(1, L"Function Name", LVCFMT_CENTER, 175); + m_listImportEntry->InsertColumn(2, L"Ordinal / Hint", LVCFMT_CENTER, 100); + m_listImportEntry->InsertColumn(3, L"AddressOfData", LVCFMT_CENTER, 150); + m_listImportEntry->InsertColumn(4, L"Thunk RVA", LVCFMT_CENTER, 150); } else m_listImportEntry->DeleteAllItems(); @@ -585,12 +585,12 @@ int CViewRightBL::CreateListDelayImportEntry(DWORD dwEntry) LVCOLUMNW stCol { LVCF_FMT, LVCFMT_CENTER }; m_listDelayImportEntry->SetColumn(0, &stCol); m_listDelayImportEntry->SetHdrColumnColor(0, g_clrOffset); - m_listDelayImportEntry->InsertColumn(1, L"Function Name", 0, 300); - m_listDelayImportEntry->InsertColumn(2, L"Ordinal / Hint", 0, 100); + m_listDelayImportEntry->InsertColumn(1, L"Function Name", LVCFMT_CENTER, 300); + m_listDelayImportEntry->InsertColumn(2, L"Ordinal / Hint", LVCFMT_CENTER, 100); m_listDelayImportEntry->InsertColumn(3, L"ImportNameTable AddresOfData", 0, 220); - m_listDelayImportEntry->InsertColumn(4, L"IAT AddresOfData", 0, 200); - m_listDelayImportEntry->InsertColumn(5, L"BoundIAT AddresOfData", 0, 230); - m_listDelayImportEntry->InsertColumn(6, L"UnloadInfoTable AddresOfData", 0, 240); + m_listDelayImportEntry->InsertColumn(4, L"IAT AddresOfData", LVCFMT_CENTER, 200); + m_listDelayImportEntry->InsertColumn(5, L"BoundIAT AddresOfData", LVCFMT_CENTER, 230); + m_listDelayImportEntry->InsertColumn(6, L"UnloadInfoTable AddresOfData", LVCFMT_CENTER, 240); } else m_listDelayImportEntry->DeleteAllItems(); diff --git a/Pepper/include/HexCtrl.h b/Pepper/include/HexCtrl.h index 58ad4f8..45dc7b3 100644 --- a/Pepper/include/HexCtrl.h +++ b/Pepper/include/HexCtrl.h @@ -63,14 +63,15 @@ namespace HEXCTRL [[nodiscard]] virtual auto GetDataSize()const->ULONGLONG = 0; //Get currently set data size. [[nodiscard]] virtual int GetEncoding()const = 0; //Get current code page ID. [[nodiscard]] virtual long GetFontSize()const = 0; //Current font size. - [[nodiscard]] virtual auto GetGroupMode()const->EHexGroupMode = 0; //Retrieves current data grouping mode. + [[nodiscard]] virtual auto GetGroupMode()const->EHexDataSize = 0; //Retrieves current data grouping mode. [[nodiscard]] virtual HMENU GetMenuHandle()const = 0; //Context menu handle. [[nodiscard]] virtual auto GetPagesCount()const->ULONGLONG = 0; //Get count of pages. [[nodiscard]] virtual auto GetPagePos()const->ULONGLONG = 0; //Get current page a cursor stays at. [[nodiscard]] virtual DWORD GetPageSize()const = 0; //Current page size. - [[nodiscard]] virtual auto GetSelection()const->std::vector = 0; //Gets current selection. + [[nodiscard]] virtual auto GetSelection()const->std::vector = 0; //Get current selection. [[nodiscard]] virtual HWND GetWindowHandle(EHexWnd enWnd)const = 0; //Retrieves control's window/dialog handle. virtual void GoToOffset(ULONGLONG ullOffset, int iRelPos = 0) = 0; //Go (scroll) to a given offset. + [[nodiscard]] virtual bool HasSelection()const = 0; //Does currently have any selection or not. [[nodiscard]] virtual auto HitTest(POINT pt, bool fScreen = true)const->std::optional = 0; //HitTest given point. [[nodiscard]] virtual bool IsCmdAvail(EHexCmd enCmd)const = 0; //Is given Cmd currently available (can be executed)? [[nodiscard]] virtual bool IsCreated()const = 0; //Shows whether control is created or not. @@ -88,7 +89,7 @@ namespace HEXCTRL virtual void SetEncoding(int iCodePage) = 0; //Code-page for text area. virtual void SetFont(const LOGFONTW* pLogFont) = 0; //Set the control's new font. This font has to be monospaced. virtual void SetFontSize(UINT uiSize) = 0; //Set the control's font size. - virtual void SetGroupMode(EHexGroupMode enMode) = 0; //Set current "Group Data By" mode. + virtual void SetGroupMode(EHexDataSize enMode) = 0; //Set current "Group Data By" mode. virtual void SetMutable(bool fEnable) = 0; //Enable or disable mutable/editable mode. virtual void SetOffsetMode(bool fHex) = 0; //Set offset being shown as Hex or as Decimal. virtual void SetPageSize(DWORD dwSize, std::wstring_view wstrName = L"Page") = 0; //Set page size and name to draw the lines in-between. diff --git a/Pepper/include/HexCtrlDefs.h b/Pepper/include/HexCtrlDefs.h index d750177..37c457e 100644 --- a/Pepper/include/HexCtrlDefs.h +++ b/Pepper/include/HexCtrlDefs.h @@ -16,7 +16,7 @@ namespace HEXCTRL /******************************************************************************************** * EHexCmd - Enum of the commands that can be executed within HexCtrl, used in ExecuteCmd. * ********************************************************************************************/ - enum class EHexCmd : WORD + enum class EHexCmd : std::uint8_t { CMD_DLG_SEARCH = 0x01, CMD_SEARCH_NEXT, CMD_SEARCH_PREV, CMD_NAV_DLG_GOTO, CMD_NAV_REPFWD, CMD_NAV_REPBKW, CMD_NAV_DATABEG, CMD_NAV_DATAEND, @@ -38,26 +38,18 @@ namespace HEXCTRL /******************************************************************************************** * EHexCreateMode - Enum of HexCtrl creation mode. * ********************************************************************************************/ - enum class EHexCreateMode : WORD + enum class EHexCreateMode : std::uint8_t { CREATE_CHILD, CREATE_POPUP, CREATE_CUSTOMCTRL }; - /******************************************************************************************** - * EHexGroupMode - current data mode representation. * - ********************************************************************************************/ - enum class EHexGroupMode : WORD - { - ASBYTE = 1, ASWORD = 2, ASDWORD = 4, ASQWORD = 8 - }; - /******************************************************************************************** * EHexDataMode - Enum of the working data mode, used in HEXDATASTRUCT in SetData. * * DATA_MEMORY: Default standard data mode. * * DATA_MSG: Data is handled through WM_NOTIFY messages in handler window. * * DATA_VIRTUAL: Data is handled through IHexVirtData interface by derived class. * ********************************************************************************************/ - enum class EHexDataMode : WORD + enum class EHexDataMode : std::uint8_t { DATA_MEMORY, DATA_MSG, DATA_VIRTUAL }; @@ -65,7 +57,7 @@ namespace HEXCTRL /******************************************************************************************** * EHexWnd - HexControl's windows. * ********************************************************************************************/ - enum class EHexWnd : WORD + enum class EHexWnd : std::uint8_t { WND_MAIN, DLG_BKMMANAGER, DLG_DATAINTERP, DLG_FILLDATA, DLG_OPERS, DLG_SEARCH, DLG_ENCODING, DLG_GOTO @@ -156,14 +148,12 @@ namespace HEXCTRL COLORREF clrTextCaption { RGB(0, 0, 180) }; //Caption text color COLORREF clrTextInfoRect { GetSysColor(COLOR_WINDOWTEXT) }; //Text color of the bottom "Info" rect. COLORREF clrTextCaret { RGB(255, 255, 255) }; //Caret text color. - COLORREF clrTextTooltip { GetSysColor(COLOR_INFOTEXT) }; //Tooltip text color. COLORREF clrBk { GetSysColor(COLOR_WINDOW) }; //Background color. COLORREF clrBkSelect { GetSysColor(COLOR_HIGHLIGHT) }; //Background color of the selected Hex/ASCII. COLORREF clrBkDataInterp { RGB(147, 58, 22) }; //Data Interpreter Bk color. COLORREF clrBkInfoRect { GetSysColor(COLOR_BTNFACE) }; //Background color of the bottom "Info" rect. COLORREF clrBkCaret { RGB(0, 0, 255) }; //Caret background color. COLORREF clrBkCaretSelect { RGB(0, 0, 200) }; //Caret background color in selection. - COLORREF clrBkTooltip { GetSysColor(COLOR_INFOBK) }; //Tooltip background color. }; /******************************************************************************************** @@ -218,10 +208,14 @@ namespace HEXCTRL { ULONGLONG ullOffset { }; //Offset. bool fIsAscii { false }; //Is cursor at ASCII part or at Hex. + bool fIsHigh { false }; //Is it High or Low part of the byte. }; /******************************************************************************************** * HEXVISSTRUCT - Offset visibility struct, used in IsOffsetVisible method. * + * -1 - Offset is higher, or at the left, of the visible area. * + * 1 - lower, or at the right. * + * 0 - visible. * ********************************************************************************************/ struct HEXVISSTRUCT { @@ -233,19 +227,28 @@ namespace HEXCTRL /******************************************************************************************** * EHexModifyMode - Enum of the data modification mode, used in HEXMODIFY. * ********************************************************************************************/ - enum class EHexModifyMode : WORD + enum class EHexModifyMode : std::uint8_t + { + MODIFY_DEFAULT, MODIFY_REPEAT, MODIFY_OPERATION, MODIFY_RANDOM + }; + + /******************************************************************************************** + * EHexOperMode - Data Operation mode, used in EHexModifyMode::MODIFY_OPERATION mode. * + ********************************************************************************************/ + enum class EHexOperMode : std::uint8_t { - MODIFY_DEFAULT, MODIFY_REPEAT, MODIFY_OPERATION + OPER_ASSIGN, OPER_OR, OPER_XOR, OPER_AND, OPER_NOT, OPER_SHL, OPER_SHR, OPER_ROTL, + OPER_ROTR, OPER_SWAP, OPER_ADD, OPER_SUBTRACT, OPER_MULTIPLY, OPER_DIVIDE, + OPER_CEILING, OPER_FLOOR }; /******************************************************************************************** - * EHexOperMode - Enum of the data operation mode, used in HEXMODIFY when * - * HEXMODIFY::enModifyMode is set to MODIFY_OPERATION. * + * EHexDataSize - Data size to operate on, used in EHexModifyMode::MODIFY_OPERATION mode. * + * Also used to set data grouping mode, in SetGroupMode method. * ********************************************************************************************/ - enum class EHexOperMode : WORD + enum class EHexDataSize : std::uint8_t { - OPER_OR = 0x01, OPER_XOR, OPER_AND, OPER_NOT, OPER_SHL, OPER_SHR, - OPER_ADD, OPER_SUBTRACT, OPER_MULTIPLY, OPER_DIVIDE + SIZE_BYTE = 0x01, SIZE_WORD = 0x02, SIZE_DWORD = 0x04, SIZE_QWORD = 0x08 }; /******************************************************************************************** @@ -256,17 +259,18 @@ namespace HEXCTRL * For example : if SUM(vecSpan.ullSize) = 9, ullDataSize = 3 and enModifyMode is set to * * EHexModifyMode::MODIFY_REPEAT, bytes in memory at vecSpan.ullOffset position are * * 123456789, and bytes pointed to by pData are 345, then, after modification, bytes at * - * vecSpan.ullOffset will be 345345345. If enModifyMode is equal to * - * EHexModifyMode::MODIFY_OPERATION then enOperMode comes into play, showing what kind of * - * operation must be performed on data. * + * vecSpan.ullOffset will be 345345345. * + * If enModifyMode is equal to MODIFY_OPERATION then enOperMode comes into play, showing * + * what kind of operation must be performed on data, with the enOperSize showing the size. * ********************************************************************************************/ struct HEXMODIFY { EHexModifyMode enModifyMode { EHexModifyMode::MODIFY_DEFAULT }; //Modify mode. EHexOperMode enOperMode { }; //Operation mode, used only if enModifyMode == MODIFY_OPERATION. - std::byte* pData { }; //Pointer to a data to be set. - ULONGLONG ullDataSize { }; //Size of the data pData is pointing to. + EHexDataSize enOperSize { }; //Operation data size. + std::byte* pData { }; //Pointer to a data to be set. + ULONGLONG ullDataSize { }; //Size of the data pData is pointing to. std::vector vecSpan { }; //Vector of data offsets and sizes. - bool fRedraw { true }; //Redraw HexCtrl's window after data changes? + bool fBigEndian { false }; //Treat the data being modified as a big endian, used only in MODIFY_OPERATION mode. }; }; \ No newline at end of file diff --git a/Pepper/res/Pepper.rc b/Pepper/res/Pepper.rc index 4050b7d..37267a1 100644 --- a/Pepper/res/Pepper.rc +++ b/Pepper/res/Pepper.rc @@ -138,17 +138,17 @@ END // Dialog // -IDD_ABOUTBOX DIALOGEX 0, 0, 227, 96 +IDD_ABOUTBOX DIALOGEX 0, 0, 229, 93 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "About Pepper..." FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN ICON IDR_MAINFRAME,IDC_STATIC,11,14,21,20 - DEFPUSHBUTTON "OK",IDOK,166,72,50,14,WS_GROUP - CONTROL "<>",IDC_LINK_PEPPER,"MfcLink",WS_TABSTOP,37,33,173,11 - CONTROL "<>",IDC_LINK_LIBPE,"MfcLink",WS_TABSTOP,37,44,175,11 - CONTROL "<>",IDC_LINK_HEXCTRL,"MfcLink",WS_TABSTOP,37,55,175,11 - LTEXT "Pepper - a free PE/PE+ binaries viewer. Available under the MIT license.",IDC_STATIC,38,15,130,18 + DEFPUSHBUTTON "OK",IDOK,166,68,50,14,WS_GROUP + CONTROL "<>",IDC_LINK_PEPPER,"MfcLink",WS_TABSTOP,37,28,173,11 + CONTROL "<>",IDC_LINK_LIBPE,"MfcLink",WS_TABSTOP,37,39,175,11 + CONTROL "<>",IDC_LINK_HEXCTRL,"MfcLink",WS_TABSTOP,37,50,175,11 + LTEXT "Pepper - an open-source PE/PE+ binaries viewer.",IDC_STATIC,38,15,160,8 END @@ -162,8 +162,6 @@ GUIDELINES DESIGNINFO BEGIN IDD_ABOUTBOX, DIALOG BEGIN - RIGHTMARGIN, 221 - BOTTOMMARGIN, 93 END END #endif // APSTUDIO_INVOKED