mirror of
https://github.com/T800G/CBXShell.git
synced 2026-06-17 01:50:28 +00:00
Add files via upload
This commit is contained in:
parent
fa1f16ea48
commit
68c98b8625
13 changed files with 1398 additions and 1 deletions
33
CBXManager/About.h
Normal file
33
CBXManager/About.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#ifndef _ABOUT_0D23B3C4_9FA8_49E8_880D_5B596CC1EB28_
|
||||
#define _ABOUT_0D23B3C4_9FA8_49E8_880D_5B596CC1EB28_
|
||||
#pragma once
|
||||
#include "resource.h"
|
||||
|
||||
class CAboutDlg : public CDialogImpl<CAboutDlg>
|
||||
{
|
||||
public:
|
||||
enum { IDD = IDD_ABOUTBOX };
|
||||
|
||||
BEGIN_MSG_MAP(CAboutDlg)
|
||||
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
||||
MESSAGE_HANDLER(WM_LBUTTONDOWN, OnClick)
|
||||
MESSAGE_HANDLER(WM_CTLCOLORDLG, OnDlgColor)
|
||||
MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnDlgColor)
|
||||
COMMAND_ID_HANDLER(IDOK, OnCloseCmd)
|
||||
COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd)
|
||||
END_MSG_MAP()
|
||||
|
||||
LRESULT OnDlgColor(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)
|
||||
{
|
||||
return (LRESULT)GetStockObject(WHITE_BRUSH);
|
||||
}
|
||||
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
|
||||
{
|
||||
CenterWindow(GetParent());
|
||||
SetWindowLongW(GWL_STYLE, WS_BORDER);
|
||||
return TRUE;
|
||||
}
|
||||
LRESULT OnClick(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/){EndDialog(IDOK);return 0;}
|
||||
LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/){EndDialog(wID);return 0;}
|
||||
};
|
||||
#endif//_ABOUT_0D23B3C4_9FA8_49E8_880D_5B596CC1EB28_
|
||||
63
CBXManager/CBXManager.cpp
Normal file
63
CBXManager/CBXManager.cpp
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
#include "stdafx.h"
|
||||
#include "resource.h"
|
||||
|
||||
#include "tools.h"
|
||||
#include "MainDlg.h"
|
||||
|
||||
CAppModule _Module;
|
||||
|
||||
int Run(LPTSTR /*lpstrCmdLine*/ = NULL, int nCmdShow = SW_SHOWDEFAULT)
|
||||
{
|
||||
CMessageLoop theLoop;
|
||||
_Module.AddMessageLoop(&theLoop);
|
||||
|
||||
CMainDlg dlgMain;
|
||||
|
||||
if(dlgMain.Create(NULL) == NULL)
|
||||
{
|
||||
ATLTRACE(_T("Main dialog creation failed!\n"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
dlgMain.ShowWindow(nCmdShow);
|
||||
|
||||
int nRet = theLoop.Run();
|
||||
|
||||
_Module.RemoveMessageLoop();
|
||||
return nRet;
|
||||
}
|
||||
|
||||
|
||||
int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int nCmdShow)
|
||||
{
|
||||
// one manager instance per user
|
||||
CHandle mtx(CreateMutex(NULL, FALSE, CBX_MGRMUTEX));
|
||||
if (GetLastError()==ERROR_ALREADY_EXISTS)
|
||||
{
|
||||
MessageBox(HWND_DESKTOP, _T("CBX Shell Manager is already running\n"), _T("Warning"),
|
||||
MB_OK | MB_ICONWARNING | MB_SYSTEMMODAL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
HRESULT hRes = ::CoInitialize(NULL);
|
||||
// If you are running on NT 4.0 or higher you can use the following call instead to
|
||||
// make the EXE free threaded. This means that calls come in on a random RPC thread.
|
||||
// HRESULT hRes = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
|
||||
ATLASSERT(SUCCEEDED(hRes));
|
||||
|
||||
// this resolves ATL window thunking problem when Microsoft Layer for Unicode (MSLU) is used
|
||||
::DefWindowProc(NULL, 0, 0, 0L);
|
||||
|
||||
AtlInitCommonControls(ICC_BAR_CLASSES); // add flags to support other controls
|
||||
|
||||
hRes = _Module.Init(NULL, hInstance);
|
||||
ATLASSERT(SUCCEEDED(hRes));
|
||||
|
||||
int nRet = Run(lpstrCmdLine, nCmdShow);
|
||||
|
||||
_Module.Term();
|
||||
::CoUninitialize();
|
||||
|
||||
return nRet;
|
||||
}
|
||||
1
CBXManager/CBXManager.h
Normal file
1
CBXManager/CBXManager.h
Normal file
|
|
@ -0,0 +1 @@
|
|||
// CBXManager.h
|
||||
BIN
CBXManager/CBXManager.ico
Normal file
BIN
CBXManager/CBXManager.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
85
CBXManager/CBXManager.rc
Normal file
85
CBXManager/CBXManager.rc
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
// Generated by ResEdit 1.5.4
|
||||
// Copyright (C) 2006-2010
|
||||
// http://www.resedit.net
|
||||
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include <richedit.h>
|
||||
#include <atlres.h>
|
||||
#include "resource.h"
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Dialog resources
|
||||
//
|
||||
IDD_ABOUTBOX DIALOGEX 0, 0, 169, 45
|
||||
STYLE DS_SETFONT | WS_CAPTION | WS_POPUP | WS_SYSMENU
|
||||
CAPTION "About"
|
||||
FONT 8, "MS Shell Dlg 2", 400, 0, 1
|
||||
{
|
||||
GROUPBOX "", IDC_STATIC, 59, 36, 55, 18
|
||||
CTEXT "OK", IDC_STATIC, 76, 42, 23, 10, SS_CENTER, WS_EX_TRANSPARENT
|
||||
CTEXT "CBX Shell Manager\nversion 4.6.2\nT800 Productions © 2011", IDC_STATIC, 10, 9, 152, 25, SS_CENTER
|
||||
ICON IDR_MAINFRAME, IDC_STATIC, 13, 11, 11, 10, SS_ICON
|
||||
}
|
||||
|
||||
|
||||
|
||||
IDD_MAINDLG DIALOG 0, 0, 190, 194
|
||||
STYLE DS_CONTEXTHELP | DS_SETFONT | WS_BORDER | WS_CAPTION | WS_DLGFRAME | WS_SYSMENU
|
||||
CAPTION "CBX Shell Manager"
|
||||
FONT 8, "Ms Shell Dlg"
|
||||
{
|
||||
GROUPBOX "File types", IDC_TH_GROUP, 10, 10, 170, 82
|
||||
GROUPBOX "Advanced", IDC_SORT_ADVOPTGROUP, 10, 100, 170, 56
|
||||
PUSHBUTTON "Cancel", IDCANCEL, 70, 170, 50, 14
|
||||
PUSHBUTTON "Apply", IDC_APPLY, 130, 170, 50, 14
|
||||
DEFPUSHBUTTON "OK", IDOK, 10, 170, 50, 14
|
||||
AUTOCHECKBOX "CBZ Image Archives", IDC_CB_CBZ, 20, 25, 145, 10
|
||||
AUTOCHECKBOX "ZIP Archives", IDC_CB_ZIP, 20, 40, 150, 8
|
||||
AUTOCHECKBOX "CBR Image Archives", IDC_CB_CBR, 20, 60, 150, 10
|
||||
AUTOCHECKBOX "RAR Archives", IDC_CB_RAR, 20, 75, 150, 8
|
||||
AUTOCHECKBOX "Sort images alphabetically", IDC_CB_SORT, 20, 115, 155, 8
|
||||
LTEXT "Uncheck to sort images by archive order.\nRequired to display custom thumbnail.", IDC_SORT_DESC, 30, 130, 145, 18, SS_LEFT, WS_EX_TRANSPARENT
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Icon resources
|
||||
//
|
||||
IDR_MAINFRAME ICON "CBXManager.ico"
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Version Information resources
|
||||
//
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 4,6,2,0
|
||||
PRODUCTVERSION 4,6,2,0
|
||||
FILEOS VOS__WINDOWS32
|
||||
FILETYPE VFT_APP
|
||||
FILESUBTYPE VFT2_UNKNOWN
|
||||
FILEFLAGSMASK 0x00000000
|
||||
FILEFLAGS 0x00000000
|
||||
{
|
||||
BLOCK "StringFileInfo"
|
||||
{
|
||||
BLOCK "040904b0"
|
||||
{
|
||||
VALUE "CompanyName", "T800 Productions\0"
|
||||
VALUE "FileDescription", "CBX Shell Manager 32-bit\0"
|
||||
VALUE "FileVersion", "4.6.2.0\0"
|
||||
VALUE "LegalCopyright", "T800 Productions © 2011\0"
|
||||
VALUE "ProductName", "CBX Shell\0"
|
||||
VALUE "ProductVersion", "4.6.2.0\0"
|
||||
}
|
||||
}
|
||||
BLOCK "VarFileInfo"
|
||||
{
|
||||
VALUE "Translation", 0x0409, 0x04B0
|
||||
}
|
||||
}
|
||||
469
CBXManager/CBXManager.vcproj
Normal file
469
CBXManager/CBXManager.vcproj
Normal file
|
|
@ -0,0 +1,469 @@
|
|||
<?xml version="1.0" encoding="windows-1250"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9,00"
|
||||
Name="CBXManager"
|
||||
ProjectGUID="{D3E3653C-61EC-4AC8-A283-F9784128948C}"
|
||||
RootNamespace="CBXManager"
|
||||
TargetFrameworkVersion="196613"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
<Platform
|
||||
Name="x64"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="false"
|
||||
TargetEnvironment="1"
|
||||
GenerateStublessProxies="true"
|
||||
TypeLibraryName="$(IntDir)/CBXManager.tlb"
|
||||
HeaderFileName="CBXManager.h"
|
||||
DLLDataFileName=""
|
||||
InterfaceIdentifierFileName="CBXManager_i.c"
|
||||
ProxyFileName="CBXManager_p.c"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_WINDOWS;STRICT;_DEBUG"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="$(IntDir)"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="false"
|
||||
TargetEnvironment="3"
|
||||
GenerateStublessProxies="true"
|
||||
TypeLibraryName="$(IntDir)/CBXManager.tlb"
|
||||
HeaderFileName="CBXManager.h"
|
||||
DLLDataFileName=""
|
||||
InterfaceIdentifierFileName="CBXManager_i.c"
|
||||
ProxyFileName="CBXManager_p.c"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_WINDOWS;STRICT;_DEBUG"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG;_WIN64"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="$(IntDir)"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
ATLMinimizesCRunTimeLibraryUsage="true"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="false"
|
||||
TargetEnvironment="1"
|
||||
GenerateStublessProxies="true"
|
||||
TypeLibraryName="$(IntDir)/CBXManager.tlb"
|
||||
HeaderFileName="CBXManager.h"
|
||||
DLLDataFileName=""
|
||||
InterfaceIdentifierFileName="CBXManager_i.c"
|
||||
ProxyFileName="CBXManager_p.c"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="1"
|
||||
InlineFunctionExpansion="1"
|
||||
FavorSizeOrSpeed="2"
|
||||
OmitFramePointers="true"
|
||||
EnableFiberSafeOptimizations="true"
|
||||
WholeProgramOptimization="true"
|
||||
PreprocessorDefinitions="WIN32;_WINDOWS;STRICT;NDEBUG"
|
||||
ExceptionHandling="1"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="$(IntDir)"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkIncremental="1"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
ATLMinimizesCRunTimeLibraryUsage="true"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="false"
|
||||
TargetEnvironment="3"
|
||||
GenerateStublessProxies="true"
|
||||
TypeLibraryName="$(IntDir)/CBXManager.tlb"
|
||||
HeaderFileName="CBXManager.h"
|
||||
DLLDataFileName=""
|
||||
InterfaceIdentifierFileName="CBXManager_i.c"
|
||||
ProxyFileName="CBXManager_p.c"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="1"
|
||||
InlineFunctionExpansion="1"
|
||||
FavorSizeOrSpeed="2"
|
||||
OmitFramePointers="true"
|
||||
EnableFiberSafeOptimizations="true"
|
||||
WholeProgramOptimization="true"
|
||||
PreprocessorDefinitions="WIN32;_WINDOWS;STRICT;NDEBUG"
|
||||
ExceptionHandling="1"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG;_WIN64"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="$(IntDir)"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkIncremental="1"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\CBXManager.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\stdafx.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\stdafx.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\tools.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="dialog"
|
||||
Filter="h;hpp;hxx;hm;inl;inc"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\About.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\MainDlg.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\MainDlg.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\RegManager.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;manifest"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\res\CBXManager.ico"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CBXManager.rc"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\resource.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
183
CBXManager/MainDlg.cpp
Normal file
183
CBXManager/MainDlg.cpp
Normal file
|
|
@ -0,0 +1,183 @@
|
|||
// MainDlg.cpp : implementation of the CMainDlg class
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "resource.h"
|
||||
|
||||
#include "about.h"
|
||||
#include "MainDlg.h"
|
||||
|
||||
|
||||
BOOL CMainDlg::PreTranslateMessage(MSG* pMsg) { return CWindow::IsDialogMessage(pMsg); }
|
||||
BOOL CMainDlg::OnIdle() { return FALSE;}
|
||||
|
||||
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
|
||||
{
|
||||
// center the dialog on the screen
|
||||
CenterWindow();
|
||||
|
||||
// set icons
|
||||
HICON hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME),
|
||||
IMAGE_ICON, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR);
|
||||
SetIcon(hIcon, TRUE);
|
||||
HICON hIconSmall = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME),
|
||||
IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
|
||||
SetIcon(hIconSmall, FALSE);
|
||||
|
||||
// register object for message filtering and idle updates
|
||||
CMessageLoop* pLoop = _Module.GetMessageLoop();
|
||||
ATLASSERT(pLoop != NULL);
|
||||
pLoop->AddMessageFilter(this);
|
||||
pLoop->AddIdleHandler(this);
|
||||
|
||||
UIAddChildWindowContainer(m_hWnd);
|
||||
|
||||
//add 'About' item to sys menu
|
||||
ATLASSERT(IDC_APPABOUT < 0xF000);
|
||||
CMenu pSysMenu=GetSystemMenu(FALSE);
|
||||
if (!pSysMenu.IsNull())
|
||||
{
|
||||
pSysMenu.AppendMenu(MF_SEPARATOR);
|
||||
pSysMenu.AppendMenu(MF_STRING, IDC_APPABOUT, _T("About"));
|
||||
}
|
||||
|
||||
InitUI();
|
||||
|
||||
//set focus to Cancel btn
|
||||
GotoDlgCtrl(GetDlgItem(IDCANCEL));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void CMainDlg::InitUI()
|
||||
{
|
||||
//Button_GetCheck BST_CHECKED : BST_UNCHECKED equals TRUE: FALSE
|
||||
Button_SetCheck(GetDlgItem(IDC_CB_ZIP), m_reg.HasTH(CBX_ZIP));
|
||||
Button_SetCheck(GetDlgItem(IDC_CB_CBZ), m_reg.HasTH(CBX_CBZ));
|
||||
Button_SetCheck(GetDlgItem(IDC_CB_RAR), m_reg.HasTH(CBX_RAR));
|
||||
Button_SetCheck(GetDlgItem(IDC_CB_CBR), m_reg.HasTH(CBX_CBR));
|
||||
Button_SetCheck(GetDlgItem(IDC_CB_SORT), m_reg.IsSortOpt());//CBX_SORT
|
||||
}
|
||||
|
||||
//check ui state,compare to registry state->if!= refresh
|
||||
void CMainDlg::OnApplyImpl()
|
||||
{
|
||||
BOOL bRet, bRefresh=FALSE;
|
||||
|
||||
//sort option
|
||||
bRet=(BST_CHECKED==Button_GetCheck(GetDlgItem(IDC_CB_SORT)));
|
||||
if (bRet!=m_reg.IsSortOpt())
|
||||
{
|
||||
bRefresh=TRUE;
|
||||
m_reg.SetSortOpt(bRet);
|
||||
}
|
||||
|
||||
//thumbnail handlers
|
||||
bRet=(BST_CHECKED==Button_GetCheck(GetDlgItem(IDC_CB_ZIP)));
|
||||
if (bRet!=m_reg.HasTH(CBX_ZIP))
|
||||
{
|
||||
bRefresh=TRUE;
|
||||
m_reg.SetHandlers(CBX_ZIP, bRet);
|
||||
}
|
||||
bRet=(BST_CHECKED==Button_GetCheck(GetDlgItem(IDC_CB_CBZ)));
|
||||
if (bRet!=m_reg.HasTH(CBX_CBZ))
|
||||
{
|
||||
bRefresh=TRUE;
|
||||
m_reg.SetHandlers(CBX_CBZ, bRet);
|
||||
}
|
||||
bRet=(BST_CHECKED==Button_GetCheck(GetDlgItem(IDC_CB_RAR)));
|
||||
if (bRet!=m_reg.HasTH(CBX_RAR))
|
||||
{
|
||||
bRefresh=TRUE;
|
||||
m_reg.SetHandlers(CBX_RAR, bRet);
|
||||
}
|
||||
bRet=(BST_CHECKED==Button_GetCheck(GetDlgItem(IDC_CB_CBR)));
|
||||
if (bRet!=m_reg.HasTH(CBX_CBR))
|
||||
{
|
||||
bRefresh=TRUE;
|
||||
m_reg.SetHandlers(CBX_CBR, bRet);
|
||||
}
|
||||
|
||||
if (bRefresh)
|
||||
{
|
||||
ATLTRACE("refreshing FS\n");
|
||||
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST | SHCNF_FLUSHNOWAIT | SHCNF_NOTIFYRECURSIVE, NULL, NULL);
|
||||
}
|
||||
|
||||
InitUI();//reload
|
||||
}
|
||||
|
||||
LRESULT CMainDlg::OnApply(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
|
||||
{
|
||||
OnApplyImpl();
|
||||
return 0;
|
||||
}
|
||||
|
||||
LRESULT CMainDlg::OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
|
||||
{
|
||||
OnApplyImpl();
|
||||
CloseDialog(wID);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
LRESULT CMainDlg::OnSysCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
||||
{
|
||||
if (wParam!=IDC_APPABOUT) return ::DefWindowProc(m_hWnd, uMsg, wParam, lParam);
|
||||
CAboutDlg _a;
|
||||
_a.DoModal(m_hWnd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
LRESULT CMainDlg::OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
|
||||
{
|
||||
// unregister message filtering and idle updates
|
||||
CMessageLoop* pLoop = _Module.GetMessageLoop();
|
||||
ATLASSERT(pLoop != NULL);
|
||||
pLoop->RemoveMessageFilter(this);
|
||||
pLoop->RemoveIdleHandler(this);
|
||||
return 0;
|
||||
}
|
||||
|
||||
LRESULT CMainDlg::OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
|
||||
{
|
||||
CloseDialog(wID);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CMainDlg::CloseDialog(int nVal)
|
||||
{
|
||||
DestroyWindow();
|
||||
::PostQuitMessage(nVal);
|
||||
}
|
||||
|
||||
LRESULT CMainDlg::OnAppHelp(LPHELPINFO lphi)
|
||||
{
|
||||
switch (lphi->iCtrlId)
|
||||
{
|
||||
case IDC_TH_GROUP:
|
||||
case IDC_CB_CBZ:
|
||||
case IDC_CB_CBR:
|
||||
case IDC_CB_ZIP:
|
||||
case IDC_CB_RAR:
|
||||
// '#' anchors must use id attribute
|
||||
HtmlHelp(m_hWnd, _T("CBXShellHelp.chm::manager.html#optth"), HH_DISPLAY_TOPIC, NULL);
|
||||
break;
|
||||
|
||||
case IDC_SORT_ADVOPTGROUP:
|
||||
HtmlHelp(m_hWnd, _T("CBXShellHelp.chm::manager.html#advopt"), HH_DISPLAY_TOPIC, NULL);
|
||||
break;
|
||||
|
||||
case IDC_CB_SORT:
|
||||
case IDC_SORT_DESC:
|
||||
ATLTRACE("HH sort opt\n");
|
||||
HtmlHelp(m_hWnd, _T("CBXShellHelp.chm::FAQ.html#custth"), HH_DISPLAY_TOPIC, NULL);
|
||||
break;
|
||||
|
||||
default:
|
||||
ATLTRACE("HH default\n");
|
||||
HtmlHelp(m_hWnd, _T("CBXShellHelp.chm::manager.html"), HH_DISPLAY_TOPIC, NULL);//about?
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
57
CBXManager/MainDlg.h
Normal file
57
CBXManager/MainDlg.h
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
#ifndef _MAINDLG_A8394D0D_EE2B_4A00_9FAC_AB8D3B03F078_
|
||||
#define _MAINDLG_A8394D0D_EE2B_4A00_9FAC_AB8D3B03F078_
|
||||
|
||||
#include "tools.h"
|
||||
#include "regmanager.h"
|
||||
|
||||
#include <Htmlhelp.h>
|
||||
#pragma comment(lib,"Htmlhelp.lib")
|
||||
|
||||
class CMainDlg : public CDialogImpl<CMainDlg>, public CUpdateUI<CMainDlg>, public CDialogDrag<CMainDlg>,
|
||||
public CMessageFilter, public CIdleHandler, public CSnapWindow<CMainDlg>, public CDialogHelp<CMainDlg>
|
||||
{
|
||||
public:
|
||||
enum { IDD = IDD_MAINDLG };
|
||||
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
virtual BOOL OnIdle();
|
||||
|
||||
BEGIN_UPDATE_UI_MAP(CMainDlg)
|
||||
END_UPDATE_UI_MAP()
|
||||
|
||||
BEGIN_MSG_MAP(CMainDlg)
|
||||
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
||||
MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
|
||||
MESSAGE_HANDLER(WM_SYSCOMMAND, OnSysCommand)
|
||||
COMMAND_ID_HANDLER(IDOK, OnOK)
|
||||
COMMAND_ID_HANDLER(IDC_APPLY, OnApply)
|
||||
COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
|
||||
CHAIN_MSG_MAP(CDialogDrag<CMainDlg>)
|
||||
CHAIN_MSG_MAP(CSnapWindow<CMainDlg>)
|
||||
CHAIN_MSG_MAP(CDialogHelp<CMainDlg>)
|
||||
END_MSG_MAP()
|
||||
|
||||
// Handler prototypes (uncomment arguments if needed):
|
||||
// LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
|
||||
// LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
|
||||
// LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)
|
||||
|
||||
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
|
||||
LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
|
||||
|
||||
LRESULT OnSysCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||
|
||||
LRESULT OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
||||
LRESULT OnApply(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
||||
void InitUI();
|
||||
void OnApplyImpl();
|
||||
LRESULT OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
||||
|
||||
void CloseDialog(int nVal);
|
||||
|
||||
LRESULT OnAppHelp(LPHELPINFO lphi);
|
||||
|
||||
private:
|
||||
CRegManager m_reg;
|
||||
};
|
||||
#endif//_MAINDLG_A8394D0D_EE2B_4A00_9FAC_AB8D3B03F078_
|
||||
164
CBXManager/RegManager.h
Normal file
164
CBXManager/RegManager.h
Normal file
|
|
@ -0,0 +1,164 @@
|
|||
#ifndef _REGMANAGER_79AE66E4_84E2_45A1_BF4F_43AA714BE55F_
|
||||
#define _REGMANAGER_79AE66E4_84E2_45A1_BF4F_43AA714BE55F_
|
||||
#pragma once
|
||||
|
||||
#include <windows.h>
|
||||
#pragma comment(lib,"advapi32.lib")
|
||||
#include <shlwapi.h>
|
||||
#pragma comment(lib,"shlwapi.lib")
|
||||
|
||||
|
||||
#define CBX_MUTEX_GLOBAL L"Global\\{64DEE47D-9669-4430-9D5C-304867F87B51}"
|
||||
#define CBX_MGRMUTEX L"Local\\{50D9CBE6-C168-4901-8CC9-2A7C97E558F7}"
|
||||
|
||||
|
||||
#define CBX_GUID_KEY _T("{9E6ECB90-5A61-42BD-B851-D3297D9C7F39}") //38+1 TCHAR
|
||||
#define CBX_GUID_KEY_SLEN 39
|
||||
#define CBX_APP_KEY _T("Software\\T800 Productions\\{9E6ECB90-5A61-42BD-B851-D3297D9C7F39}")
|
||||
|
||||
// per-user settings (HKCU)
|
||||
// thumbnail handler keys
|
||||
#define CBX_ZIPTH_KEY _T("SOFTWARE\\Classes\\.ZIP\\shellex\\{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}")
|
||||
#define CBX_CBZTH_KEY _T("SOFTWARE\\Classes\\.CBZ\\shellex\\{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}")
|
||||
#define CBX_RARTH_KEY _T("SOFTWARE\\Classes\\.RAR\\shellex\\{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}")
|
||||
#define CBX_CBRTH_KEY _T("SOFTWARE\\Classes\\.CBR\\shellex\\{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}")
|
||||
// infotip handler keys
|
||||
#define CBX_ZIPIH_KEY _T("SOFTWARE\\Classes\\.ZIP\\shellex\\{00021500-0000-0000-C000-000000000046}")
|
||||
#define CBX_CBZIH_KEY _T("SOFTWARE\\Classes\\.CBZ\\shellex\\{00021500-0000-0000-C000-000000000046}")
|
||||
#define CBX_RARIH_KEY _T("SOFTWARE\\Classes\\.RAR\\shellex\\{00021500-0000-0000-C000-000000000046}")
|
||||
#define CBX_CBRIH_KEY _T("SOFTWARE\\Classes\\.CBR\\shellex\\{00021500-0000-0000-C000-000000000046}")
|
||||
|
||||
// cbx types
|
||||
#define CBX_NONE 0
|
||||
#define CBX_ZIP 1
|
||||
#define CBX_CBZ 2
|
||||
#define CBX_RAR 3
|
||||
#define CBX_CBR 4
|
||||
//#define CBX_SORT 5
|
||||
|
||||
|
||||
class CRegManager
|
||||
{
|
||||
public:
|
||||
//CRegManager(void){}
|
||||
//virtual ~CRegManager(void){}
|
||||
public:
|
||||
|
||||
///////////////
|
||||
// sort option
|
||||
BOOL IsSortOpt()
|
||||
{
|
||||
DWORD d;
|
||||
CRegKey rk;
|
||||
if (ERROR_SUCCESS==rk.Open(HKEY_CURRENT_USER, CBX_APP_KEY, KEY_READ))
|
||||
{
|
||||
if (ERROR_SUCCESS==rk.QueryDWORDValue(_T("NoSort"), d))
|
||||
return (d==FALSE);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void SetSortOpt(BOOL bSort)
|
||||
{
|
||||
CRegKey rk;
|
||||
if (ERROR_SUCCESS==rk.Create(HKEY_CURRENT_USER, CBX_APP_KEY, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE))
|
||||
rk.SetDWORDValue(_T("NoSort"), (DWORD)(bSort ? FALSE : TRUE));
|
||||
}
|
||||
|
||||
///////////////////////////////
|
||||
// check for thumbnail handlers
|
||||
BOOL HasTH(int cbxType)
|
||||
{
|
||||
ATLASSERT(cbxType>CBX_NONE);
|
||||
ULONG n=CBX_GUID_KEY_SLEN;
|
||||
TCHAR s[CBX_GUID_KEY_SLEN];
|
||||
|
||||
CRegKey rk;
|
||||
if (ERROR_SUCCESS==rk.Open(HKEY_CURRENT_USER, GetTHKeyName(cbxType), KEY_READ))
|
||||
{
|
||||
if (ERROR_SUCCESS==rk.QueryStringValue(NULL, s, &n))
|
||||
{
|
||||
if (0==StrCmpI(s, CBX_GUID_KEY))
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/////////////////////////////
|
||||
// check for infotip handlers
|
||||
BOOL HasIH(int cbxType)
|
||||
{
|
||||
ATLASSERT(cbxType>CBX_NONE);
|
||||
ULONG n=CBX_GUID_KEY_SLEN;
|
||||
TCHAR s[CBX_GUID_KEY_SLEN];
|
||||
|
||||
CRegKey rk;
|
||||
if (ERROR_SUCCESS==rk.Open(HKEY_CURRENT_USER, GetIHKeyName(cbxType), KEY_READ))
|
||||
{
|
||||
if (ERROR_SUCCESS==rk.QueryStringValue(NULL, s, &n))
|
||||
{
|
||||
if (StrCmpI(s, CBX_GUID_KEY)==0)
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/////////////////////////
|
||||
// set thumbnail / infotip handlers
|
||||
void SetHandlers(int cbxType, BOOL bSet)
|
||||
{
|
||||
ATLASSERT(cbxType>CBX_NONE);
|
||||
|
||||
if (bSet)
|
||||
{
|
||||
//thumbnail
|
||||
CRegKey rkt, rki;
|
||||
if (ERROR_SUCCESS==rkt.Create(HKEY_CURRENT_USER, GetTHKeyName(cbxType), NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE))
|
||||
rkt.SetStringValue(NULL, CBX_GUID_KEY);
|
||||
//infotip
|
||||
if (ERROR_SUCCESS==rki.Create(HKEY_CURRENT_USER, GetIHKeyName(cbxType), NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE))
|
||||
rki.SetStringValue(NULL, CBX_GUID_KEY);
|
||||
}
|
||||
else
|
||||
{
|
||||
//thumbnail
|
||||
if (HasTH(cbxType)) RegDeleteKey(HKEY_CURRENT_USER, GetTHKeyName(cbxType));
|
||||
//infotip
|
||||
if (HasIH(cbxType)) RegDeleteKey(HKEY_CURRENT_USER, GetIHKeyName(cbxType));
|
||||
}
|
||||
}
|
||||
|
||||
//get handler reg key names
|
||||
LPCTSTR GetTHKeyName(int cbxType)
|
||||
{
|
||||
ATLASSERT(cbxType>CBX_NONE);
|
||||
switch (cbxType)
|
||||
{
|
||||
case CBX_ZIP: return CBX_ZIPTH_KEY;
|
||||
case CBX_CBZ: return CBX_CBZTH_KEY;
|
||||
|
||||
case CBX_RAR: return CBX_RARTH_KEY;
|
||||
case CBX_CBR: return CBX_CBRTH_KEY;
|
||||
default:break;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
LPCTSTR GetIHKeyName(int cbxType)
|
||||
{
|
||||
ATLASSERT(cbxType>CBX_NONE);
|
||||
switch (cbxType)
|
||||
{
|
||||
case CBX_ZIP: return CBX_ZIPIH_KEY;
|
||||
case CBX_CBZ: return CBX_CBZIH_KEY;
|
||||
|
||||
case CBX_RAR: return CBX_RARIH_KEY;
|
||||
case CBX_CBR: return CBX_CBRIH_KEY;
|
||||
default:break;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
};
|
||||
|
||||
#endif//_REGMANAGER_79AE66E4_84E2_45A1_BF4F_43AA714BE55F_
|
||||
|
|
@ -1 +1,17 @@
|
|||
|
||||
#ifndef IDC_STATIC
|
||||
#define IDC_STATIC (-1)
|
||||
#endif
|
||||
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDD_MAINDLG 129
|
||||
#define IDD_ABOUTBOX 130
|
||||
#define IDC_SORT_DESC 1000
|
||||
#define IDC_APPABOUT 1001
|
||||
#define IDC_APPLY 1002
|
||||
#define IDC_SORT_ADVOPTGROUP 1003
|
||||
#define IDC_CB_CBZ 1004
|
||||
#define IDC_TH_GROUP 1005
|
||||
#define IDC_CB_RAR 57681
|
||||
#define IDC_CB_ZIP 57682
|
||||
#define IDC_CB_SORT 57683
|
||||
#define IDC_CB_CBR 57684
|
||||
|
|
|
|||
9
CBXManager/stdafx.cpp
Normal file
9
CBXManager/stdafx.cpp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// CBXManager.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#if (_ATL_VER < 0x0700)
|
||||
#include <atlimpl.cpp>
|
||||
#endif //(_ATL_VER < 0x0700)
|
||||
56
CBXManager/stdafx.h
Normal file
56
CBXManager/stdafx.h
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
#ifndef _STDAFX_2AA16305_D8E3_4296_9A26_5407C9BF9DEC_
|
||||
#define _STDAFX_2AA16305_D8E3_4296_9A26_5407C9BF9DEC_
|
||||
#pragma once
|
||||
|
||||
#ifndef UNICODE
|
||||
#define UNICODE// UNICODE-only project
|
||||
#endif
|
||||
|
||||
//runs on min win2k
|
||||
#define _WIN32_WINNT _WIN32_WINNT_WIN2K
|
||||
|
||||
|
||||
//#define _WTL_SUPPORT_SDK_ATL3
|
||||
#pragma comment(linker, "/NODEFAULTLIB:atlthunk.lib")
|
||||
|
||||
|
||||
#include <atlbase.h>
|
||||
#include <atlstdthunk.h>
|
||||
|
||||
|
||||
namespace ATL
|
||||
{
|
||||
inline void * __stdcall __AllocStdCallThunk()
|
||||
{
|
||||
return ::VirtualAlloc(0, sizeof(_stdcallthunk), MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
|
||||
}
|
||||
|
||||
inline void __stdcall __FreeStdCallThunk(void *p)
|
||||
{
|
||||
if (p!=NULL) ::VirtualFree(p, 0, MEM_RELEASE);
|
||||
}
|
||||
};
|
||||
|
||||
#include <atlapp.h>
|
||||
|
||||
extern CAppModule _Module;
|
||||
|
||||
#include <atlwin.h>
|
||||
|
||||
#include <atlframe.h>
|
||||
#include <atlctrls.h>
|
||||
#include <atldlgs.h>
|
||||
#include <Windowsx.h>
|
||||
|
||||
|
||||
#if defined _M_IX86
|
||||
#pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
|
||||
#elif defined _M_IA64
|
||||
#pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
|
||||
#elif defined _M_X64
|
||||
#pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
|
||||
#else
|
||||
#pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
|
||||
#endif
|
||||
|
||||
#endif//_STDAFX_2AA16305_D8E3_4296_9A26_5407C9BF9DEC_
|
||||
261
CBXManager/tools.h
Normal file
261
CBXManager/tools.h
Normal file
|
|
@ -0,0 +1,261 @@
|
|||
#ifndef _TOOLS_C804F48E_5335_49D0_B277_FAB445845DF3_
|
||||
#define _TOOLS_C804F48E_5335_49D0_B277_FAB445845DF3_
|
||||
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
|
||||
//dialog drag support
|
||||
template <class T> class CDialogDrag
|
||||
{
|
||||
public:
|
||||
BEGIN_MSG_MAP(CDialogDrag<T>)
|
||||
MESSAGE_HANDLER(WM_NCHITTEST, OnNCHitTest)
|
||||
END_MSG_MAP()
|
||||
|
||||
LRESULT OnNCHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
||||
{
|
||||
T* pT=static_cast<T*>(this);
|
||||
m_lHitTest = ::DefWindowProcW(pT->m_hWnd, uMsg, wParam, lParam);
|
||||
if (m_lHitTest == HTCLIENT) return HTCAPTION;
|
||||
return m_lHitTest;
|
||||
}
|
||||
private:
|
||||
LRESULT m_lHitTest;
|
||||
};
|
||||
#define CDragDialog CDialogDrag;
|
||||
|
||||
//************************************************************************
|
||||
#include <shellapi.h>
|
||||
#pragma comment(lib, "shell32.lib")
|
||||
template <class T> class CDropFileTarget // implements dropfile target window
|
||||
{
|
||||
public:
|
||||
BEGIN_MSG_MAP(CDropFileTarget<T>)
|
||||
MESSAGE_HANDLER(WM_DROPFILES, OnDropFiles)
|
||||
END_MSG_MAP()
|
||||
|
||||
void RegisterDropTarget(BOOL bAccept = TRUE)
|
||||
{
|
||||
T* pT=static_cast<T*>(this);
|
||||
ATLASSERT(::IsWindow(pT->m_hWnd));
|
||||
::DragAcceptFiles(pT->m_hWnd, bAccept);
|
||||
}
|
||||
|
||||
//override in inherited class
|
||||
protected:
|
||||
virtual BOOL StartDropFile(UINT uNumFiles){ATLTRACE("CDropFileTarget::StartDropFile NumFiles: %d\n",uNumFiles);return TRUE;}
|
||||
virtual BOOL ProcessDropFile(LPCTSTR szDropFile, UINT nFile){ATLTRACE(_T("CDropFileTarget::ProcessDropFile: %s\n"),szDropFile);return TRUE;}
|
||||
virtual void FinishDropFile(){ATLTRACE("CDropFileTarget::FinishDropFile\n");}
|
||||
|
||||
private:
|
||||
virtual LRESULT OnDropFiles(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
||||
{
|
||||
UINT i;
|
||||
UINT uMaxLen=0;
|
||||
UINT uNumFiles = ::DragQueryFile((HDROP)wParam, 0xFFFFFFFF, NULL, 0);
|
||||
if (!StartDropFile(uNumFiles)) return 0;
|
||||
|
||||
for (i=0; i<uNumFiles; i++)
|
||||
uMaxLen=max(uMaxLen, ::DragQueryFile((HDROP)wParam, i, NULL, 0));
|
||||
|
||||
uMaxLen++;//DragQueryFile doesn't include terminating null
|
||||
TCHAR* szFilename=(TCHAR*)::CoTaskMemAlloc(sizeof(TCHAR)*uMaxLen);
|
||||
|
||||
for (i=0; i<uNumFiles; i++)
|
||||
{
|
||||
::DragQueryFile((HDROP)wParam, i, szFilename, uMaxLen);
|
||||
if (!ProcessDropFile(szFilename, i)) break;
|
||||
}
|
||||
|
||||
::CoTaskMemFree(szFilename);
|
||||
::DragFinish((HDROP)wParam);
|
||||
FinishDropFile();
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
////*******************************unused*****************************
|
||||
//class CSingleInstance
|
||||
//{
|
||||
//protected:
|
||||
// BOOL m_instantiated;
|
||||
// HANDLE m_hMutex;
|
||||
//public:
|
||||
// CSingleInstance(TCHAR *strMutexName)
|
||||
// {
|
||||
// m_hMutex = CreateMutex(NULL, FALSE, strMutexName); //do early
|
||||
// m_instantiated=(ERROR_ALREADY_EXISTS == GetLastError()); //save for use later...
|
||||
// }
|
||||
// virtual ~CSingleInstance()
|
||||
// {
|
||||
// if (m_hMutex) //Do not forget to close handles.
|
||||
// {
|
||||
// CloseHandle(m_hMutex); //Do as late as possible.
|
||||
// m_hMutex = NULL; //Good habit to be in.
|
||||
// }
|
||||
// }
|
||||
// BOOL IsAnotherInstanceRunning(){return m_instantiated;}
|
||||
//};
|
||||
|
||||
//************************************************************************
|
||||
|
||||
//window snap to screen edges
|
||||
#ifdef __ATLBASE_H__
|
||||
template <class T> class CSnapWindow
|
||||
#else
|
||||
class CSnapWindow
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
int snap_Margin, snap_ModifierKey;
|
||||
|
||||
#ifdef __ATLBASE_H__
|
||||
BEGIN_MSG_MAP(CSnapWindow<T>)
|
||||
MESSAGE_HANDLER(WM_MOVING, OnSnapMoving)
|
||||
MESSAGE_HANDLER(WM_ENTERSIZEMOVE, OnSnapEnterSizeMove)
|
||||
END_MSG_MAP()
|
||||
#endif
|
||||
|
||||
#ifdef __ATLBASE_H__
|
||||
virtual LRESULT OnSnapEnterSizeMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
||||
#else
|
||||
virtual LRESULT OnSnapEnterSizeMove(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
#endif
|
||||
{
|
||||
snap_cur_pos.x=0;
|
||||
snap_cur_pos.y=0;
|
||||
snap_rcWindow.bottom=0;
|
||||
snap_rcWindow.left=0;
|
||||
snap_rcWindow.right=0;
|
||||
snap_rcWindow.top=0;
|
||||
|
||||
#ifdef __ATLBASE_H__
|
||||
T* pT = static_cast<T*>(this);
|
||||
GetWindowRect(pT->m_hWnd, &snap_rcWindow );
|
||||
#else
|
||||
GetWindowRect(hWnd, &snap_rcWindow );
|
||||
#endif
|
||||
|
||||
GetCursorPos( &snap_cur_pos );
|
||||
snap_x = snap_cur_pos.x - snap_rcWindow.left;
|
||||
snap_y = snap_cur_pos.y - snap_rcWindow.top;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef __ATLBASE_H__
|
||||
virtual LRESULT OnSnapMoving(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
||||
#else
|
||||
virtual LRESULT OnSnapMoving(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
#endif
|
||||
{
|
||||
//no snap if shift key pressed
|
||||
if (GetAsyncKeyState(snap_ModifierKey) < 0) return FALSE;
|
||||
snap_prc = (LPRECT)lParam;
|
||||
snap_cur_pos.x=0;
|
||||
snap_cur_pos.y=0;
|
||||
snap_rcWindow.bottom=0;
|
||||
snap_rcWindow.left=0;
|
||||
snap_rcWindow.right=0;
|
||||
snap_rcWindow.top=0;
|
||||
|
||||
GetCursorPos( &snap_cur_pos );
|
||||
OffsetRect( snap_prc,
|
||||
snap_cur_pos.x - (snap_prc->left + snap_x) ,
|
||||
snap_cur_pos.y - (snap_prc->top + snap_y) );
|
||||
//it may change during app lifetime
|
||||
SystemParametersInfo( SPI_GETWORKAREA, 0, &snap_wa, 0 );
|
||||
|
||||
if (isSnapClose( snap_prc->left, snap_wa.left ))
|
||||
OffsetRect( snap_prc, snap_wa.left - snap_prc->left, 0);
|
||||
else
|
||||
if (isSnapClose( snap_wa.right, snap_prc->right ))
|
||||
OffsetRect( snap_prc, snap_wa.right - snap_prc->right, 0);
|
||||
|
||||
if (isSnapClose( snap_prc->top, snap_wa.top ))
|
||||
OffsetRect( snap_prc, 0, snap_wa.top - snap_prc->top );
|
||||
else
|
||||
if (isSnapClose( snap_wa.bottom, snap_prc->bottom ))
|
||||
OffsetRect( snap_prc, 0, snap_wa.bottom - snap_prc->bottom );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
virtual BOOL isSnapClose( int a, int b ) { return (::abs( a - b ) < snap_Margin);}
|
||||
|
||||
CSnapWindow()
|
||||
{
|
||||
snap_ModifierKey=VK_SHIFT;
|
||||
NONCLIENTMETRICS ncm;
|
||||
SecureZeroMemory(&ncm, sizeof(NONCLIENTMETRICS));
|
||||
ncm.cbSize = sizeof ncm;
|
||||
SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0);
|
||||
snap_Margin=ncm.iCaptionHeight;
|
||||
}
|
||||
private:
|
||||
POINT snap_cur_pos;
|
||||
RECT snap_rcWindow, snap_wa, *snap_prc;
|
||||
int snap_x, snap_y;
|
||||
};
|
||||
//************************************************************************
|
||||
|
||||
//hi-res timer class
|
||||
class CTimer
|
||||
{
|
||||
public:
|
||||
virtual ~CTimer(){}
|
||||
CTimer()
|
||||
{
|
||||
m_msSystemUpTime=0;
|
||||
m_ticksPerSecond.QuadPart=-1;
|
||||
m_startTick.QuadPart=0;
|
||||
m_count.QuadPart=0;
|
||||
::QueryPerformanceFrequency(&m_ticksPerSecond);
|
||||
::QueryPerformanceCounter(&m_startTick);
|
||||
m_msSystemUpTime = 1000*m_startTick.QuadPart/m_ticksPerSecond.QuadPart;
|
||||
}
|
||||
|
||||
__int64 msElapsed()//elapsed time in milliseconds
|
||||
{
|
||||
::QueryPerformanceCounter(&m_count);
|
||||
__int64 m_elapsed=1000*(m_count.QuadPart - m_startTick.QuadPart)/m_ticksPerSecond.QuadPart;
|
||||
return m_elapsed;
|
||||
}
|
||||
|
||||
BOOL resetTimer(){ return ::QueryPerformanceCounter(&m_startTick); }
|
||||
|
||||
private:
|
||||
__int64 m_msSystemUpTime;
|
||||
LARGE_INTEGER m_ticksPerSecond;
|
||||
LARGE_INTEGER m_startTick;
|
||||
LARGE_INTEGER m_count;
|
||||
};
|
||||
//************************************************************************
|
||||
|
||||
//#ifdef USES_HTMLHELP
|
||||
// handles F1 or dialog context help
|
||||
//#include "resource.h"
|
||||
//#include "Htmlhelp.h"
|
||||
//#pragma comment(lib,"Htmlhelp.lib")
|
||||
template <class T> class CDialogHelp
|
||||
{
|
||||
public:
|
||||
BEGIN_MSG_MAP(CDialogHelp<T>)
|
||||
MESSAGE_HANDLER(WM_HELP, OnAppHelpImpl)
|
||||
END_MSG_MAP()
|
||||
|
||||
LRESULT OnAppHelpImpl(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)
|
||||
{
|
||||
T* pT=static_cast<T*>(this);
|
||||
return pT->OnAppHelp((HELPINFO *)lParam);
|
||||
}
|
||||
|
||||
virtual LRESULT OnAppHelp(LPHELPINFO lphi)
|
||||
{
|
||||
ATLTRACE("CDialogHelp::OnAppHelp\n");
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
//#endif
|
||||
|
||||
|
||||
#endif//_TOOLS_C804F48E_5335_49D0_B277_FAB445845DF3_
|
||||
Loading…
Add table
Add a link
Reference in a new issue