Skip to content

Commit

Permalink
Added the MultiTree Control code.
Browse files Browse the repository at this point in the history
  • Loading branch information
BeneficialCode committed Oct 12, 2024
1 parent 8f9043e commit 085b7b4
Show file tree
Hide file tree
Showing 3 changed files with 545 additions and 7 deletions.
18 changes: 17 additions & 1 deletion WinArk/ImportsHandling.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "stdafx.h"
#include "resource.h"
#include "ImportsHandling.h"
#include "Architecture.h"

Expand Down Expand Up @@ -75,5 +76,20 @@ ImportsHandling::Icon ImportsHandling::GetAppropiateIcon(bool valid) {
}

ImportsHandling::ImportsHandling(CMultiSelectTreeViewCtrl& treeImports):TreeImports(treeImports) {

CDCHandle dc = CWindow(::GetDesktopWindow()).GetDC();
int bits = dc.GetDeviceCaps(BITSPIXEL);
const UINT flags = bits > 16 ? ILC_COLOR32 : (ILC_COLOR24 | ILC_MASK);
TreeIcons.Create(16, 16, flags, 3, 1);

UINT icons[] = {
IDI_CHECK,IDI_SCYLLA_WARNING,IDI_SCYLLA_ERROR
};

for (UINT icon : icons) {
TreeIcons.AddIcon(AtlLoadIconImage(icon, 0, 16, 16));
}
}

ImportsHandling::~ImportsHandling() {
TreeIcons.Destroy();
}
12 changes: 6 additions & 6 deletions WinArk/ImportsHandling.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ class ImportsHandling
std::map<DWORD_PTR, ImportModuleThunk> NewModuleMap;

ImportsHandling(CMultiSelectTreeViewCtrl& treeImports);

~ImportsHandling();
private:
DWORD NumberOfFunctions;
DWORD NumberOfFunctions = 0;

unsigned int m_ThunkCount;
unsigned int m_InvalidThunkCount;
unsigned int m_SuspectThunkCount;
unsigned int m_ThunkCount = 0;
unsigned int m_InvalidThunkCount = 0;
unsigned int m_SuspectThunkCount = 0;

struct TreeItemData
{
Expand All @@ -34,7 +34,7 @@ class ImportsHandling

TreeItemData* GetItemData(CTreeItem item);

WCHAR Text[512];
WCHAR Text[512] = { 0 };

CMultiSelectTreeViewCtrl& TreeImports;
CImageList TreeIcons;
Expand Down
Loading

0 comments on commit 085b7b4

Please sign in to comment.