Skip to content

Commit

Permalink
Replace custom registration code in favor of ATL generated code (firs…
Browse files Browse the repository at this point in the history
…t draft) #115.
  • Loading branch information
end2endzone committed Jan 1, 2024
1 parent 99c7da8 commit 22d3d87
Show file tree
Hide file tree
Showing 14 changed files with 307 additions and 552 deletions.
81 changes: 80 additions & 1 deletion src/resource.rc.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,81 @@
@LICENSE_CPLUSPLUS_HEADER@
appicon ICON "@CMAKE_SOURCE_DIR@/resources/icons/shellanything.ico"
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// English (United States) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE
BEGIN
"resource.h\0"
END

2 TEXTINCLUDE
BEGIN
"#include ""winres.h""\r\n"
"\0"
END

3 TEXTINCLUDE
BEGIN
"1 TYPELIB ""shellext.tlb""\r\n"
"\0"
END

#endif // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// REGISTRY
//

IDR_SHELLANYTHING REGISTRY "shellext.rgs"


/////////////////////////////////////////////////////////////////////////////
//
// Icon
//

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON_MAIN ICON "@CMAKE_SOURCE_DIR@/resources/icons/shellanything.ico"


#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
1 TYPELIB "shellext.tlb"

/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

185 changes: 0 additions & 185 deletions src/shellextension/CClassFactory.cpp

This file was deleted.

46 changes: 0 additions & 46 deletions src/shellextension/CClassFactory.h

This file was deleted.

8 changes: 2 additions & 6 deletions src/shellextension/CContextMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
#include "rapidassist/unicode.h"
#include "rapidassist/environment.h"

OBJECT_ENTRY_AUTO(CLSID_ShellAnything, CContextMenu)

static const GUID CLSID_UNDOCUMENTED_01 = { 0x924502a7, 0xcc8e, 0x4f60, { 0xae, 0x1f, 0xf7, 0x0c, 0x0a, 0x2b, 0x7a, 0x7c } };

void CContextMenu::BuildMenuTree(HMENU hMenu, shellanything::Menu* menu, UINT& insert_pos, bool& next_menu_is_column)
Expand Down Expand Up @@ -305,17 +307,11 @@ CContextMenu::CContextMenu()
m_IsBackGround = false;
m_BuildMenuTreeCount = 0;
m_previousMenu = 0;

// Increment the dll's reference counter.
DllAddRef();
}

CContextMenu::~CContextMenu()
{
SA_LOG(INFO) << __FUNCTION__ << "(), delete instance " << ToHexString(this);

// Decrement the dll's reference counter.
DllRelease();
}

HRESULT STDMETHODCALLTYPE CContextMenu::QueryContextMenu(HMENU hMenu, UINT menu_index, UINT first_command_id, UINT max_command_id, UINT flags)
Expand Down
Loading

0 comments on commit 22d3d87

Please sign in to comment.