├── .gitignore ├── LICENSE ├── MultiCommander └── SDK │ ├── Actions.h │ ├── Collections.h │ ├── DataTransfer.h │ ├── Dialogs.h │ ├── ExtensionInfo.h │ ├── ExtensionSDK.h │ ├── FilePropertiesPlugin.h │ ├── FileSystemPlugin.h │ ├── IAppConfig.h │ ├── IAppInterface.h │ ├── IAppMenu.h │ ├── IColumnLayoutManager.h │ ├── ICommandManager.h │ ├── IConfiguration.h │ ├── IDataViewerWindow.h │ ├── IEventCallback.h │ ├── IExternalFile.h │ ├── IFavoritesManager.h │ ├── IFileInfoInterface.h │ ├── IFileItem.h │ ├── IFileOperationPlugin.h │ ├── IFileOperations.h │ ├── IFileProperties.h │ ├── IFilePropertiesManager.h │ ├── IFilePropertiesRetriever.h │ ├── IFileSearch.h │ ├── IFileSystemBrowser.h │ ├── IFileSystemManager.h │ ├── IFileSystemMonitor.h │ ├── IFrameWindow.h │ ├── IHTTPRequest.h │ ├── ILogger.h │ ├── IMCThumbnail.h │ ├── IMenuManager.h │ ├── IMultiList.h │ ├── IMultiWindow.h │ ├── IRecentManager.h │ ├── IRestartRecoveryDataCollector.h │ ├── IRunAsAdmin.h │ ├── IScript.h │ ├── ISessionConfig.h │ ├── IStatus.h │ ├── IVirtualDeviceFolder.h │ ├── IVolume.h │ ├── IVolumeContextMenu.h │ ├── IWorkspace.h │ ├── IXMLHelper.h │ ├── MCAutoRelease.h │ ├── MCErrorCodes.h │ ├── MCNamespace.h │ ├── MultiApp_Def.h │ ├── MultiControllers.h │ ├── MultiExtension.h │ ├── Multi_Type.h │ ├── PluginInterface.h │ ├── Readme.txt │ └── SDKVersion.h ├── README.md └── SDKSamples ├── MCAppExtensionSample ├── Config │ ├── AppExtSample.xml │ └── Languages │ │ ├── AppExtSample_lang_en.xml │ │ └── FilePropSample_lang_en.xml ├── DLL_Exports.def ├── MCAppExtensionSample.vcxproj ├── MCAppExtensionSample.vcxproj.filters ├── PostBuild_win32.bat ├── PostBuild_x64.bat ├── ReadMe.txt └── Source │ ├── AppExtensionCmd.h │ ├── DLL_Exports.cpp │ ├── MCAppExtensionSample.cpp │ ├── MCAppExtensionSample.h │ ├── MCFilePropSample.cpp │ ├── MCFilePropSample.h │ ├── stdafx.cpp │ └── stdafx.h ├── MCAppSampleExtension.sln ├── MCCopyDataSendGetSample ├── MCCopyData.h ├── MCCopyDataSendGetSample.cpp ├── MCCopyDataSendGetSample.h ├── MCCopyDataSendGetSample.ico ├── MCCopyDataSendGetSample.rc ├── MCCopyDataSendGetSample.sln ├── MCCopyDataSendGetSample.vcxproj ├── MCCopyDataSendSample.vcxproj.filters ├── ReadMe.txt ├── resource.h ├── small.ico ├── stdafx.cpp ├── stdafx.h └── targetver.h ├── MCFSPluginSample ├── DLL_Exports.def ├── FS-Sample-ReadMe.txt ├── MCFSPluginSample.cpp ├── MCFSPluginSample.vcxproj ├── MCFSPluginSample.vcxproj.filters ├── PostBuild_win32.bat ├── PostBuild_x64.bat └── Source │ ├── AutoHandle.h │ ├── DLL_Exports.cpp │ ├── FSSampleInternal.cpp │ ├── FSSampleInternal.h │ ├── FSSampleStream.cpp │ ├── FSSampleStream.h │ ├── InternalFileOperations.cpp │ ├── InternalFileOperations.h │ ├── MemoryFileSystem.cpp │ ├── MemoryFileSystem.h │ ├── StreamRWFile.cpp │ ├── StreamRWFile.h │ ├── stdafx.cpp │ ├── stdafx.h │ └── targetver.h └── MultiCommander_SDK.txt /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Aa][Rr][Mm]/ 27 | [Aa][Rr][Mm]64/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | [Ll]ogs/ 33 | 34 | # Visual Studio 2015/2017 cache/options directory 35 | .vs/ 36 | # Uncomment if you have tasks that create the project's static files in wwwroot 37 | #wwwroot/ 38 | 39 | # Visual Studio 2017 auto generated files 40 | Generated\ Files/ 41 | 42 | # MSTest test Results 43 | [Tt]est[Rr]esult*/ 44 | [Bb]uild[Ll]og.* 45 | 46 | # NUnit 47 | *.VisualState.xml 48 | TestResult.xml 49 | nunit-*.xml 50 | 51 | # Build Results of an ATL Project 52 | [Dd]ebugPS/ 53 | [Rr]eleasePS/ 54 | dlldata.c 55 | 56 | # Benchmark Results 57 | BenchmarkDotNet.Artifacts/ 58 | 59 | # .NET Core 60 | project.lock.json 61 | project.fragment.lock.json 62 | artifacts/ 63 | 64 | # StyleCop 65 | StyleCopReport.xml 66 | 67 | # Files built by Visual Studio 68 | *_i.c 69 | *_p.c 70 | *_h.h 71 | *.ilk 72 | *.meta 73 | *.obj 74 | *.iobj 75 | *.pch 76 | *.pdb 77 | *.ipdb 78 | *.pgc 79 | *.pgd 80 | *.rsp 81 | *.sbr 82 | *.tlb 83 | *.tli 84 | *.tlh 85 | *.tmp 86 | *.tmp_proj 87 | *_wpftmp.csproj 88 | *.log 89 | *.vspscc 90 | *.vssscc 91 | .builds 92 | *.pidb 93 | *.svclog 94 | *.scc 95 | 96 | # Chutzpah Test files 97 | _Chutzpah* 98 | 99 | # Visual C++ cache files 100 | ipch/ 101 | *.aps 102 | *.ncb 103 | *.opendb 104 | *.opensdf 105 | *.sdf 106 | *.cachefile 107 | *.VC.db 108 | *.VC.VC.opendb 109 | 110 | # Visual Studio profiler 111 | *.psess 112 | *.vsp 113 | *.vspx 114 | *.sap 115 | 116 | # Visual Studio Trace Files 117 | *.e2e 118 | 119 | # TFS 2012 Local Workspace 120 | $tf/ 121 | 122 | # Guidance Automation Toolkit 123 | *.gpState 124 | 125 | # ReSharper is a .NET coding add-in 126 | _ReSharper*/ 127 | *.[Rr]e[Ss]harper 128 | *.DotSettings.user 129 | 130 | # TeamCity is a build add-in 131 | _TeamCity* 132 | 133 | # DotCover is a Code Coverage Tool 134 | *.dotCover 135 | 136 | # AxoCover is a Code Coverage Tool 137 | .axoCover/* 138 | !.axoCover/settings.json 139 | 140 | # Visual Studio code coverage results 141 | *.coverage 142 | *.coveragexml 143 | 144 | # NCrunch 145 | _NCrunch_* 146 | .*crunch*.local.xml 147 | nCrunchTemp_* 148 | 149 | # MightyMoose 150 | *.mm.* 151 | AutoTest.Net/ 152 | 153 | # Web workbench (sass) 154 | .sass-cache/ 155 | 156 | # Installshield output folder 157 | [Ee]xpress/ 158 | 159 | # DocProject is a documentation generator add-in 160 | DocProject/buildhelp/ 161 | DocProject/Help/*.HxT 162 | DocProject/Help/*.HxC 163 | DocProject/Help/*.hhc 164 | DocProject/Help/*.hhk 165 | DocProject/Help/*.hhp 166 | DocProject/Help/Html2 167 | DocProject/Help/html 168 | 169 | # Click-Once directory 170 | publish/ 171 | 172 | # Publish Web Output 173 | *.[Pp]ublish.xml 174 | *.azurePubxml 175 | # Note: Comment the next line if you want to checkin your web deploy settings, 176 | # but database connection strings (with potential passwords) will be unencrypted 177 | *.pubxml 178 | *.publishproj 179 | 180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 181 | # checkin your Azure Web App publish settings, but sensitive information contained 182 | # in these scripts will be unencrypted 183 | PublishScripts/ 184 | 185 | # NuGet Packages 186 | *.nupkg 187 | # NuGet Symbol Packages 188 | *.snupkg 189 | # The packages folder can be ignored because of Package Restore 190 | **/[Pp]ackages/* 191 | # except build/, which is used as an MSBuild target. 192 | !**/[Pp]ackages/build/ 193 | # Uncomment if necessary however generally it will be regenerated when needed 194 | #!**/[Pp]ackages/repositories.config 195 | # NuGet v3's project.json files produces more ignorable files 196 | *.nuget.props 197 | *.nuget.targets 198 | 199 | # Microsoft Azure Build Output 200 | csx/ 201 | *.build.csdef 202 | 203 | # Microsoft Azure Emulator 204 | ecf/ 205 | rcf/ 206 | 207 | # Windows Store app package directories and files 208 | AppPackages/ 209 | BundleArtifacts/ 210 | Package.StoreAssociation.xml 211 | _pkginfo.txt 212 | *.appx 213 | *.appxbundle 214 | *.appxupload 215 | 216 | # Visual Studio cache files 217 | # files ending in .cache can be ignored 218 | *.[Cc]ache 219 | # but keep track of directories ending in .cache 220 | !?*.[Cc]ache/ 221 | 222 | # Others 223 | ClientBin/ 224 | ~$* 225 | *~ 226 | *.dbmdl 227 | *.dbproj.schemaview 228 | *.jfm 229 | *.pfx 230 | *.publishsettings 231 | orleans.codegen.cs 232 | 233 | # Including strong name files can present a security risk 234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 235 | #*.snk 236 | 237 | # Since there are multiple workflows, uncomment next line to ignore bower_components 238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 239 | #bower_components/ 240 | 241 | # RIA/Silverlight projects 242 | Generated_Code/ 243 | 244 | # Backup & report files from converting an old project file 245 | # to a newer Visual Studio version. Backup files are not needed, 246 | # because we have git ;-) 247 | _UpgradeReport_Files/ 248 | Backup*/ 249 | UpgradeLog*.XML 250 | UpgradeLog*.htm 251 | ServiceFabricBackup/ 252 | *.rptproj.bak 253 | 254 | # SQL Server files 255 | *.mdf 256 | *.ldf 257 | *.ndf 258 | 259 | # Business Intelligence projects 260 | *.rdl.data 261 | *.bim.layout 262 | *.bim_*.settings 263 | *.rptproj.rsuser 264 | *- [Bb]ackup.rdl 265 | *- [Bb]ackup ([0-9]).rdl 266 | *- [Bb]ackup ([0-9][0-9]).rdl 267 | 268 | # Microsoft Fakes 269 | FakesAssemblies/ 270 | 271 | # GhostDoc plugin setting file 272 | *.GhostDoc.xml 273 | 274 | # Node.js Tools for Visual Studio 275 | .ntvs_analysis.dat 276 | node_modules/ 277 | 278 | # Visual Studio 6 build log 279 | *.plg 280 | 281 | # Visual Studio 6 workspace options file 282 | *.opt 283 | 284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 285 | *.vbw 286 | 287 | # Visual Studio LightSwitch build output 288 | **/*.HTMLClient/GeneratedArtifacts 289 | **/*.DesktopClient/GeneratedArtifacts 290 | **/*.DesktopClient/ModelManifest.xml 291 | **/*.Server/GeneratedArtifacts 292 | **/*.Server/ModelManifest.xml 293 | _Pvt_Extensions 294 | 295 | # Paket dependency manager 296 | .paket/paket.exe 297 | paket-files/ 298 | 299 | # FAKE - F# Make 300 | .fake/ 301 | 302 | # CodeRush personal settings 303 | .cr/personal 304 | 305 | # Python Tools for Visual Studio (PTVS) 306 | __pycache__/ 307 | *.pyc 308 | 309 | # Cake - Uncomment if you are using it 310 | # tools/** 311 | # !tools/packages.config 312 | 313 | # Tabs Studio 314 | *.tss 315 | 316 | # Telerik's JustMock configuration file 317 | *.jmconfig 318 | 319 | # BizTalk build output 320 | *.btp.cs 321 | *.btm.cs 322 | *.odx.cs 323 | *.xsd.cs 324 | 325 | # OpenCover UI analysis results 326 | OpenCover/ 327 | 328 | # Azure Stream Analytics local run output 329 | ASALocalRun/ 330 | 331 | # MSBuild Binary and Structured Log 332 | *.binlog 333 | 334 | # NVidia Nsight GPU debugger configuration file 335 | *.nvuser 336 | 337 | # MFractors (Xamarin productivity tool) working folder 338 | .mfractor/ 339 | 340 | # Local History for Visual Studio 341 | .localhistory/ 342 | 343 | # BeatPulse healthcheck temp database 344 | healthchecksdb 345 | 346 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 347 | MigrationBackup/ 348 | 349 | # Ionide (cross platform F# VS Code tools) working folder 350 | .ionide/ 351 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Multi Commander 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MultiCommander/SDK/Actions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2025 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * 8 | * Changes 9 | * --------------------- 10 | * 11 | */ 12 | 13 | #pragma once 14 | 15 | /* 16 | A Command definition. 17 | 18 | This interface describes how the command works and what kind of parameters it accepts. 19 | The command can then be used from Script (CustomCommand or from MultiScript) 20 | 21 | */ 22 | 23 | #include "MCNamespace.h" 24 | #include "MultiApp_Def.h" 25 | MCNSBEGIN 26 | 27 | // This flag is what option to give the user when creating a custom command 28 | 29 | // Include data into the command when it is run. 30 | // If set the then use pCustomCommand->GetContentData(); to get the data that is set 31 | // (Most of The CCO_PARAM_ are OBSOLETE.) 32 | #define CCO_PARAM_FROM_SOURCE 0x00000000L // Will take parameters from Source view ( Default, do not need to specify ) 33 | #define CCO_PARAM_FROM_TARGET 0x00000001L // Will take parameters from Target view 34 | #define CCO_PARAM_FILEITEM 0x00000010L // Accept FILEITEM as parameter ( IFileItem* ) 35 | #define CCO_PARAM_FILEITEMS 0x00000020L // Accept FILEITEMS as parameter ( IFileItemCollection* ) 36 | #define CCO_PARAM_FILEPATH 0x00000040L // Accept PATH to a file as parameter 37 | #define CCO_PARAM_FOLDERPATH 0x00000080L // Accept PATH to a folder as parameter 38 | #define CCO_PARAM_PATH 0x00000100L // Accept PATH to file or folder as parameter 39 | #define CCO_PARAM_FILES CCO_PARAM_PATH|CCO_PARAM_FILEITEMS|CCO_PARAM_FILEITEM // Accept All 40 | #define CCO_PARAM_SINGELFILE CCO_PARAM_PATH|CCO_PARAM_FILEITEM // Accept All 41 | 42 | #define CCO_RUN_INDIVIDUALLY 0x00001000L // Allow command to be run on ALL selected Items individually. ( command will loop all selected items and run then one by one) 43 | #define CCO_ASK_BEFORE_RUN 0x00002000L // Ask if user are sure before running command. 44 | #define CCO_CONTINUE_ON_ERROR 0x00004000L // If running multiple command. and one command fails. then continue anyway. 45 | #define CCO_QUITE 0x00100000L // Allow option to run in Quite mode. 46 | #define CCO_NOGUI 0x00200000L // Allow option to run without GUI 47 | //#define CCO_SINGLEITEM 0x00004000L 48 | 49 | 50 | // Custom Command option types ( Customized options ) 51 | #define CCOF_BOOL 0x0000010L // Option is a Bool . enter it is there or Not 52 | #define CCOF_TEXT 0x0000020L // Option has a Text value as parameter ( eg FILTER= ) 53 | #define CCOF_VALUE 0x0000040L // Option has a numeric value as parameter ( eg MAX=34 ) 54 | #define CCOF_COLOR 0x0000080L // Option is a color ( eg BGCOLOR=#443321 ) 55 | #define CCOF_REQUIRED 0x0001000L // This options is required to use the Command 56 | 57 | /* 58 | 59 | Example 60 | 61 | pDef = m_pCustomCommands->DefineCommand( "MyCmd", CMD_MY_CMD, CCO_QUITE, ZCF_TARGET_ANY); 62 | if( pDef ) 63 | { 64 | pDef->SetDescription( pAppInterface->GetText(MAKETEXTID('c',120)) ); 65 | pDef->SetOption( "FILE" , CCOF_TEXT , pAppInterface->GetText(MAKETEXTID('c',111))); // FILE="" parameter 66 | } 67 | 68 | // 69 | BOOL MyExt::OnCustomCommand( ICustomCommand* pCustomCommand ) 70 | { 71 | if( pCustomCommand->GetID() == CMD_MY_CMD ) 72 | { 73 | if( pCustomCommand->HasOption( "FILE" ) ) 74 | { 75 | STLString strPath = pCustomCommand->GetOptionValue( "FILE" ); 76 | OnMyCmd(strPath); 77 | } 78 | } 79 | 80 | */ 81 | 82 | class __declspec(novtable) ICustomCommand 83 | { 84 | public: 85 | virtual bool HasOption( const char* strOption ) const = 0; 86 | virtual const WCHAR* GetOptionValue( const char* option ) = 0; 87 | 88 | virtual const char* GetName() const = 0; 89 | virtual DWORD GetID() const = 0; // Extension command ID. 90 | virtual const WCHAR* GetDescription() const = 0; 91 | 92 | virtual eContentDataType GetContentType() const = 0; 93 | virtual DWORD_PTR GetContentData() const = 0; 94 | 95 | virtual void SetErrorCode(DWORD dwError) = 0; 96 | 97 | virtual void SetScriptResult(const WCHAR* szValue) = 0; 98 | }; 99 | 100 | class __declspec(novtable) ICustomCommandDef 101 | { 102 | public: 103 | 104 | virtual bool SetOption( const char* strOption, DWORD nFlags , const WCHAR* strDesc ) = 0; 105 | virtual void SetDescription( const WCHAR* description ) = 0; 106 | }; 107 | 108 | class __declspec(novtable) ICustomCommands 109 | { 110 | public: 111 | virtual bool SetNamespace( const char* strNamespace ) = 0; 112 | 113 | // Return an interface to the Added command. NULL if failed or command already existed. 114 | virtual ICustomCommandDef* DefineCommand( const char* strCommand , DWORD dwCommand , DWORD dwOptions = 0 , DWORD dwTargetFlags = 0 ) = 0; 115 | 116 | //virtual DWORD GetCommand( const char* strCommand , short nParam=0 , DWORD dwFlags = 0) = 0; 117 | 118 | // Set to true when you have Initialized all command so you do not need to do it again. 119 | virtual void SetInitialized( bool b ) = 0; 120 | virtual bool GetInitialized() = 0; 121 | }; 122 | 123 | //OBSOLETE - Remove me 124 | class __declspec(novtable) IZAction 125 | { 126 | public: 127 | virtual UINT GetActionID() = 0; 128 | 129 | virtual eContentDataType GetActionType() = 0; 130 | virtual DWORD GetTargetFlags() = 0; 131 | 132 | virtual DWORD_PTR GetActionData() = 0; 133 | virtual UINT GetActionDataCount() = 0; 134 | virtual DWORD GetActionDataFlags() = 0; 135 | }; 136 | 137 | MCNSEND 138 | -------------------------------------------------------------------------------- /MultiCommander/SDK/Collections.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * 8 | * Changes 9 | * --------------------- 10 | * 11 | */ 12 | 13 | #pragma once 14 | #include "MCNamespace.h" 15 | #include "Multi_Type.h" 16 | MCNSBEGIN 17 | 18 | 19 | class IFileItem; 20 | 21 | // Collection that holds XHANDLE items 22 | class __declspec(novtable) IHCollection 23 | { 24 | public: 25 | virtual void Add( XHANDLE h ) = 0; 26 | 27 | // enum 28 | virtual void Reset() = 0; // set internal next pointer to first 29 | virtual XHANDLE Next() = 0; 30 | // 31 | virtual DWORD Count() = 0; 32 | virtual XHANDLE GetAt( DWORD nIndex ) = 0; 33 | virtual void Clear(); 34 | 35 | // deletes instance 36 | virtual void Release() = 0; 37 | 38 | }; 39 | 40 | // Collection that holds points items 41 | class __declspec(novtable) IPCollection 42 | { 43 | public: 44 | virtual void Add(PHANDLE h) = 0; 45 | 46 | // enum 47 | virtual void Reset() = 0; // set internal next pointer to first 48 | virtual PHANDLE Next() = 0; 49 | // 50 | virtual DWORD Count() = 0; 51 | virtual PHANDLE GetAt(DWORD nIndex) = 0; 52 | virtual void Clear(); 53 | 54 | // deletes instance 55 | virtual void Release() = 0; 56 | 57 | }; 58 | 59 | // Text => Value - map like collection 60 | class __declspec(novtable) ITextValueCollection 61 | { 62 | public: 63 | virtual void Add( const WCHAR* strText, INT64 value ) = 0; 64 | 65 | virtual bool Exists(const WCHAR* strText) = 0; 66 | virtual DWORD Count() = 0; 67 | virtual void Clear() = 0; 68 | 69 | virtual BOOL GetAt(DWORD nIndex, WCHAR* strText, int strMaxLen,INT64& value) = 0; 70 | 71 | // deletes instance 72 | virtual void Release() = 0; 73 | 74 | }; 75 | 76 | // Text => Text - map like collection 77 | class __declspec(novtable) IKeyValCollection 78 | { 79 | public: 80 | // Multiple KEYS are allowed. 81 | virtual void Add( const WCHAR* strKey , const WCHAR* strVal ) = 0; 82 | 83 | virtual void Remove(const WCHAR* strKey) = 0; 84 | // replace a key (if it exists) with a new value 85 | virtual void Replace( const WCHAR* strKey , const WCHAR* strVal ) = 0; 86 | 87 | virtual bool KeyExists(const WCHAR* szKey, bool bCaseSensative = true) = 0; 88 | virtual int GetKeyIdx(const WCHAR* strKey, bool bCaseSensative = true) = 0; 89 | 90 | virtual DWORD Count() = 0; 91 | virtual BOOL GetAt( DWORD nIndex , WCHAR* strKey , WCHAR* strVal , int strMaxLen ) = 0; 92 | // get the value that matches strKey ( not case sensitive ) 93 | virtual BOOL Get( const WCHAR* strKey , WCHAR* strVal , int strMaxLen , BOOL bCaseSensative ) = 0; 94 | 95 | virtual void Clear() = 0; 96 | // deletes instance 97 | virtual void Release() = 0; 98 | 99 | }; 100 | 101 | // Text collection 102 | class __declspec(novtable) IValueCollection 103 | { 104 | public: 105 | virtual void Add_Last( const WCHAR* strVal ) = 0; 106 | 107 | // Will replace all existing item with the one in pItems 108 | virtual DWORD CopyFrom(const IValueCollection* pItems) = 0; 109 | virtual DWORD MoveFrom(IValueCollection* pItems) = 0; 110 | 111 | virtual void Insert( const WCHAR* strVal , DWORD nIndex ) = 0; 112 | 113 | virtual void Remove( DWORD nIndex ) = 0; 114 | virtual void Remove( const WCHAR* strVal ) = 0; 115 | virtual void RemoveAll() = 0; 116 | 117 | virtual bool Find( const WCHAR* strVal , /*[out]*/ DWORD* pIndex) = 0; 118 | virtual bool FindNoCase( const WCHAR* strVal , /*[out]*/ DWORD* pIndex) = 0; 119 | 120 | virtual DWORD Count() = 0; 121 | virtual bool GetAt( DWORD nIndex , WCHAR* strVal , int strMaxLen ) = 0; 122 | 123 | // Reverse the data in the Collection 124 | virtual void Reverse() = 0; 125 | 126 | // Sort the collection 127 | virtual void Sort() = 0; 128 | 129 | virtual void RemoveDuplicate(bool bIgnoreCase) = 0; 130 | // Emprt the collection. 131 | virtual void Clear() = 0; 132 | 133 | // deletes instance 134 | virtual void Release() = 0; 135 | 136 | }; 137 | 138 | // IFileItem Collection 139 | class IFileItem; 140 | class __declspec(novtable) IFileItemCollection 141 | { 142 | public: 143 | virtual ~IFileItemCollection() { } 144 | 145 | virtual void Add( IFileItem* hFileItem ) = 0; 146 | virtual void AddFront( IFileItem* hFileItem ) = 0; 147 | virtual DWORD Add( IFileItemCollection* pFileItems) = 0; 148 | 149 | // Add all item that not alredy exists from pFileItems 150 | // It will check if every item exists before adding it 151 | virtual DWORD AddUniqe(IFileItemCollection* pFileItems) = 0; 152 | 153 | virtual DWORD Count() const = 0; 154 | virtual IFileItem* GetAt( DWORD nIndex ) = 0; 155 | virtual const IFileItem* GetAt(DWORD nIndex) const = 0; 156 | virtual void Clear() = 0; 157 | 158 | // Count how many items we got with matching attribute flag. 159 | virtual DWORD CountMatchingItems(DWORD dwAttribute) = 0; 160 | 161 | // returns (DWORD)-1 if item is NOT found 162 | virtual DWORD Find( IFileItem* pFileItem ) = 0; 163 | virtual IFileItem* Find( const WCHAR* strFilename , bool bCaseSensative = false, bool bRemove = false ) = 0; 164 | 165 | // Return how many items it found that it inserted into pFoundItems 166 | // bClearMatches will set found items that are inserted into pFoundItems to NULL. (thread safe, But not if you are removing.) 167 | virtual DWORD FindItems(IFileItemCollection* pFoundItems, const WCHAR* strMatch, bool bRemove = false , bool bClearMatching = false, bool bFastCheck = false) = 0; 168 | 169 | virtual bool Remove( IFileItem* pFileItem ) = 0; 170 | 171 | // Remove all matching items (by ptr) 172 | virtual DWORD Remove( IFileItemCollection* pItems ) = 0; 173 | 174 | // deletes instance 175 | virtual void Release() = 0; 176 | }; 177 | 178 | MCNSEND -------------------------------------------------------------------------------- /MultiCommander/SDK/DataTransfer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * 8 | * Changes 9 | * --------------------- 10 | * 11 | */ 12 | 13 | #pragma once 14 | #include "MCNamespace.h" 15 | MCNSBEGIN 16 | 17 | // Use to send data between two extension of different types 18 | 19 | #define ZIMPORT_FALSE 0 20 | #define ZIMPORT_SUCCESS 1 21 | #define ZIMPORT_USEIMPOBJECT 2 22 | 23 | struct IXData // Import / Export Data 24 | { 25 | 26 | long nDataFormat; // ZDF_FILE , ZFILEITEM , IMAGE , AUDIO , TEXT 27 | WCHAR wsDataType[10]; // "exe" , "jpg" , "gif" , "mp3" , "txt" 28 | long lDataFlags; 29 | long lDataCount; // How many items to Export/Import/Are in Collection 30 | DWORD_PTR hData; // ZHANDLE to a Collection of data 31 | long hDestinationParam; // 32 | ZHANDLE hSourceModule; // 33 | ZHANDLE hDestinationModule; // 34 | 35 | }; 36 | 37 | struct IXItem 38 | { 39 | WCHAR* ItemName; 40 | long nItemType; 41 | long nParam1; 42 | long nParam2; 43 | }; 44 | 45 | class __declspec(novtable) IExportData 46 | { 47 | public: 48 | 49 | virtual void Init( IXData *pXData , long Buffersize ) = 0; 50 | virtual void DeInit() = 0; 51 | 52 | virtual long Get_ExportCount() = 0; // Return the no of items awaiting export 53 | 54 | virtual XHANDLE OpenObject( int nItem , IXItem *pXItem ) = 0; 55 | 56 | // write data to the module 57 | virtual long ReadData( XHANDLE hHandle , void* Buffer , long Buffersize ) = 0; 58 | 59 | virtual long CloseObject( XHANDLE hHandle ) = 0; 60 | }; 61 | 62 | class __declspec(novtable) IImportData 63 | { 64 | public: 65 | 66 | virtual void Init( IXData *pXData , long Buffersize ) = 0; 67 | virtual void DeInit() = 0; 68 | 69 | virtual XHANDLE OpenObject( IXItem *pXItem ) = 0; 70 | 71 | // write data to the module 72 | virtual long WriteData( XHANDLE hHandle , void* Buffer , long Buffersize ) = 0; 73 | // 74 | virtual long CloseObject( XHANDLE hHandle ) = 0; 75 | }; 76 | 77 | MCNSEND -------------------------------------------------------------------------------- /MultiCommander/SDK/ExtensionInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * 8 | * Changes 9 | * --------------------- 10 | * 11 | */ 12 | 13 | #pragma once 14 | 15 | #include "MCNamespace.h" 16 | MCNSBEGIN 17 | 18 | 19 | // What type of extension/plugun it is. Only one (1) of the flags can be set per extension interface. 20 | 21 | #define EXT_TYPE_APP 0x00000100 // Application extension 22 | #define EXT_TYPE_FS 0x00000200 // Filesystem plugin (Eg. Zip, FTP, Registry) 23 | #define EXT_TYPE_FOP 0x00000400 // FileOperations plugin extension 24 | #define EXT_TYPE_PROP 0x00000800 // File properties plugin 25 | #define EXT_TYPE_THUMB 0x00000080 // File Thumbnail plugin 26 | #define EXT_TYPE_ALL 0x00000FF0 // ALL Extension Type 27 | 28 | 29 | #define EXT_OS_ANSI 0x00001000 // The extension is build for the ANSI API of Windows 30 | #define EXT_OS_UNICODE 0x00002000 // The extension is build for the UNICODE API of Windows. (Unicode is recommended) 31 | 32 | // Default values 33 | #define EXT_AUTOLOAD 0x00010000 // Autoload extension when MultiCommander is starting. (only valid if also EXT_TYPE_APP is set ) 34 | #define EXT_LOCALFS 0x00020000 // DO NOT USE - Internal flag for LocalFileSystem extension so that there can be some special handling for it make it faster. 35 | #define EXT_NOLANGFILE 0x00040000 // Do not try to load language file for this module. 36 | #define EXT_VIRTUALFFS 0x00060000 // DO NOT USE - Internal flag for LocalFileSystem extension so that there can be some special handling for it make it faster. 37 | #define EXT_CANTDISABLE 0x00100000 // The Extension CANT be disabled. ( some internal modules can't be disabled. normally do NOT use this flag ) 38 | #define EXT_PREINIT 0x00200000 // Call PreStartInit at startup for none APP extensions.. Needed for FileSystem/FileProp plugin if you want PreStartInit to be called (However PreStartInit is not called from main thread..) 39 | #define EXT_VDEVICEFS 0x00400000 // Virtual Device Filesystem. A virtual filesystem that is not located in a file(.zip/.rar) but in a Device (reg: , ftp: ). 40 | // eg. REG: FTP: .. ( the wsDefaultValues[0] is then not for matching extension but for matching devices ( eg "reg:") 41 | #define EXT_POSTINIT 0x01000000 // Call PostStartInit at the end of the startup phase. this call is called from the main ui thread, ( EXT_PREINIT is not ) 42 | 43 | struct DLLExtensionInfo 44 | { 45 | WCHAR wsName[100]; // Name of extension 46 | WCHAR wsPublisher[100]; // Publishers , Author 47 | WCHAR wsURL[100]; // URL to homepage for extension 48 | WCHAR wsDesc[250]; // Short description that will be shown in Extension manager 49 | WCHAR wsBaseName[100]; // Base filename for config and language files, Example if basename is "MyExt" then MyExt.xml is config , MyExt_lang_en.xml is loaded as language file 50 | char strVersion[10]; // Version of the extension ( use format "5.3.2.12" ) 51 | 52 | char strGuid[34]; // Guid of extension 53 | DWORD dwFlags; // EXT_ Flags 54 | DWORD dwInterfaceVersion; 55 | DWORD dwInitOrder; // Initialization Order. Lower -> Higher. User value for 1500 > 56 | DWORD dwLocalizedName; // TextID for localized name 57 | DWORD dwLocalizedDesc; // TextID for localized description 58 | HICON hIcon; 59 | 60 | // TODO - THIS NEED TO be Changed - how default parameters works. 61 | 62 | // If modules is EXT_TYPE_APP and EXT_AUTOLOAD and the first time the module is run it should use this as default values 63 | // For EXT_TYPE_APP it will have 4 "Key,Value,Key,Value" lists. and every list is a new Instance of the extension. 64 | WCHAR wsDefaultValues[4][512]; 65 | DWORD dwDefaultFlags[2]; 66 | 67 | // If the extension is of EXT_TYPE_FS (filesystem plugin) 68 | // Then register file ext and bytemarks as 69 | // wcsncpy( pInfo->wsDefaultValues[0] , "rar,r??,r00" , 512); // pInfo->wsDefaultValues[0] == Default File Extensions 70 | // wcsncpy( pInfo->wsDefaultValues[1] , "HEX:526172211A" , 512 );// pInfo->wsDefaultValues[1] == Default bytemarks for filesystem 71 | 72 | }; 73 | 74 | struct VersionInfo 75 | { 76 | wchar_t CompanyName[64]; 77 | wchar_t FileDescription[64]; 78 | wchar_t FileVersion[64]; 79 | wchar_t FileVersionEx[64]; 80 | wchar_t ProductName[64]; 81 | wchar_t ProductVersion[64]; 82 | wchar_t LegalCopyright[64]; 83 | wchar_t PrivateBuild[64]; 84 | wchar_t SpecialBuild[64]; 85 | }; 86 | MCNSEND 87 | 88 | -------------------------------------------------------------------------------- /MultiCommander/SDK/ExtensionSDK.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * 8 | * Changes 9 | * --------------------- 10 | * 11 | */ 12 | 13 | #pragma once 14 | 15 | #include "MultiExtension.h" // Extension interface 16 | #include "FileSystemPlugin.h" // FileSystem Plugin interface 17 | #include "IFileOperationPlugin.h"// File Operation Plugin interface. 18 | 19 | -------------------------------------------------------------------------------- /MultiCommander/SDK/FilePropertiesPlugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * 8 | * Changes 9 | * --------------------- 10 | * 11 | */ 12 | 13 | // 14 | // Include this if you are creating a FileProperties Plugin 15 | // 16 | #pragma once 17 | 18 | #include "SDKVersion.h" 19 | #include "Multi_Type.h" 20 | #include "ExtensionInfo.h" 21 | 22 | #include "IFileItem.h" 23 | #include "IFileProperties.h" 24 | #include "IFilePropertiesManager.h" 25 | 26 | #include "MultiApp_Def.h" 27 | #include "IAppInterface.h" 28 | 29 | -------------------------------------------------------------------------------- /MultiCommander/SDK/FileSystemPlugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * 8 | * Changes 9 | * --------------------- 10 | * 11 | */ 12 | 13 | // 14 | // Include this if you are creating a FileSystemPlugin 15 | // 16 | #pragma once 17 | 18 | #include "SDKVersion.h" 19 | #include "Multi_Type.h" 20 | #include "ExtensionInfo.h" 21 | 22 | #include "IVolume.h" 23 | -------------------------------------------------------------------------------- /MultiCommander/SDK/IAppConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * 8 | * Changes 9 | * --------------------- 10 | * 11 | */ 12 | 13 | #pragma once 14 | 15 | #include "MCNamespace.h" 16 | MCNSBEGIN 17 | 18 | // Application Configuration Interface 19 | // Use to get/set config 20 | 21 | /* 22 | WCHAR szValue1[100]; 23 | szValue1[0] = '\0'; 24 | IAppConfig* pConfig = m_pAppInterface->GetAppConfig(); 25 | ZHANDLE hConfigRoot = pConfig->GetConfigElement( NULL , L"config" ); 26 | pConfig->GetConfigValue(hConfigRoot, L"setting1", L"value", szValue1, _countof(szValue1)); 27 | */ 28 | 29 | struct FontAndIconSettings 30 | { 31 | wchar_t szFontName[100]; 32 | long fontStyle = 0; 33 | int fontSize = 0; 34 | int cxIconSize = 0; 35 | }; 36 | 37 | 38 | class IAppConfig 39 | { 40 | public: 41 | 42 | virtual ZHANDLE OpenConfig( long ModuleID = -1 , BOOL bSet = TRUE , BOOL bGetConfigElement = TRUE) = 0; 43 | virtual BOOL CloseConfig( ZHANDLE hHandle ) = 0; 44 | 45 | virtual bool VerifyConfig() = 0; 46 | 47 | // Validate existance of a config file, The path MUST be under the MC config path or the "restore" default file will not work 48 | virtual bool ValidateExistence(const wchar_t* szFilename, bool bRestoreIfMissing) = 0; 49 | // if bForceWrite is true then conifg is saved even if no change are detected. 50 | virtual BOOL SaveConfig( long ModuleID , bool bForceWrite = false ) = 0; 51 | virtual bool IsConfigChanged(long ModuleID) = 0; 52 | virtual BOOL CreateConfig() = 0; 53 | 54 | virtual bool SetConfigElementMatching( const WCHAR* strElementPath , short nMatchType , const WCHAR* strMatchName , const WCHAR* strMatchValue ) = 0; 55 | 56 | virtual int CountConfigGroupValues( ZHANDLE hHandle , const WCHAR* sGrp ) = 0; 57 | 58 | virtual ZHANDLE CreateConfigElement( ZHANDLE hParent , const WCHAR* strElement ) = 0; 59 | virtual bool RemoveConfigElement( ZHANDLE hElement ) = 0; 60 | 61 | virtual ZHANDLE GetConfigElement( ZHANDLE hHandle , const WCHAR* strElement , bool bCreate = false, bool bSilent = false) = 0; 62 | virtual ZHANDLE GetNextElement( ZHANDLE hHandle , const WCHAR* strElement ) = 0; 63 | 64 | virtual BOOL GetConfigText( ZHANDLE hHandle , const WCHAR* strElement , WCHAR* strOut , long lstrSize ) = 0; 65 | virtual BOOL GetConfigText( ZHANDLE hHandle , const WCHAR* strElement , const WCHAR* strName, const WCHAR* strValue, WCHAR* strContent, DWORD dwContentLen ) = 0; 66 | virtual BOOL SetConfigText( ZHANDLE hHandle , const WCHAR* strElement , const WCHAR* strName, const WCHAR* strValue, const WCHAR* strContent ) = 0; 67 | 68 | virtual BOOL GetConfigValue( ZHANDLE hHandle , const WCHAR* strElement , int nIndex , /*out*/WCHAR* sKey , /*out*/ WCHAR* sValue , long MaxSize ) = 0; 69 | virtual BOOL GetConfigValue( ZHANDLE hHandle , const WCHAR* strElement , const WCHAR* strName , WCHAR* OutString , long MaxSize ) = 0; 70 | 71 | // If bCreate is true, Value will be added if not found. And default value will be set and returned. 72 | virtual BOOL GetConfigValue_String( ZHANDLE zHandle , const WCHAR* strElement , const WCHAR* strName , WCHAR* /*IN & OUT*/strValue , int lMaxSize , bool bCreate = false) = 0; 73 | virtual BOOL GetConfigValue_Long( ZHANDLE zHandle , const WCHAR* strElement , const WCHAR* strName , /*OUT*/ long& lValue , long lDefault = 0 , bool bCreate = false ) = 0; 74 | virtual BOOL GetConfigValue_CR( ZHANDLE hHandle , const WCHAR* strElement , const WCHAR* strName , COLORREF &nCR , COLORREF crDefault = -1, bool bCreate = false ) = 0; 75 | virtual COLORREF GetConfigValue_CR( ZHANDLE zHandle, const WCHAR* strElement , const WCHAR* strName, COLORREF crDefault = -1, bool bCreate = false ) = 0; 76 | 77 | virtual bool SetConfigValue(ZHANDLE hHandle , const WCHAR* strElement , const WCHAR* strName , const WCHAR* strValue , bool bCreate = false ) = 0; 78 | virtual bool SetConfigValue(ZHANDLE hHandle , const WCHAR* strElement , const WCHAR* strName , long nValue , bool bCreate = false ) = 0; 79 | virtual bool SetConfigValue(ZHANDLE hHandle , const WCHAR* strElement , const WCHAR* strName , DWORD nValue , bool bCreate = false ) = 0; 80 | virtual bool SetConfigValue(ZHANDLE hHandle , const WCHAR* strElement , const WCHAR* strName , INT64 nValue , bool bCreate = false ) = 0; 81 | virtual bool SetConfigValue_CR(ZHANDLE hHandle , const WCHAR* strElement , const WCHAR* strName , COLORREF nColorRef , bool bCreate = false ) = 0; 82 | 83 | virtual bool GetExplorerPanelFontAndIconSettings(MCNS::FontAndIconSettings* pFontAndIcon) = 0; 84 | 85 | }; 86 | MCNSEND -------------------------------------------------------------------------------- /MultiCommander/SDK/IAppMenu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "MCNamespace.h" 4 | 5 | MCNSBEGIN 6 | 7 | class IAppMenu 8 | { 9 | public: 10 | virtual bool AddMenuSeperator() = 0; 11 | // dwMenuItemFlags - MF_DISABLED | MF_CHECKED | MF_GRAYED 12 | virtual bool AddMenuItem(const WCHAR* szItemText, DWORD dwCommand, DWORD dwMenuItemFlags) = 0; 13 | 14 | virtual IAppMenu* AddSubMenu(const WCHAR* szItemText) = 0; 15 | }; 16 | 17 | MCNSEND 18 | 19 | -------------------------------------------------------------------------------- /MultiCommander/SDK/IColumnLayoutManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * 8 | * Changes 9 | * --------------------- 10 | * 11 | */ 12 | 13 | #pragma once 14 | 15 | #include "MCNamespace.h" 16 | MCNSBEGIN 17 | 18 | // Option . Same as under IFilePropertiesManager 19 | class __declspec(novtable) IColumnLayoutInterface 20 | { 21 | public: 22 | virtual ~IColumnLayoutInterface() {} 23 | virtual bool AddColumn( const WCHAR* name, UINT nWidth, bool bReadonly = true, BYTE nAlign = DT_LEFT, WORD nFlags = 0, DWORD nOptions = 0) = 0; 24 | }; 25 | 26 | 27 | class __declspec(novtable) IColumnLayoutManager 28 | { 29 | public: 30 | virtual ~IColumnLayoutManager() {} 31 | 32 | virtual IColumnLayoutInterface* CreateColumnLayout() = 0; 33 | virtual void DeleteColumnLayout(IColumnLayoutInterface* pColumnLayout) = 0; 34 | 35 | virtual bool RegisterDefaultColumnLayout( IColumnLayoutInterface* pColumnLayout, const char* guid) = 0; 36 | 37 | }; 38 | 39 | MCNSEND -------------------------------------------------------------------------------- /MultiCommander/SDK/ICommandManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2000-2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * 8 | * Changes 9 | * --------------------- 10 | * 11 | */ 12 | 13 | /* 14 | Register Commands that can be assigned to Menus/Buttons/or other. 15 | 16 | Example 17 | 18 | // Create Command that by default also is assign to F7 hotkey (by default. since the FCUSTOMIZABLE is can be change by user) 19 | 20 | ZHANDLE hCmd = pAppInterface->RegisterCommand(CMD_MYCMD1, ZCF_ENABLE | ZCF_TARGET_THIS, L"My Command", "My Command" , MAKEACCELKEY(VK_F7,FVIRTKEY|FCUSTOMIZABLE) ) 21 | 22 | // Add Command to menu 23 | pMenuManager->AddMenuItem(hMyMenu, hCmd); 24 | 25 | */ 26 | 27 | #pragma once 28 | #include "MCNamespace.h" 29 | MCNSBEGIN 30 | 31 | class ICommandManager 32 | { 33 | public: 34 | // lCmdID = Extension Internal Command ID. 35 | // lFlags = ZCF_ 36 | virtual ZHANDLE RegisterCommand( ULONG lCmdID , long lFlags , long Title_ID , long ToolTip_ID=0 , DWORD hotKey=0 , ZHANDLE hAction=0) = 0; 37 | virtual ZHANDLE RegisterCommand( ULONG lCmdID , long lFlags , const WCHAR* pTitle , const WCHAR* pToolTip=NULL , DWORD hotKey=0 , ZHANDLE hAction=0) = 0; 38 | 39 | // if you KNOW that the lCmdID is resisted with ZCF_TARGET_THIS, then set bThisCommand to true. 40 | // It will find the correct cmd if it is registered as ZCF_TARGET_THIS and bThisCommand as false. but it is slower. 41 | virtual ZHANDLE FindCommand( ULONG lCmdID, bool bThisCommand = false ) = 0; 42 | virtual ZHANDLE FindCoreCommand(ULONG lCmdID) = 0; 43 | virtual ZHANDLE FindCommand(ULONG lInternalCmdID, long lExtID) = 0; 44 | 45 | // Enable / Disable command ( like grey then for menu / toolbars ) 46 | virtual BOOL EnableCommand( ZHANDLE hCmd , BOOL bEnable ) = 0; 47 | // Check/Uncheck command ( like check a menu item ) 48 | virtual BOOL CheckCommand( ZHANDLE hCmd , BOOL bChecked ) = 0; 49 | 50 | virtual long GetCommandFlags( ZHANDLE hCmd ) = 0; 51 | virtual BOOL SetCommandFlags( ZHANDLE hCmd , long lFlags ) = 0; 52 | 53 | // set lExtID == -1 for core command 54 | // nAddHotKey = 0, none , 1 Adds hotkey to the end, 2 adds hotkey to the end. using \t as text-hotkey separator. (useful for menu/contextmenus) 55 | virtual bool GetCommandDisplayText(WCHAR* szText, UINT nTextLen, ULONG lCmdID, long nExtID, int nAddHotKey = 0) = 0; 56 | 57 | virtual DWORD GetActiveCommandHotKey(ULONG lCmdID) = 0; 58 | }; 59 | MCNSEND 60 | -------------------------------------------------------------------------------- /MultiCommander/SDK/IConfiguration.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * NOT USED YET - But will be used in the future 8 | * Changes 9 | * --------------------- 10 | * 11 | */ 12 | 13 | #pragma once 14 | 15 | -------------------------------------------------------------------------------- /MultiCommander/SDK/IDataViewerWindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * the IDataViewerWindow interface is used both by consuming and creating a viewer. 8 | * 9 | * Extensions that act as a Viewer App can create a IDataViewerWindow interface and send it to the IDataViewerWindowConnector interface that is sent 10 | * if the extension gets a AM_VIEWEX command. (WPARAM is a IDataViewerWindowsConnector*) 11 | * 12 | * Any extension can also request to show a viewer window by using CreateDataViewerWindow() and will then recieve a IDataViewerWindow* 13 | * This interface is really a proxy to a real instance of a viewer 14 | * 15 | */ 16 | 17 | #pragma once 18 | #include "MCNamespace.h" 19 | 20 | MCNSBEGIN 21 | 22 | #define DVW_FEAT_VIEWMEMORY 0x00000010L // Support for viewing data located in a dynamic memory buffer. ViewMemory( nMaxMemorySize, viewMode ), then use AddData to add data 23 | #define DVW_FEAT_VIEWFILE 0x00000020L // Support for viewing data located in a file. Use ViewFile( , viewMode ); 24 | #define DVW_FEAT_VIEWMODE_ASCII 0x00000100L // View data as Ascii 25 | #define DVW_FEAT_VIEWMODE_UNICODE 0x00000200L // View data as Unicode (UTF16) 26 | #define DVW_FEAT_VIEWMODE_UTF8 0x00000400L // View data as UTF8 27 | #define DVW_FEAT_VIEWMODE_HEX 0x00000800L // View data as Hex 28 | #define DVW_FEAT_VIEWMODE_BINARY 0x00001000L // View data as Binary 29 | 30 | class IRWFile; 31 | class IFileItem; 32 | 33 | class IDataViewerWindow 34 | { 35 | public: 36 | 37 | // Since viewer might be created in another thread. this can be called before everything is setup. 38 | // Return true when everything is setup and the interface is ready to be used. 39 | virtual bool IsReady() = 0; 40 | 41 | // Return what features the current viewer supports. 42 | virtual DWORD GetFeatureSupport() = 0; 43 | 44 | // get/set options 45 | virtual DWORD SetOptions(DWORD dwOptions) = 0; // Not implemented yet 46 | virtual DWORD GetOptions() = 0; // Not implemented yet 47 | 48 | virtual DWORD Created() = 0; 49 | 50 | // View data from memory. Use AddData to add data to memory buffer that will be shown. 51 | virtual DWORD ViewMemory(size_t size) = 0; 52 | // Add data to the view. (Only allowed for the view is opened using ViewMemory) 53 | virtual DWORD AddData(const char* szText, size_t len) = 0; 54 | virtual DWORD AddData(const wchar_t* szText, size_t len) = 0; 55 | virtual DWORD AddData(const BYTE* szData, size_t len) = 0; 56 | 57 | // View a file. (Really? if you want to do this use ViewFile(..) in IFileSystemManager instead ) 58 | virtual DWORD ViewFile(const WCHAR* szFile) = 0; // Not implemented yet 59 | virtual DWORD ViewFile(const IFileItem* pFileItem) = 0; // Not implemented yet 60 | virtual DWORD ViewFile(const IRWFile* pVolumeFileItem) = 0; // Not implemented yet 61 | 62 | // Set how the data should be viewed. any of the DVW_FEAT_VIEWMODE_ flags can be set as long as it is support in GetFeatureSupport(); 63 | virtual DWORD SetViewMode(DWORD dwViewMode) = 0; 64 | 65 | // Show/Hide window 66 | virtual DWORD ShowWindow() = 0; 67 | virtual DWORD HideWindow() = 0; 68 | 69 | // Release the interface. But if the interface was created from IAppInterface->CreateDataViewerWindow(..) with true to AutoDelete. then do NOT call this. 70 | // Unless something goes wrong during initialization and you need to cleanup. 71 | virtual void Release() = 0; 72 | }; 73 | 74 | // Inherit from this if you create a viewer that should be connected to the public viewer interface 75 | class IDataViewerWindowConnector 76 | { 77 | public: 78 | virtual bool OnViewerConnected(MCNS::IDataViewerWindow* pViewer) = 0; 79 | virtual bool OnViewerDisconnected(MCNS::IDataViewerWindow* pViewer) = 0; 80 | }; 81 | 82 | MCNSEND 83 | -------------------------------------------------------------------------------- /MultiCommander/SDK/IEventCallback.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * 8 | * Changes 9 | * --------------------- 10 | * 11 | */ 12 | 13 | #pragma once 14 | 15 | #include "MCNamespace.h" 16 | MCNSBEGIN 17 | /* 18 | Event Callback interface for some UI components. 19 | 20 | Inherit from IEventCallback and send that pointer to the UI component. The OnEvent function will be call when a event happen and you can act on it. 21 | 22 | Example : (ILabelControl) 23 | m_pLabel->SetEventCallback(IEventCallback::Callback_ButtonDoubleClick, new CEvent_LabelDblClick(this)); 24 | 25 | If user now the user double click on the label the CEvent_LabelDblClick::OnEvent(..) function will be called. 26 | 27 | */ 28 | class CEventCallbackData 29 | { 30 | public: 31 | CEventCallbackData() 32 | { 33 | ZeroMemory(this,sizeof(CEventCallbackData)); 34 | } 35 | HWND hWnd; 36 | int nItem; 37 | int nSubItem; 38 | POINT pt; 39 | 40 | DWORD_PTR nParam; 41 | }; 42 | 43 | class __declspec(novtable) IEventCallback 44 | { 45 | public: 46 | 47 | // Callback event that controllers can support. not All types are supported by all controllers. 48 | enum EventCallbackType 49 | { 50 | Callback_Unknown = 0, 51 | 52 | // Any area of the controller 53 | Callback_ContextMenu = 1, // Right mouse button down 54 | Callback_CtrlContextMenu, // Right mouse button down 55 | Callback_LeftMouseButtonClick, 56 | Callback_RightMouseButtonClick, 57 | Callback_MiddleMouseButtonClick, 58 | Callback_LeftMouseButtonDblClick, 59 | Callback_RightMouseButtonDblClick, 60 | Callback_MiddleMouseButtonDblClick, 61 | Callback_ButtonClick, 62 | Callback_ButtonDoubleClick, 63 | 64 | // Click on special item inside the controller 65 | Callback_ItemClick, 66 | Callback_ItemCtrlClick, // ctrl button holded down and Clicked on item 67 | Callback_ItemShiftCtrlClick, // shift+ctrl holded down and clicked on item 68 | Callback_NoneItemClick, // Controller has Clickable items. but user clicked outside of the item. 69 | 70 | Callback_RMB_ItemClick, // Clicking on item using right mouse button. (can conflict with Callback_ContextMenu if controller support both) 71 | Callback_RMB_ItemCtrlClick, 72 | Callback_RMB_ItemShiftCtrlClick, 73 | Callback_RMB_NoneItemClick, 74 | 75 | // special 76 | Callback_FilesDropped, 77 | Callback_OnEditChange 78 | }; 79 | 80 | virtual ~IEventCallback() 81 | { 82 | } 83 | 84 | virtual void Delete() = 0; // Event is no longer needed. delete it. 85 | virtual INT OnEvent( EventCallbackType dwEventType , CEventCallbackData* pCallbackData ) = 0; 86 | 87 | virtual MCNS::ZHANDLE Command() { return 0; } 88 | }; 89 | 90 | ////////////////////////////////////////////////////////////////////////// 91 | 92 | class __declspec(novtable) ISetEvent 93 | { 94 | public: 95 | virtual bool SetEventCallback( MCNS::IEventCallback::EventCallbackType EventType , MCNS::IEventCallback* pEvent ) = 0; 96 | virtual bool SetEventMessage( MCNS::IEventCallback::EventCallbackType EventType , MCNS::ZHANDLE hCmd) = 0; 97 | virtual bool RemoveEventCallback(MCNS::IEventCallback::EventCallbackType EventType) = 0; 98 | }; 99 | 100 | MCNSEND -------------------------------------------------------------------------------- /MultiCommander/SDK/IExternalFile.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * 8 | * Changes 9 | * --------------------- 10 | * 11 | */ 12 | 13 | /* 14 | 15 | IExternalFile will get an file from an "archive" filesystem ( eg. zip file ) and unpack it to temp folder. 16 | and then automatically delete it when it is not used anymore. 17 | 18 | Example 19 | IFileSystemManager* pFileSysMan = GetIFileSystemManager(); 20 | 21 | IExternalFile* pVFile = pFileSysMan->CreateExternalFile( L"c:\MyZipfile.zip\MyTxtFile.txt" , VF_TRACKCHANGED | VF_UPDATE | VF_DELETE | VF_FINALTHREAD ); 22 | if( pVFile ) 23 | { 24 | WCHAR strExternalFilename[1024]; 25 | if( !pVFile->GetExternalFilename( strExternalFilename ) ) 26 | return FALSE; 27 | 28 | bRetVal = pFileSysMan->SHExecute( L"notepad.exe" , strExternalFilename , NULL , 0 , pVFile ); 29 | } 30 | 31 | */ 32 | 33 | #pragma once 34 | 35 | #include "MCNamespace.h" 36 | 37 | MCNSBEGIN 38 | 39 | // Options 40 | #define VF_TRACKCHANGED 0x0001 // Only Update if temporary external file is changed 41 | #define VF_UPDATE 0x0002 // Update original file 42 | #define VF_DELETE 0x0004 // Delete the temporary external file 43 | #define VF_DELETE_ALL 0x0008 // Delete all the files in the temp folder 44 | #define VF_DONT_ASK 0x0100 // Don't ask if it should replace 45 | #define VF_SILENT 0x0200 46 | #define VF_FINALTHREAD 0x1000 // Do the finalizing in separate thread 47 | #define VF_DONOTEXTRACTALL 0x2000 48 | 49 | ////////////////////////////////////////////////////////////////////////// 50 | class __declspec(novtable) IExternalFile 51 | { 52 | public: 53 | virtual ~IExternalFile() = default; 54 | 55 | // filepath to the external file. where it is temporary copied to. 56 | virtual bool GetExternalFilename( WCHAR* strFilename, int nMaxLen); 57 | 58 | // folder path to where external file is located 59 | virtual bool GetTempFolder(WCHAR* strFolder, int nMaxLen); 60 | 61 | // Original filepath reference 62 | virtual bool GetRefFilename(WCHAR* szFilename, int nLen); 63 | 64 | virtual HANDLE GetProcessHandle() = 0; 65 | virtual HANDLE GetThreadHandle() = 0; 66 | virtual DWORD GetProcessID() = 0; 67 | virtual DWORD GetThreadId() = 0; 68 | }; 69 | 70 | MCNSEND 71 | -------------------------------------------------------------------------------- /MultiCommander/SDK/IFavoritesManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "MCNamespace.h" 4 | 5 | MCNSBEGIN 6 | 7 | class __declspec(novtable) IFavoritesManager 8 | { 9 | public: 10 | virtual ~IFavoritesManager() {} 11 | 12 | virtual bool SetQuickPath(int nIdx, const WCHAR* szPath, DWORD dwReserved = 0) = 0; 13 | }; 14 | 15 | MCNSEND 16 | -------------------------------------------------------------------------------- /MultiCommander/SDK/IFileInfoInterface.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * NOT USED YET - But will be used in the future 8 | * 9 | * Changes 10 | * --------------------- 11 | * 12 | */ 13 | 14 | #pragma once 15 | -------------------------------------------------------------------------------- /MultiCommander/SDK/IFileItem.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiCommander/MultiCommander-SDK/885499ee70e1377c87f9ad78ed41fff2926370f0/MultiCommander/SDK/IFileItem.h -------------------------------------------------------------------------------- /MultiCommander/SDK/IFileOperationPlugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * Changes 8 | * --------------------- 9 | * 10 | */ 11 | 12 | -------------------------------------------------------------------------------- /MultiCommander/SDK/IFileOperations.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * Changes 8 | * --------------------- 9 | * 10 | */ 11 | 12 | #pragma once 13 | 14 | #include "MCNamespace.h" 15 | 16 | MCNSBEGIN 17 | 18 | #define FOS_FINISHED 1 19 | #define FOS_PAUSED 2 20 | #define FOS_RUNNING 3 21 | 22 | #define FOIS_DELETED 0x00000010L 23 | #define FOIS_COPIED 0x00000020L 24 | #define FOIS_MOVED 0x00000040L 25 | #define FOIS_RENAMED 0x00000080L 26 | 27 | #define FOIS_SUCCESS 0x00000001L 28 | #define FOIS_FAILED 0x00000002L 29 | 30 | // File operation - Overwrite attributes flags 31 | #define FO_OWF_OVERWRITE_READONLY 0x00010000L 32 | #define FO_OWF_OVERWRITE_SYSTEM 0x00020000L 33 | #define FO_OWF_OVERWRITE_HIDDEN 0x00040000L 34 | #define FO_OWF_OVERWRITE_ALLFLAGS 0x00070000L 35 | 36 | // overwrite by condition flags 37 | enum class OverwriteOption 38 | { 39 | Abort = -1, 40 | Ask = 0, 41 | SkipThis, 42 | RenameThis, 43 | AppendThis, 44 | OverwriteThis, 45 | AutoRenameThisNew, // Not imp yet 46 | AutoRenameThisExisting, // Not imp yet 47 | 48 | // all from here will affect all conflicts in the queue 49 | SkipAll = 10, 50 | OverwriteAll, 51 | OverwriteIfNewer, 52 | OverwriteIfOlder, 53 | OverwriteIfNewerAndSizeDiffers, 54 | OverwriteIfSizeDiffers, 55 | OverwriteIfSizeLarger, 56 | OverwriteIfSizeSmaller, 57 | OverwriteKeepBothAutoRenameNew, 58 | OverwriteKeepBothAutoRenameExisting, 59 | }; 60 | 61 | enum class ProtectedFileOption // if file has ReadOnly/System/Hidden attribute set 62 | { 63 | Abort = -1, 64 | Ask = 0, 65 | DeleteOrOverwriteAll, 66 | SkipAll, 67 | }; 68 | 69 | 70 | class __declspec(novtable) IFileOpStatusCallback 71 | { 72 | public: 73 | virtual ~IFileOpStatusCallback() = default; 74 | virtual DWORD GetOperationStatus() = 0; 75 | virtual void SetOperationStatus(DWORD nStatus) = 0; 76 | virtual void SetStatus( DWORD_PTR nRefItem , DWORD nStatus ) = 0; 77 | }; 78 | 79 | #define IFO_COPY 0x00000001L // Copy 80 | #define IFO_MOVE 0x00000002L // Move 81 | #define IFO_DELETE 0x00000004L // Delete 82 | #define IFO_RENAME 0x00000008L // ? Isn't rename same as move ? 83 | #define IFO_NO_RECURSIVE 0x00000100L // If source is a folder. DO not process recursive into folder 84 | #define IFO_VIRTUAL 0x00010000L // Item is virtual. source object does not exists. 85 | 86 | 87 | class __declspec(novtable) IFileOperationItem 88 | { 89 | public: 90 | 91 | // eg. "c:\temp\" path 92 | virtual void SetTarget( const WCHAR* strTarget ) = 0; 93 | // eg. "Kalle.tmp" name 94 | virtual void SetTargetName( const WCHAR* strTargetName ) = 0; 95 | 96 | // Full path to source item, eg. "d:\nisse\myfile.txt" 97 | virtual void SetSource( const WCHAR* strSource ) = 0; 98 | virtual void SetOptions( DWORD dwOptions ) = 0; 99 | 100 | // Get Taget Path 101 | virtual WCHAR* GetTarget( WCHAR* str , UINT nMaxLenght ) = 0; 102 | // Get Target Name 103 | virtual WCHAR* GetTargetName( WCHAR* str , UINT nMaxLenght ) = 0; 104 | // Get Source Item Path 105 | virtual WCHAR* GetSource( WCHAR* str , UINT nMaxLenght ) = 0; 106 | virtual const WCHAR* GetSource() const = 0; 107 | 108 | virtual DWORD GetOptions() = 0; 109 | 110 | // Set/Get custom RefValue. (Sent to plugin via callback) 111 | virtual void SetRefValue( DWORD_PTR nValue ) = 0; 112 | virtual DWORD_PTR GetRefValue() = 0; 113 | }; 114 | 115 | class __declspec(novtable) IFileOperation 116 | { 117 | public: 118 | virtual IFileOperationItem* AddNewFileOperation() = 0; 119 | 120 | virtual DWORD Count() = 0; 121 | virtual IFileOperationItem* GetAt( DWORD nIndex ) = 0; 122 | 123 | virtual void SetTargetPath( const WCHAR* str ) = 0; 124 | virtual WCHAR* GetTargetPath( WCHAR* str , UINT nMaxLength ) = 0; 125 | 126 | // FileOperations Options.. (Valid For all items) 127 | virtual DWORD GetOptions() = 0; 128 | virtual void SetOptions( DWORD dwOptions ) = 0; 129 | 130 | virtual void SetFilter(const WCHAR* strFilter) = 0; 131 | }; 132 | 133 | 134 | class __declspec(novtable) IRenameItem 135 | { 136 | public: 137 | virtual IFileItem* GetFileItem() = 0; 138 | virtual const WCHAR* GetOldName() = 0; 139 | virtual const WCHAR* GetNewName() = 0; 140 | 141 | virtual DWORD GetOptions() = 0; 142 | 143 | virtual DWORD_PTR GetRefData() = 0; 144 | 145 | virtual DWORD GetResultCode() = 0; 146 | //virtual DWORD RenameResult() = 0; // error code from rename operation 147 | }; 148 | 149 | class __declspec(novtable) IRenameItems 150 | { 151 | public: 152 | virtual IRenameItem* Add( IFileItem* pFileItem , const WCHAR* newName, DWORD_PTR nRefPtr = 0) = 0; 153 | 154 | virtual IRenameItem* Add( const WCHAR* oldName, const WCHAR* newName, DWORD_PTR nRefPtr = 0) = 0; 155 | 156 | virtual DWORD Count() = 0; 157 | 158 | virtual IRenameItem* GetAt( DWORD nIndex ) = 0; 159 | 160 | virtual void SetOptions(DWORD dwOptions) = 0; 161 | virtual DWORD GetOptions() = 0; 162 | 163 | virtual void Release() = 0; 164 | 165 | // Result state 166 | virtual DWORD ItemsRenamed() = 0; 167 | virtual DWORD ItemsFailed() = 0; 168 | }; 169 | 170 | MCNSEND -------------------------------------------------------------------------------- /MultiCommander/SDK/IFileProperties.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * Changes 8 | * --------------------- 9 | * 10 | */ 11 | 12 | #pragma once 13 | #include "MCNamespace.h" 14 | MCNSBEGIN 15 | 16 | /* 17 | 18 | FileProperties Interface 19 | 20 | Inherit and create and exhaustions using IFileProperties to add support for extended file properties that can be viewed in column, multi-rename and more. 21 | 22 | */ 23 | 24 | // forward deceleration 25 | class IMultiAppInterface; 26 | class IFileItem; 27 | 28 | struct __declspec(novtable) ExecuteInfo 29 | { 30 | int size; // sizeof(ExecuteInfo) 31 | 32 | IFileItem* pFileItem; 33 | WORD PropertyId; 34 | POINT pt; 35 | HWND hHwndParent; 36 | 37 | DWORD dwResult; 38 | }; 39 | 40 | class __declspec(novtable) IFileProperties 41 | { 42 | public: 43 | virtual ~IFileProperties() = default; 44 | 45 | // Override this and return GUID 46 | virtual char* Get_ModuleID() = 0; 47 | 48 | // Run when MC is starting up. 49 | // Override and add code to register property types in here 50 | virtual long PreStartInit( IMultiAppInterface* /*pInterface*/ ) { return 0; } 51 | 52 | 53 | // Open file to get properties for 54 | // return true if successfully or false if failed 55 | virtual bool Open(IFileItem* pParentFileItem) = 0; 56 | virtual bool Open(const WCHAR* szParentPath) = 0; 57 | 58 | virtual bool Close() = 0; 59 | 60 | // Please note for properties that takes long time to get 61 | // 62 | // If the property that is return can take long time to get. then try to check 63 | // the pAbort parameter periodically 64 | // 65 | // if(pAbort && *pAbort == true) and then abort the process of getting the property 66 | // 67 | // pAbort is set to true if user is browsing away from the current folder 68 | // 69 | 70 | // return a value with GetDisplayValue if the property has a special value for presentation. 71 | // Example. a Num Property might be presented with a Text for display, so instead of showing 3, 5, it can show "Novice" , "Advanced". but Internally 72 | // it is a number. When doing sorting on a column the GetPropStr / GetPropNum will be used. and there the num value are returned. 73 | 74 | // if no display value is used then GetPropStr/GetPropNum is called and if it is a number will just be converted into a string for display 75 | 76 | // Why no just show all values as string then? you ask, because we want to be able to use extended number properties 77 | // from search, script and so on. and also so that sorting is correct, and if a property is a number we know we can do > (bigger then) == equal. 78 | // 79 | // Exception to the rule - FILEPROP_DATE properties are not called for DisplayValues. GetPropNum are always called on them. And we use the 80 | // user defined date/time settings so show the date 81 | 82 | virtual bool GetDisplayValue(IFileItem* pFileItem, WCHAR* propData, WORD nLen, WORD PropertyId, const volatile bool* pAbort) = 0; // Remove volatile - Not needed 83 | 84 | // called for property that are FILEPROP_STRING 85 | virtual bool GetPropStr(IFileItem* pFileItem, WCHAR* propData, WORD nLen, WORD PropertyId, const volatile bool* pAbort) = 0;// Remove volatile - Not needed 86 | 87 | // called if property is FILEPROP_NUM or FILEPROP_DATE if DATE the INT64 is a FILETIME 88 | virtual bool GetPropNum(IFileItem* pFileItem, INT64* propData, WORD PropertyId, const volatile bool* pAbort) = 0;// Remove volatile - Not needed 89 | 90 | // called if property is FILEPROP_DOUBLE 91 | virtual bool GetPropDouble(IFileItem* pFileItem, double* propData, WORD PropertyId, const volatile bool* pAbort) = 0;// Remove volatile - Not needed 92 | 93 | // optional 94 | // Format a cached raw property value. If false is return GetDisplayValue will be called and if that failed raw value is converted to string and used 95 | virtual bool FormatDisplayValue(WCHAR* /*szDisplayValue*/, WORD /*nLen*/, double /*dValue*/, WORD /*PropertyId*/) { return false; } 96 | virtual bool FormatDisplayValue(WCHAR* /*szDisplayValue*/, WORD /*nLen*/, INT64 /* nValue*/, WORD /*PropertyId*/) { return false; } 97 | 98 | virtual bool SetProp(IFileItem* pFileItem, WORD PropertyId, const BYTE* propData) = 0; 99 | 100 | // override to support execute action on property 101 | // return true if handled. else something else will get the execute command 102 | // Make sure "pExecuteInfo->size == sizeof(ExecuteInfo)" 103 | virtual bool Execute(ExecuteInfo* /*pExecuteInfo*/) { return false; } 104 | protected: 105 | 106 | }; 107 | MCNSEND -------------------------------------------------------------------------------- /MultiCommander/SDK/IFilePropertiesManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * Changes 8 | * --------------------- 9 | * 10 | */ 11 | 12 | #pragma once 13 | 14 | #include "MCNamespace.h" 15 | MCNSBEGIN 16 | 17 | // FileProperty Flags (Options) 18 | #define FILEPROP_STRING 0x00000100L 19 | #define FILEPROP_NUM 0x00000200L 20 | #define FILEPROP_DATE 0x00000400L 21 | #define FILEPROP_DOUBLE 0x00000800L 22 | 23 | #define FILEPROP_FORMATDISP 0x00001000L // Format a display value from a cached raw property value. 24 | #define FILEPROP_DATE_UTC 0x00002000L // File property is date and UTC.. require FILEPROP_DATE 25 | 26 | #define FILEPROP_ONLY_FOLDER 0x00004000L // This prop is only valid for folders. 27 | #define FILEPROP_ONLY_FILES 0x00008000L // this prop is only valid for files 28 | 29 | #define FILEPROP_CUSTOMIZABLE 0x00010000L // The FileProperty item is customizable. The User can add/remove this column (not just enable/disable) 30 | // If this is not set. It can only be set by a module using the ColumnLayout 31 | 32 | #define FILEPROP_ASYNC 0x00020000L // Get this column data asyncrone. (If it takes time to fetch this column information adding this flag is recommeded) 33 | #define FILEPROP_NOTINMENU 0x00040000L // Items that are Customizable and this flag will NOT be shown directly in the context menu. 34 | // user have to go into the "customize..." option to find them 35 | // Add this to properties that are not often used. Because we do not want the entire screen to be covered when showing the contextmenu 36 | 37 | 38 | #define FILEPROP_DONOTCACHEASDISPLAY 0x00100000L // Do not cache value as display value. Value will be featch every thing it is draw.. !! warning! very slow 39 | #define FILEPROP_EDITABLE 0x01000000L // - Not supported yet 40 | #define FILEPROP_EXECUTE 0x02000000L // - If set and user Ctrl + DoubleClick on property in the explorerPanel 41 | // then IFileProperties->Execute(IFileItem* pFileItem , DWORD PropertyId) is called 42 | #define FILEPROP_CLEAR_IF_UPDATED 0x10000000L // Clear cached property if file item is updated (Date changed, Attribute changed, File size changed , other metadata changed) 43 | #define FILEPROP_CLEAR_IF_RENAMED 0x20000000L // Clear cached property if file item is renamed 44 | 45 | struct FilePropData 46 | { 47 | WORD PropertyId; 48 | short IdealWidth; 49 | short columnFlags; // See IMLC_ for IMLC_OVERDRAW, IMLC_ALLOW_OVERDRAW, IMLC_SORT_DECENDING, IMLC_STRETCH 50 | BYTE Align; 51 | BYTE SubCategory; 52 | DWORD dwOptions; // FILEPROP_ASYNC , FILEPROP_.... , ... 53 | const WCHAR* szPropName; 54 | const WCHAR* szDisplayName; 55 | const WCHAR* szColumnName; 56 | const WCHAR* szCategoryName; 57 | const WCHAR* szDescription; 58 | }; 59 | 60 | class __declspec(novtable) IFilePropertiesManager 61 | { 62 | public: 63 | 64 | // PropertyId - Unique Identifier for property 65 | // propName - name identifier 66 | // displayName - The name shown to the user 67 | // categoryName - Category name shown to the user 68 | // 69 | // 70 | // Category and displayName together is uses to build strings to show to user.. 71 | // eg just displayName is shown in column header 72 | // But when selection columns to show the CategoryName is also shown " - " 73 | 74 | virtual bool RegisterProperty(FilePropData* pFilePropertyData) = 0; 75 | 76 | // Must be run before registering properties. 77 | // No need to run it if only querying properties value 78 | virtual bool Init(const char* guid) = 0; 79 | 80 | }; 81 | 82 | MCNSEND -------------------------------------------------------------------------------- /MultiCommander/SDK/IFilePropertiesRetriever.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * Changes 8 | * --------------------- 9 | * 10 | */ 11 | 12 | #pragma once 13 | #include "MCNamespace.h" 14 | MCNSBEGIN 15 | 16 | // 17 | // Get FileProperties from a filename 18 | // 19 | 20 | class IFilePropertiesRetriever 21 | { 22 | public: 23 | // If FileProperty is a date property and pFT is NULL then value will be converted into a date string and set to szText 24 | virtual int GetFileProp(WCHAR* szText, int nLen, const WCHAR* szProp, FILETIME* pFT, const WCHAR* szFilename) = 0; 25 | 26 | // szPropName is be a extension name like MCPictureProp then only properties for that extension will be returned. 27 | // if it is nullptr then all will be returned. 28 | virtual int GetProperties(IKeyValCollection* pCollection, const WCHAR* szPropName = nullptr) = 0; 29 | 30 | virtual void Release() = 0; 31 | }; 32 | MCNSEND -------------------------------------------------------------------------------- /MultiCommander/SDK/IFileSystemMonitor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * Changes 8 | * --------------------- 9 | * 10 | */ 11 | 12 | #pragma once 13 | #include "MCNamespace.h" 14 | MCNSBEGIN 15 | 16 | #define FSM_MODIFIED 0x0001 17 | #define FSM_ADDED 0x0002 18 | #define FSM_REMOVED 0x0004 19 | #define FSM_RENAMED 0x0008 20 | 21 | class __declspec(novtable) IFileSystemMonitor 22 | { 23 | public: 24 | 25 | // Refresh this path, (No rescan. refreshed existing items) and notify all views to reload 26 | virtual void RefreshPath(const WCHAR* szPath) = 0; 27 | 28 | // Force a reload of path 29 | virtual void RescanPath(const WCHAR* szPath) = 0; 30 | 31 | // Remove item from FileSystem Cache, and notify all views that the item is gone. 32 | virtual void FileSystemItemRemoved(const WCHAR* szPath) = 0; 33 | /* 34 | virtual void InvokeChange(const WCHAR* strPath, DWORD dwFlags) = 0; 35 | 36 | virtual bool AddIgnoreChange(const WCHAR* strPath, DWORD dwFlags) = 0; 37 | virtual bool RemoveIgnoreChange(const WCHAR* strPath, DWORD dwFlags) = 0; 38 | 39 | // Not sure about this 40 | // Turn Notifications on/off 41 | virtual bool SetViewChangeNotification( ZHANDLE hView, bool bAcceptNotification ) = 0; 42 | */ 43 | }; 44 | 45 | MCNSEND -------------------------------------------------------------------------------- /MultiCommander/SDK/IFrameWindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * Changes 8 | * --------------------- 9 | * 10 | */ 11 | 12 | #pragma once 13 | 14 | #include "Multi_Type.h" 15 | #include "MCNamespace.h" 16 | MCNSBEGIN 17 | 18 | #define FW_TOOLBAR 0x00000004 19 | #define FW_STATUSBAR 0x00000008 20 | 21 | #ifndef SBPS_NORMAL 22 | #define SBPS_NORMAL 0x0000 23 | #define SBPS_NOBORDERS SBT_NOBORDERS 24 | #define SBPS_POPOUT SBT_POPOUT 25 | #define SBPS_OWNERDRAW SBT_OWNERDRAW 26 | #define SBPS_DISABLED 0x04000000 27 | #define SBPS_STRETCH 0x08000000 // stretch to fill status bar 28 | #endif 29 | 30 | // OBSOLETE - Not used 31 | 32 | class IFrameWindow 33 | { 34 | public: 35 | virtual ZHANDLE CreateMainView(DWORD nViewID, long createParam, long param1, long param2) = 0; 36 | 37 | // A child window is a dlg. We must know that. (so we can pass message to IDialogMessage) 38 | virtual void AddDlgWindow(HWND hWnd) = 0; 39 | 40 | virtual void SetCaption(const WCHAR* szCaption) = 0; 41 | 42 | // Create the frame window. A MainView must have been added to the frame window, or this will fail 43 | virtual bool Create() = 0; 44 | 45 | // after calling this. this interface is not valid anymore 46 | virtual bool DeleteFrameWindow() = 0; 47 | 48 | virtual bool LoadWindowPos(const WCHAR* szSettingsName, int defaultHeight, int defaultWidth) = 0; 49 | virtual bool SaveWindowPos(const WCHAR* szSettingsName) = 0; 50 | // 51 | virtual void RecalcLayout() = 0; 52 | 53 | // Post Message that will close this frame when it can 54 | virtual void PostCloseMessage() = 0; 55 | 56 | // nID = The id a a statusbar item. 57 | // return idx for item if pos is -1 58 | virtual int AddStatusBarIndicator(int pos, UINT nID, UINT nStyle = SBPS_NORMAL) = 0; 59 | virtual void SetStatusBarPaneWidth(int pos, int width) = 0; 60 | virtual void SetStatusBarPaneStyle(int pos, unsigned int style) = 0; 61 | virtual void SetStatusBarPaneText(UINT nID, const WCHAR* szText) = 0; 62 | }; 63 | 64 | MCNSEND -------------------------------------------------------------------------------- /MultiCommander/SDK/IHTTPRequest.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /* 3 | Example Syncrone call. 4 | 5 | IHTTPRequest* pRequest = m_pInterfce->CreateHTTPRequester(); 6 | 7 | pRequest->SetHeader("Cookie", "3435465654"); 8 | IHTTPResponse* pResponse = pRequest->SendRequestGET("http://example.com/jason/query?windows"); 9 | if(pResonse) 10 | { 11 | if(pResonse->DataLength() > 0) 12 | { 13 | MyJSONParser parser(pResonse->Data(), pResonse->DataLength()); 14 | ... 15 | ... 16 | } 17 | 18 | //pResonse->Release(); 19 | pRequest->Release(); // Will also delete the pResonse that SendRequstGET returned, if not already relased. 20 | } 21 | 22 | */ 23 | 24 | #include "MCNamespace.h" 25 | 26 | MCNSBEGIN 27 | class IHTTPResponse; 28 | 29 | class __declspec(novtable) IHTTPAsyncCallback 30 | { 31 | public: 32 | virtual void OnTransferFailed() = 0; 33 | virtual void OnTransferCompleted(IHTTPResponse* pResponse) = 0; 34 | }; 35 | // Receive 36 | class __declspec(novtable) IHTTPReceiveCallback 37 | { 38 | public: 39 | // return false to Abort data transfer 40 | virtual bool OnDataReceive(const BYTE* pData, DWORD nDataLen) = 0; 41 | }; 42 | 43 | 44 | class __declspec(novtable) IHTTPSendCallback : public IHTTPReceiveCallback 45 | { 46 | public: 47 | // When sending data to the server the interface is called to get the data 48 | // that should be sent to the server. it will continue to ask for data until *pDataWritten is 0. 49 | // if false is return the data transfer is aborted. 50 | // 51 | // pData = pointer to where to copy data 52 | // nDataLen = Max size of pData 53 | // *pDataWritten = How many byte actual written to pData 54 | virtual bool OnGetDataSend(BYTE* pData, DWORD nDataLen, DWORD* pDataWritten) = 0; 55 | }; 56 | 57 | class __declspec(novtable) IHTTPResponse 58 | { 59 | public: 60 | virtual DWORD ResponseCode(char* szResponseCodeText, int len) = 0; 61 | virtual DWORD DataLen() = 0; 62 | virtual const BYTE* Data() = 0; 63 | 64 | virtual bool CopyData(BYTE* dst, DWORD nDataLen) = 0; 65 | 66 | virtual DWORD ErrorCode() = 0; 67 | 68 | virtual void Release() = 0; // will release and delete it 69 | }; 70 | 71 | /* 72 | * Internal receive/send buffer is 1 MB. 73 | * If you want to receive or send larger the use the callback. 74 | **/ 75 | class __declspec(novtable) IHTTPRequest 76 | { 77 | public: 78 | virtual bool SetHeader(const char* szKey, const char* szValue) = 0; 79 | 80 | virtual IHTTPResponse* SendRequestGET(const char* szURL) = 0; 81 | virtual IHTTPResponse* SendRequestGET(const char* szURL, IHTTPReceiveCallback* pCallback) = 0; 82 | 83 | // Not Implemented yet 84 | virtual IHTTPResponse* SendRequestPOST(const char* szURL, const char* szBody, DWORD bodyLen) = 0; 85 | virtual IHTTPResponse* SendRequestPOST(const char* szURL, IHTTPSendCallback* pCallback) = 0; 86 | 87 | // if result is NULL for SendRequestGET/SendRequestPOST 88 | virtual DWORD GetResponseCode() = 0; 89 | virtual DWORD LastError(WCHAR* szErrorMessage = NULL, DWORD nLen = 0) = 0; 90 | 91 | virtual void Release() = 0; // will release and delete it, Will also release IHTTPResponse returned belonging to this interface 92 | 93 | // Not implemented Yet 94 | virtual bool SendAsyncRequestGET(const char* szURL, IHTTPAsyncCallback* pCallback) = 0; 95 | }; 96 | 97 | MCNSEND 98 | -------------------------------------------------------------------------------- /MultiCommander/SDK/ILogger.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * Changes 8 | * --------------------- 9 | * 10 | */ 11 | 12 | /* 13 | 14 | 15 | History 16 | -------- 17 | 18 | 19 | */ 20 | #ifndef _ZILOGGER_IF_ 21 | #define _ZILOGGER_IF_ 22 | 23 | #pragma once 24 | 25 | #include "MCNamespace.h" 26 | #include "IStatus.h" 27 | MCNSBEGIN 28 | 29 | namespace LogOptions 30 | { 31 | enum Encoding { ASCII = 1, Unicode= 2, UTF8 = 3 }; 32 | }; 33 | 34 | class __declspec(novtable) ILogger 35 | { 36 | public: 37 | 38 | // Connect the logger to the exiting FileSystemLog 39 | 40 | virtual void InitFileSystemLog(); 41 | // bCreateNew : true if it already should create a new. if a log with existing name already exist a new log with same name will be created. else it will use same log. 42 | // szLogFilename : Filename of the log. (NO path should be giving. the log will be stored in the log folder. ) 43 | virtual bool Init(bool bCreateNew, const WCHAR* szLogName, DWORD nLogSizeKB, bool bSaveToFile, const TCHAR* szLogFilename = NULL, LogOptions::Encoding encoding = LogOptions::ASCII) = 0; 44 | 45 | // Show the Log view. (There is many log windows in the tab log window. this will bring the current logwindow onfront) 46 | virtual void ShowLog() = 0; 47 | 48 | // Hide/Show the entire log window 49 | virtual void ShowLogWindow(bool b) = 0; 50 | 51 | virtual void TimeStamp(bool bTimeStamp, bool bIncludeMilliseconds = false) = 0; 52 | virtual bool TimeStamp() = 0; 53 | 54 | virtual bool Log(const WCHAR* szMessage, ...) = 0; 55 | virtual bool Log(const CHAR* szMessage, ...) = 0; 56 | 57 | virtual bool Log(LogLevel level, const WCHAR* szMessage, ...) const = 0; 58 | virtual bool Log(LogLevel level, const CHAR* szMessage, ...) const = 0; 59 | 60 | // force a redraw now 61 | virtual void Redraw() = 0; 62 | 63 | // release and delete object 64 | virtual void Release() = 0; 65 | 66 | }; 67 | 68 | MCNSEND 69 | 70 | #endif -------------------------------------------------------------------------------- /MultiCommander/SDK/IMCThumbnail.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * Changes 8 | * --------------------- 9 | * 10 | */ 11 | 12 | #pragma once 13 | 14 | #include "MCNamespace.h" 15 | MCNSBEGIN 16 | 17 | class IMultiAppInterface; 18 | class IFileItem; 19 | 20 | #define MCTHUMB_QUALITY_BEST 0x00000100 // Slowest but best quality (Bilinear?) 21 | #define MCTHUMB_QUALITY_AVR 0x00000200 22 | #define MCTHUMB_QUALITY_WORST 0x00000400 // Fastest 23 | 24 | class __declspec(novtable) IMCThumbnail 25 | { 26 | public: 27 | // Return the module ID that is a GUID string 28 | virtual char* Get_ModuleID() = 0; 29 | 30 | virtual long PreStartInit( IMultiAppInterface* /*pInterface*/) { return 0; } 31 | 32 | virtual HBITMAP GetThumbnail(const WCHAR* szFullPath, int cxThumbSize, int cyThumbSize, DWORD dwFlags = 0) = 0; 33 | }; 34 | 35 | MCNSEND 36 | -------------------------------------------------------------------------------- /MultiCommander/SDK/IMenuManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * Changes 8 | * --------------------- 9 | * 10 | */ 11 | 12 | #pragma once 13 | #include "MCNamespace.h" 14 | MCNSBEGIN 15 | 16 | // Add/Remove menu item from main menu 17 | 18 | class IMenuManager 19 | { 20 | public: 21 | // TextID is the ID of a test string 22 | virtual ZHANDLE FindMenu( long TextId , BOOL bCreateIfNotFound = FALSE ,BOOL bModuleTextID = TRUE ) = 0; 23 | virtual ZHANDLE FindMenu( ZHANDLE hMenu , long TextId , BOOL bCreateIfNotFound = FALSE ,BOOL bModuleTextID = TRUE ) = 0; 24 | virtual ZHANDLE FindMenu( ZHANDLE hMenuParent, const WCHAR* szMenuName, BOOL bCreateIfNotFound = FALSE) = 0; 25 | 26 | 27 | virtual ZHANDLE AddMenu( long TextId ) = 0; 28 | virtual ZHANDLE AddMenu( const WCHAR* strMenuName, BOOL bIgnoreIfExists = TRUE) = 0; 29 | virtual ZHANDLE AddMenu( ZHANDLE hParentMenu , long TextID , BOOL bIgnoreIfExists = TRUE ) = 0; 30 | virtual ZHANDLE AddMenu( ZHANDLE hParentMenu , const WCHAR* szText, BOOL bIgnoreIfExists = TRUE ) = 0; 31 | 32 | virtual ZHANDLE AddMenuBefore( long BeforeTextId , long TextId, BOOL bIgnoreIfExists = TRUE ) = 0; 33 | virtual ZHANDLE AddMenuBefore( const WCHAR* strBeforeMenuName , const WCHAR* strMenuName, BOOL bIgnoreIfExists = TRUE) = 0; 34 | virtual ZHANDLE AddMenuBefore( ZHANDLE hMenu, long TextId, BOOL bIgnoreIfExists = TRUE ) = 0; 35 | 36 | virtual ZHANDLE AddMenuAfter( long AfterTextId , long TextId, BOOL bIgnoreIfExists = TRUE ) = 0; 37 | virtual ZHANDLE AddMenuAfter( const WCHAR* strAfterMenuName , const WCHAR* strMenuName, BOOL bIgnoreIfExists = TRUE) = 0; 38 | 39 | virtual long AddMenuItem_Force(ZHANDLE hMenu, ZHANDLE hCmd, BOOL bIgnoreIfExists = TRUE, HICON hIcon = 0) = 0; 40 | virtual long AddMenuItem( ZHANDLE hMenu , ZHANDLE hCmd , BOOL bIgnoreIfExists = TRUE , HICON hIcon = 0 ) = 0; 41 | // Add MenuItem After The Cmd hAfterCmd. if it is 0 Then add it on Top. to add at bottom use 'AddMenuItem' 42 | virtual long AddMenuItemAfter( ZHANDLE hMenu, ZHANDLE hAfterCmd , ZHANDLE hCmd , BOOL bIgnoreIfExists = TRUE , HICON hIcon = 0 ) = 0; 43 | virtual long AddMenuItemBefore( ZHANDLE hMenu, ZHANDLE hAfterCmd , ZHANDLE hCmd , BOOL bIgnoreIfExists = TRUE , HICON hIcon = 0 ) = 0; 44 | virtual long AddMenuItemAfterItem( ZHANDLE hMenu, ZHANDLE hMenuItem , ZHANDLE hCmd , BOOL bIgnoreIfExists = TRUE , HICON hIcon = 0 ) = 0; 45 | virtual long AddMenuItemBeforeItem( ZHANDLE hMenu, ZHANDLE hMenuItem , ZHANDLE hCmd , BOOL bIgnoreIfExists = TRUE , HICON hIcon = 0 ) = 0; 46 | 47 | // Add Separator 48 | virtual long AddMenuSeperator( ZHANDLE hParentMenu , ZHANDLE hAfterMenu = 0 ) = 0; 49 | 50 | virtual void RebuildMenu()=0; 51 | 52 | // To Be used with Toolbar buttons for example. 53 | virtual ZHANDLE CreateDynamicMenu( DWORD nID ) = 0; 54 | virtual ZHANDLE AddDynamicMenu( ZHANDLE hMenu ,const WCHAR* strMenuName , BOOL bIgnoreIfExists = TRUE ) = 0; 55 | virtual ZHANDLE AddDynamicMenuItem( ZHANDLE hMenuMan , ZHANDLE hMenu , const WCHAR* strMenuItemName , BOOL bIgnoreIfExists = TRUE ) = 0; 56 | virtual ZHANDLE AddDynamicMenuItem( ZHANDLE hMenuMan , ZHANDLE hMenu , ZHANDLE hCmd , BOOL bIgnoreIfExists = TRUE ) = 0; 57 | virtual ZHANDLE ReBuildDynamicMenu( ZHANDLE hMenu ) = 0; 58 | 59 | // virtual void Release() = 0; 60 | 61 | }; 62 | 63 | MCNSEND -------------------------------------------------------------------------------- /MultiCommander/SDK/IMultiWindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * Changes 8 | * --------------------- 9 | * 10 | */ 11 | 12 | #pragma once 13 | #include "MCNamespace.h" 14 | MCNSBEGIN 15 | class IMultiWindow 16 | { 17 | public: 18 | virtual HWND GetHWND() = 0; 19 | virtual BOOL PreTranslateMessage(MSG* pMsg) = 0; 20 | 21 | virtual BOOL DestroyWindow() = 0; 22 | virtual void PostNcDestroy() = 0; 23 | }; 24 | 25 | MCNSEND -------------------------------------------------------------------------------- /MultiCommander/SDK/IRecentManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * Changes 8 | * --------------------- 9 | * 10 | */ 11 | 12 | #pragma once 13 | #include "MCNamespace.h" 14 | MCNSBEGIN 15 | 16 | class __declspec(novtable) IRecentManager 17 | { 18 | public: 19 | virtual ~IRecentManager() {} 20 | 21 | virtual void Init( DWORD nRecentCount ) = 0; 22 | 23 | virtual void Add(const WCHAR* szDisplayName, const WCHAR* szValue, DWORD_PTR dwCustomParam) = 0; 24 | virtual void ChangeCurrentValue(const WCHAR* szValue, DWORD_PTR dwCustomParam) = 0; 25 | 26 | virtual DWORD GetLastSelected() = 0; 27 | virtual void SetLastSelected(DWORD nIdx) = 0; 28 | 29 | virtual DWORD Count() = 0; 30 | 31 | virtual bool GetName( WCHAR* str ,DWORD nTextLen, DWORD nIdx ) = 0; 32 | virtual bool GetValue( WCHAR* str ,DWORD nTextLen, DWORD nIdx ) = 0; 33 | virtual DWORD_PTR GetCustomParam( DWORD nIdx ) = 0; 34 | 35 | // Lock / UnLock recent manager for Add's. if locked then if Add is call nothing is added. 36 | virtual void Lock() = 0; 37 | virtual void UnLock() = 0; 38 | 39 | virtual void Clear() = 0; 40 | 41 | }; 42 | 43 | class __declspec(novtable) IHistoryManager 44 | { 45 | public: 46 | virtual void Add(const WCHAR* szItem) = 0; 47 | virtual bool GetHistoryItem( WCHAR* str ,DWORD nTextLen, DWORD nIdx ) = 0; 48 | 49 | // Call to cleanup 50 | virtual void Release() = 0; 51 | }; 52 | 53 | MCNSEND -------------------------------------------------------------------------------- /MultiCommander/SDK/IRestartRecoveryDataCollector.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "MCNamespace.h" 3 | MCNSBEGIN 4 | 5 | 6 | class __declspec(novtable) IRestartRecoveryDataCollector 7 | { 8 | public: 9 | virtual ~IRestartRecoveryDataCollector() {} 10 | 11 | virtual void AddValue(const wchar_t* key, const wchar_t* value) = 0; 12 | virtual bool AddData(const wchar_t* key, const BYTE* pData, DWORD dataLen) = 0; 13 | 14 | virtual void Clear() = 0; 15 | virtual const wchar_t* GetKeyValue(const wchar_t* key) = 0; 16 | 17 | }; 18 | 19 | MCNSEND -------------------------------------------------------------------------------- /MultiCommander/SDK/IRunAsAdmin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * Changes 8 | * --------------------- 9 | * 10 | */ 11 | 12 | #pragma once 13 | 14 | #include "MCNamespace.h" 15 | MCNSBEGIN 16 | // Helper for creating command that can be sent to RunAsAdmin 17 | class __declspec(novtable) IDataBuilder 18 | { 19 | public: 20 | 21 | virtual bool PreAllocate(DWORD nSize) = 0; 22 | 23 | virtual bool AddData(const BYTE* pData, DWORD nLen) = 0; 24 | // Include NULL terminating character 25 | virtual bool AddData(const WCHAR* szWString) = 0; 26 | virtual bool AddData(const CHAR* szAString) = 0; 27 | virtual bool AddData(DWORD nValue) = 0; 28 | 29 | virtual const BYTE* Data() = 0; 30 | virtual DWORD Size() = 0; 31 | 32 | virtual void Release() = 0; 33 | }; 34 | 35 | class __declspec(novtable) IDataParser 36 | { 37 | public: 38 | virtual void Init(const BYTE* pData, DWORD nLen) = 0; 39 | 40 | // return false if EOD 41 | virtual bool ParseData( BYTE* pData, DWORD nLen ) = 0; 42 | virtual bool ParseData(DWORD* pData) = 0; 43 | virtual bool ParseData(const WCHAR** pszWString) = 0; 44 | virtual bool ParseData(const CHAR** pszAString) = 0; 45 | 46 | virtual void Release() = 0; 47 | }; 48 | 49 | class __declspec(novtable) IRunAdminCommand 50 | { 51 | public: 52 | virtual DWORD GetCommandID() = 0; 53 | 54 | virtual const BYTE* Data() = 0; 55 | virtual DWORD DataLen() = 0; 56 | 57 | 58 | virtual void SetResponse(DWORD nResult, DWORD ErrorCode, const BYTE* pData = NULL, DWORD nDataLen = 0) = 0; 59 | 60 | // When the Admin process has loaded a DLL and Created an Interface for it. this is cached in case more request are the extension are sent. 61 | // With UnloadExtensionFromAdmin you can tell the Admin System that you no longer what the extension dll to be loaded. 62 | virtual void UnloadExtensionFromAdmin() = 0; 63 | 64 | // helper 65 | virtual IDataBuilder* CreateDataBuilder() = 0; 66 | virtual IDataParser* CreateDataParser() = 0; 67 | }; 68 | 69 | class __declspec(novtable) IRunAsAdmin 70 | { 71 | public: 72 | 73 | // Before running any function as admin. Check user customization options. 74 | virtual bool RunAsAdminAllowed() = 0; // if false. Then Do not run any commands AsAdmin. (will be stopped by the command to if you try) 75 | virtual bool AutoRetryAsAdmin() = 0; // If try then you should check IsAdminModeRunning(). and if it is then you should run the command else you should show an error dialog with RetryAsAdmin option 76 | virtual bool AutoStartRunAsAdmin() = 0; // If true then you do not need to show error dialog before running the RunAsAdmin command 77 | 78 | // status 79 | virtual bool IsAdminModeRunning() = 0; 80 | 81 | // ex. 82 | // hKey == HKEY_LOCAL_MACHINE 83 | // szKeyPath == "Software\\MultiCommander\\Machine" 84 | virtual long RegKeyCreate(HKEY hKey, const WCHAR* szKeyPath) = 0; 85 | virtual long RegKeyDelete(HKEY hKey, const WCHAR* szKeyPath) = 0; 86 | 87 | // use RegValueSet for creating new values 88 | virtual long RegValueSet(HKEY hKey, const WCHAR* szKeyPath, const WCHAR* szValueName, short dwType, DWORD dataLen, const BYTE* pData) = 0; 89 | virtual long RegValueDelete(HKEY hKey, const WCHAR* szKeyPath, const WCHAR* szValueName) = 0; 90 | 91 | virtual long RegKeyCopyMove(HKEY hFrom, const WCHAR* szFromPath, HKEY hTo, const WCHAR* szToPath, bool bMove, bool bAutoRenameIfExists) = 0; 92 | ///////////////////////////////////////////////////////////////////////// 93 | // Send Custom admin command to an extension 94 | 95 | // Send command to the same extension but loaded by in admin process 96 | virtual IDataBuilder* CreateDataBuilder() = 0; 97 | 98 | // 99 | // Can use IDataBuilder as -> SendAdminCommand( nID, pDataBuilder->Data(), pDataBuilder->Size()); 100 | // 101 | virtual long SendAdminCommand(DWORD nCommand, const BYTE* pData, DWORD nDataLen) = 0; 102 | 103 | // Release and delete interface. After this has been run the Interface pointer is no longer valid. 104 | virtual void Release() = 0; 105 | }; 106 | 107 | MCNSEND -------------------------------------------------------------------------------- /MultiCommander/SDK/IScript.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * Changes 8 | * --------------------- 9 | * 10 | */ 11 | 12 | #pragma once 13 | #include "MCNamespace.h" 14 | MCNSBEGIN 15 | 16 | class __declspec(novtable) IScriptFunctions 17 | { 18 | public: 19 | enum DataType 20 | { 21 | None, 22 | String, 23 | Num, 24 | Handle, 25 | Array, 26 | }; 27 | 28 | /* 29 | nFunctionID - Extension/Plugin unique ID to identify the function. is use in 30 | szFunctionName - Name of the script function that should be registered- 31 | returnType - Return type of the function 32 | 33 | */ 34 | virtual bool RegisterScriptFunction(DWORD nFunctionID, const WCHAR* szFunctionName, DataType returnType) = 0; 35 | virtual bool RegisterScriptFunction(DWORD nFunctionID, const WCHAR* szFunctionName, DataType returnType, DataType param1) = 0; 36 | virtual bool RegisterScriptFunction(DWORD nFunctionID, const WCHAR* szFunctionName, DataType returnType, DataType param1, DataType param2) = 0; 37 | virtual bool RegisterScriptFunction(DWORD nFunctionID, const WCHAR* szFunctionName, DataType returnType, DataType param1, DataType param2, DataType param3) = 0; 38 | virtual bool RegisterScriptFunction(DWORD nFunctionID, const WCHAR* szFunctionName, DataType returnType, DataType* pParams, DWORD nParamCount) = 0; 39 | }; 40 | 41 | class IScriptFunctionParameter; 42 | 43 | class __declspec(novtable) IScriptArray 44 | { 45 | public: 46 | virtual IScriptFunctions::DataType ArrayType() = 0; 47 | 48 | // return false if datatype of value is wrong 49 | virtual bool AddValue(INT64 nValue) = 0; 50 | virtual bool AddValue(const WCHAR* szValue) = 0; 51 | 52 | virtual const IScriptFunctionParameter* GetValue(DWORD nIdx) const = 0; 53 | 54 | virtual DWORD GetCount() const = 0; 55 | }; 56 | 57 | class __declspec(novtable) IScriptHandle 58 | { 59 | public: 60 | virtual ~IScriptHandle() {} 61 | virtual void* GetHandle() = 0; 62 | 63 | }; 64 | 65 | class __declspec(novtable) IScriptFunctionParameter 66 | { 67 | public: 68 | virtual IScriptFunctions::DataType GetDataType() const = 0; 69 | 70 | // will return false if datatype of parameter does not match 71 | virtual bool GetNumValue(INT64* pValue) const = 0; 72 | virtual bool GetStringValue(const WCHAR** szValue) const = 0; 73 | virtual const IScriptArray* GetArrayValues() const = 0; 74 | //virtual bool GetHandleValue(void** pHandle) const = 0; 75 | virtual bool GetHandleValue(IScriptHandle** pHandle) const = 0; 76 | }; 77 | 78 | class __declspec(novtable) IScriptFunctionContext 79 | { 80 | public: 81 | 82 | enum Error 83 | { 84 | NoError = 0, 85 | InvalidNoParamers = 4, 86 | InvalidParameter = 5, 87 | InvalidData = 6, 88 | FunctionNotImplemented = 10, 89 | 90 | }; 91 | 92 | virtual DWORD FunctionID() = 0; 93 | 94 | // Set error on why this function call did not work. execution of script will be aborted. 95 | virtual void ErrorCode(Error error) = 0; 96 | 97 | // Set Return Value 98 | virtual void ReturnValue(INT64 nValue) = 0; 99 | virtual void ReturnValue(const WCHAR* szValue) = 0; 100 | virtual void ReturnHandleValue(IScriptHandle* pHandle) = 0; // This should replace the void* above 101 | 102 | virtual IScriptArray* CreateArrayReturnValue(IScriptFunctions::DataType type) = 0; 103 | 104 | virtual DWORD Parameters() = 0; 105 | virtual IScriptFunctionParameter* GetParameter(DWORD nIdx) = 0; 106 | 107 | // To log an Error, Warning or Info 108 | virtual void LogError(const WCHAR* szErrorMsg) = 0; 109 | virtual void LogWarning(const WCHAR* szWarningMsg) = 0; 110 | virtual void LogInfo(const WCHAR* szInfoMsg) = 0; 111 | 112 | }; 113 | 114 | MCNSEND -------------------------------------------------------------------------------- /MultiCommander/SDK/ISessionConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * Changes 8 | * --------------------- 9 | * 10 | */ 11 | 12 | #pragma once 13 | #include "MCNamespace.h" 14 | #include "Collections.h" 15 | MCNSBEGIN 16 | /* 17 | Get/Set Session Config 18 | 19 | SessionConfig is configuration that are not impotent to keep. 20 | Data like. last shown value in edit field X, Last 10 values of the combobox, Last position and stuff. 21 | 22 | set bHistoryValue to TRUE if the session config value is a history value like. Last used value. 23 | Difference is that they are stored in different way and user can choose to cleanup only history values 24 | */ 25 | class ISessionConfig 26 | { 27 | public: 28 | virtual bool GetSessionConfigValue(bool bHistoryValue, const WCHAR* strKey , const WCHAR* strName , bool &bValue ) = 0; 29 | virtual bool GetSessionConfigValue(bool bHistoryValue, const WCHAR* strKey , const WCHAR* strName , DWORD &bValue ) = 0; 30 | virtual bool GetSessionConfigValue(bool bHistoryValue, const WCHAR* strKey , const WCHAR* strName , WCHAR* strValue , DWORD nLen ) = 0; 31 | virtual bool GetSessionConfigValue(bool bHistoryValue, const WCHAR* strKey , const WCHAR* strName , BYTE* pData , DWORD nDataLen ) = 0; 32 | 33 | virtual bool SetSessionConfigValue(bool bHistoryValue, const WCHAR* strKey , const WCHAR* strName , bool bValue ) = 0; 34 | virtual bool SetSessionConfigValue(bool bHistoryValue, const WCHAR* strKey , const WCHAR* strName , DWORD bValue ) = 0; 35 | virtual bool SetSessionConfigValue(bool bHistoryValue, const WCHAR* strKey , const WCHAR* strName , const WCHAR* strValue ) = 0; 36 | virtual bool SetSessionConfigValue(bool bHistoryValue, const WCHAR* strKey , const WCHAR* strName , BYTE* pData , DWORD nDataLen ) = 0; 37 | 38 | // Get/set arrays of values 39 | virtual bool GetSessionConfigValues( const WCHAR* strKey , IKeyValCollection* pColl ) = 0; 40 | virtual bool SetSessionConfigValues( const WCHAR* strKey , IKeyValCollection* pColl ) = 0; 41 | virtual bool GetSessionConfigValueItems(const WCHAR* strKey , IValueCollection* pColl ) = 0; 42 | virtual bool SetSessionConfigValueItems(const WCHAR* strKey , IValueCollection* pColl , DWORD nMaxCount = 0 ) = 0; 43 | 44 | virtual bool ClearSessionData(const WCHAR* strKey) = 0; 45 | }; 46 | MCNSEND 47 | -------------------------------------------------------------------------------- /MultiCommander/SDK/IVirtualDeviceFolder.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "MCNamespace.h" 4 | #include "IVolumeContextMenu.h" 5 | 6 | MCNSBEGIN 7 | 8 | class __declspec(novtable) ICommandHandler 9 | { 10 | public: 11 | virtual void SetFirstCommandId(DWORD nID) = 0; // The system will call this with the First availvible commandId to be used 12 | virtual DWORD GetLastCommandId() = 0; 13 | 14 | virtual void AddCommands(MCNS::IFileItemCollection* pItems, MCNS::IVolumeContextMenu* pMenu, bool bContextMenu, DWORD nIDStart) = 0; 15 | virtual void OnCommand(DWORD nCommand, MCNS::IFileItemCollection* pItems) = 0; 16 | virtual void Release() = 0; // Delete your self 17 | }; 18 | 19 | class __declspec(novtable) IVirtualDeviceFolder 20 | { 21 | public: 22 | virtual DWORD Count() = 0; 23 | virtual bool AddFileItem(MCNS::IFileItem* pFileItem) = 0; 24 | virtual bool RemoveFileItem(const MCNS::IFileItem* pFileItem) = 0; 25 | virtual bool IsChanged() = 0; 26 | virtual IFileItem* GetSubItem(int idx) = 0; 27 | 28 | virtual bool IsBusy() const = 0; 29 | 30 | virtual bool PrepareVirtualDevice() = 0; 31 | 32 | // some multi app operation is finished. 33 | virtual bool OnBegin() = 0; 34 | virtual bool OnFinished(bool bUserAbort) = 0; 35 | virtual bool IsAbortRequested() = 0; 36 | 37 | virtual ICommandHandler* GetCommandHandler() = 0; 38 | virtual void SetCommandHandler(ICommandHandler* pCH) = 0; 39 | 40 | // The content added was depended on this parameter (used for search content so viewer can find out what search content was used) 41 | virtual void SetContentParameter(const WCHAR* szContentParam) = 0; 42 | virtual const wchar_t* GetContentParameter() = 0; 43 | }; 44 | 45 | MCNSEND -------------------------------------------------------------------------------- /MultiCommander/SDK/IVolumeContextMenu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * Changes 8 | * --------------------- 9 | * 10 | */ 11 | 12 | // 13 | // Allows Virtual devices to add items to the context menu 14 | // 15 | #pragma once 16 | #include "MCNamespace.h" 17 | MCNSBEGIN 18 | 19 | class __declspec(novtable) IVolumeContextMenu 20 | { 21 | public: 22 | 23 | // dwCommandID must be minimum of 11000 and Maximum of 39000 24 | virtual MCNS::ZHANDLE AddSubMenu(MCNS::ZHANDLE hParentMenu, const WCHAR* label) = 0; 25 | virtual ZHANDLE AddMenu(ZHANDLE hParentMenu, const WCHAR* label, DWORD dwCommandID, DWORD dwFlags) = 0; 26 | virtual ZHANDLE AddSeperator(ZHANDLE hParentMenu) = 0; 27 | }; 28 | 29 | 30 | // Not a nice solution.. change this 31 | class __declspec(novtable) IVolumeCommandResult 32 | { 33 | public: 34 | // FSEXECUTE_ 35 | virtual DWORD FileSystemExecute() = 0; 36 | virtual void FileSystemExecute(DWORD dwResult) = 0; 37 | 38 | virtual void AddParameter(const WCHAR* szParam) = 0; 39 | 40 | }; 41 | 42 | MCNSEND -------------------------------------------------------------------------------- /MultiCommander/SDK/IWorkspace.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * Changes 8 | * --------------------- 9 | * 10 | */ 11 | 12 | #pragma once 13 | 14 | #include "IFileOperations.h" 15 | #include "IEventCallback.h" 16 | 17 | #include "MCNamespace.h" 18 | MCNSBEGIN 19 | 20 | class IFileWorkspaceExtendedItem; 21 | 22 | // WorkspaceItemFlags 23 | #define WIF_VIRTUALFOLDER 0x0010 24 | 25 | class __declspec(novtable) IWorkspaceItem 26 | { 27 | public: 28 | virtual const WCHAR* GetName(WCHAR* str, UINT nMaxLength) = 0; 29 | virtual const WCHAR* GetPath(WCHAR* str, UINT nMaxLength) = 0; 30 | virtual const WCHAR* GetRefPath(WCHAR* str, UINT nMaxLength) = 0; 31 | virtual UINT64 GetAttributes() = 0; 32 | virtual DWORD GetFlags() = 0; 33 | virtual IFileItem* GetRefItem() = 0; 34 | }; 35 | 36 | class __declspec(novtable) IWorkspaceItem2 37 | { 38 | public: 39 | 40 | virtual const wchar_t* DisplayName() const = 0; 41 | virtual const wchar_t* DisplayPath() const = 0; 42 | 43 | virtual const wchar_t* TargetPath() const = 0; 44 | virtual const wchar_t* TargetName() const = 0; 45 | virtual const wchar_t* FullTargetPath(wchar_t* str, const int len) const = 0; 46 | 47 | virtual bool IsVirtualFolder() const = 0; 48 | 49 | virtual DWORD GetAttributes() const = 0; 50 | 51 | virtual UINT64 GetSize() const = 0; 52 | 53 | virtual MCNS::IFileWorkspaceExtendedItem* GetExtendedItem() const = 0; 54 | }; 55 | 56 | 57 | // WorkspaceView Styles 58 | #define WVS_MAINROOT 0x00000100L // Have a main root item. 59 | #define WVS_DRAGDROP 0x00001000L // Allow Drag 'n' Drop of items ( if RegisterDragDropTarget(false) is called then only drag of files OUT of ctrl is allowed ) 60 | #define WVS_ACCEPTFILES 0x00002000L // Allow files to be dropped and added to the workspace ( Wrong ?!, Allow drop of files on empty space in the view or if a drop must be on an item) 61 | #define WVS_READONLY 0x00010000L // Will NOT allow any modification of any items. 62 | #define WVS_FLATVIEW 0x00020000L // Draw flat view. No treestyle. 63 | #define WVS_NOSTRECH 0x00040000L // No Auto Streching of Filename or Path column 64 | #define WVS_PATHCOLUMN 0x00100000L // Add a path column 65 | 66 | #define WVS_DRAGDATA_INTERNAL 0x0001 // Allows rearrange of items in the workspace. 67 | #define WVS_DRAGDATA_FILEPATHS 0x0002 // Allows files to be dragged OUT of the controller 68 | #define WVS_DRAGDATA_INTERNALFORCECOPY 0x0004 // Force 'Copy' drag actions as default for internal drags to filebrowser 69 | 70 | //===================== 71 | 72 | class __declspec(novtable) IFileWorkspaceExtendedItem 73 | { 74 | public: 75 | 76 | }; 77 | 78 | class __declspec(novtable) IFileWorkspaceCallback 79 | { 80 | public: 81 | virtual ~IFileWorkspaceCallback() = default; 82 | 83 | virtual const wchar_t* GetItemName(MCNS::IFileWorkspaceExtendedItem* pItem, DWORD nColumnId) = 0; 84 | virtual bool GetItemText(OUT wchar_t* szText, long textSize, const MCNS::IWorkspaceItem2* pWorkspaceItem, DWORD nColumnId) = 0; 85 | 86 | virtual bool ItemDropped(IWorkspaceItem2* pParentItem, IFileItem* pDroppedItem) = 0; 87 | virtual bool ItemRemoved(const MCNS::IWorkspaceItem2* pItem) = 0; 88 | 89 | virtual bool AddContextMenuItems(HMENU hPopupMenu, MCNS::IWorkspaceItem2* pParent, int baseCmdId) = 0; 90 | virtual bool OnContextMenuCommand(MCNS::IWorkspaceItem2* pItem, int cmdId) = 0; 91 | 92 | // All Items cleared.. If you got anything cached, Clear caches now 93 | virtual void OnAllCleared() = 0; 94 | }; 95 | 96 | 97 | class __declspec(novtable) IFileWorkspaceView 98 | { 99 | public: 100 | virtual void SetCallback(MCNS::IFileWorkspaceCallback* pCallback) = 0; 101 | 102 | virtual MCNS::IWorkspaceItem2* AddItem(MCNS::IWorkspaceItem2* pParent, const wchar_t* targetPath, const wchar_t* displayName, DWORD attributes, MCNS::IFileWorkspaceExtendedItem* pItem, bool updateUI) = 0; 103 | virtual bool RemoveItem(MCNS::IWorkspaceItem2* pItem) = 0; 104 | 105 | virtual void ClearAll() = 0; 106 | 107 | virtual void Refresh() = 0; 108 | 109 | virtual void SetFont(const wchar_t* szFontName, long fontStyle, int fontSize) = 0; 110 | virtual void SetIconSize(int cxySize) = 0; 111 | 112 | virtual void RemoveAllColumns() = 0; 113 | virtual void AddColumn(const wchar_t* name, int width, DWORD align, DWORD flags, DWORD id) = 0; 114 | virtual void RebuildColumns() = 0; 115 | 116 | // return a collection of all item at path level 117 | virtual IPCollection* GetItems(const wchar_t* path) = 0; 118 | virtual MCNS::IPCollection* GetChilds(MCNS::PHANDLE hParent) = 0; 119 | 120 | virtual MCNS::IWorkspaceItem2* FindItem(MCNS::IWorkspaceItem2* pParent, const wchar_t* szName) = 0; 121 | 122 | 123 | }; 124 | //===================== 125 | 126 | // OSBOSLETE -- Used by OLD file search 127 | class __declspec(novtable) IFileWorkspaceViewInterface : public IHObject, public ISetEvent 128 | { 129 | public: 130 | // Create layout 131 | virtual bool Init( DWORD nOptions = 0 , DWORD nDragDataModes = WVS_DRAGDATA_INTERNAL) = 0; 132 | virtual bool Clear() = 0; 133 | 134 | // Insert items in Workspace 135 | virtual ZHANDLE InsertItem( ZHANDLE hParent , const WCHAR* strText = NULL , DWORD dwOptions = 0 , IFileItem* pRefItem = NULL ) = 0; 136 | 137 | virtual bool RemoveCurrentItem( bool bRemoveSubItems ) = 0; 138 | virtual bool RemoveItem( DWORD nIndex , bool bRedraw = true ) = 0; 139 | 140 | virtual IWorkspaceItem* GetWorkspaceItem( DWORD nIndex ) = 0; 141 | 142 | // The handles in the IHCollection is IWorkspaceItems 143 | virtual bool GetCheckedWorkspaceItems( IHCollection* pValues ) = 0; 144 | // return how many items are checked. 145 | virtual DWORD GetCheckCount() = 0; 146 | 147 | // Modify workspace items 148 | virtual bool Update( bool bRedrawOnly = true ) = 0; 149 | 150 | // Return Workspace relative path of an item 151 | virtual WCHAR* GetItemPath( WCHAR* strPath , UINT nMaxLenght , UINT nIndex ) = 0; 152 | 153 | virtual bool SelectItems( const WCHAR* strMatch , bool bSelect , bool bRecursive ) = 0; 154 | 155 | virtual IFileItem* GetFileItemInFocus() = 0; 156 | virtual bool GetFileItems( IFileItemCollection* pFileItems, DWORD dwFlags ) = 0; 157 | virtual bool GetSelection( IFileItemCollection* pFileItems, DWORD dwFlags ) = 0; 158 | virtual bool SetSelection( IFileItemCollection* pFileItems, DWORD dwFlags ) = 0; 159 | virtual bool SetSelectionByFilter( const WCHAR* strFilter, DWORD dwFlags ) = 0; 160 | virtual bool SetSelectionAll( bool bSelect ) = 0; 161 | virtual bool InvertSelection() = 0; 162 | 163 | virtual bool Load( const WCHAR* strFilename ) = 0; 164 | virtual bool Save( const WCHAR* strFilename , const WCHAR* szRootName = NULL) = 0; 165 | 166 | virtual void GetStatus( INT64 &nTotalSize , DWORD &nTotalFiles , DWORD &nTotalFolders , INT64 &nSelectedSize , DWORD &nSelectedFiles , DWORD &nSelectedFolders ) = 0; 167 | 168 | virtual bool OnCopy( bool bSilent = false ) = 0; 169 | virtual bool OnMove( bool bSilent = false ) = 0; 170 | virtual bool OnDelete( bool bSilent = false , IFileOpStatusCallback* pCallback = NULL ) = 0; 171 | 172 | virtual bool CopyToClipboard() = 0; 173 | 174 | virtual DWORD FindIndexByItem( IWorkspaceItem* pWorkspaceItem ) = 0; 175 | }; 176 | 177 | MCNSEND 178 | -------------------------------------------------------------------------------- /MultiCommander/SDK/IXMLHelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * Changes 8 | * --------------------- 9 | * 10 | */ 11 | 12 | 13 | #pragma once 14 | 15 | #include "MCNamespace.h" 16 | MCNSBEGIN 17 | 18 | // Helper interface for reading and writing XML files 19 | 20 | typedef DWORD_PTR xmlNodeHandle; 21 | 22 | class __declspec(novtable) IXMLHelper 23 | { 24 | public: 25 | 26 | virtual xmlNodeHandle CreateXMLDoc( const WCHAR* szRootNodeName ) = 0; 27 | virtual bool FreeXMLDoc(xmlNodeHandle h) = 0; 28 | 29 | virtual xmlNodeHandle Load( const WCHAR* szFilename, bool bKeepBlanks = true) = 0; 30 | virtual bool Save( xmlNodeHandle hNode , const WCHAR* szFilename , bool bIndent = true , const char* szEncoding = NULL) = 0; 31 | virtual bool GetEncoding(xmlNodeHandle hNode, char* szEncoding, DWORD dwEncodingLength) = 0; // If xml document was loaded. the get the encoding it was in 32 | 33 | virtual xmlNodeHandle AddNode( xmlNodeHandle hParent , const WCHAR* szName , const WCHAR* szContent = NULL ) = 0; 34 | virtual xmlNodeHandle AddNodeAndValue( xmlNodeHandle hParent , const WCHAR* szName , const WCHAR* szAttributeName , INT64 nValue , const WCHAR* szContent = NULL) = 0; 35 | virtual xmlNodeHandle AddNodeAndValue( xmlNodeHandle hParent , const WCHAR* szName , const WCHAR* szAttributeName , DWORD nValue , const WCHAR* szContent = NULL) = 0; 36 | virtual xmlNodeHandle AddNodeAndValue( xmlNodeHandle hParent , const WCHAR* szName , const WCHAR* szAttributeName , const WCHAR* szValue , const WCHAR* szContent = NULL) = 0; 37 | 38 | virtual bool RemoveNode(xmlNodeHandle hNode) = 0; 39 | 40 | virtual xmlNodeHandle FindElement( xmlNodeHandle hParent , const WCHAR* szElementPath , const WCHAR* szAttributeName = NULL , const WCHAR* szValue = NULL ) = 0; 41 | virtual xmlNodeHandle FindChildElement( xmlNodeHandle hParent , const WCHAR* szElementPath, const WCHAR* szAttributeName = NULL , const WCHAR* szValue = NULL ) = 0; 42 | virtual xmlNodeHandle FindFirstChildElement( xmlNodeHandle hParent ) = 0; 43 | 44 | virtual xmlNodeHandle GetNextElement(xmlNodeHandle hNode) = 0; 45 | virtual xmlNodeHandle GetNextElement(xmlNodeHandle hNode, const WCHAR* szElementPath) = 0; 46 | 47 | virtual bool GetElementName(xmlNodeHandle node, WCHAR* szName, DWORD len) = 0; 48 | virtual bool GetContent(xmlNodeHandle hNode, WCHAR* szContent , DWORD nContentMaxSize ) = 0; 49 | virtual bool GetContent(xmlNodeHandle hNode, const WCHAR* szElementPath, WCHAR* szContent , DWORD nContentMaxSize ) = 0; 50 | 51 | virtual WCHAR* GetValueStr( WCHAR* szValue , DWORD nLen , xmlNodeHandle hNode , const WCHAR* szAttributeName ) = 0; 52 | virtual long GetValueLong( xmlNodeHandle hNode , const WCHAR* szAttributeName ) = 0; 53 | virtual INT64 GetValueInt64( xmlNodeHandle hNode , const WCHAR* szAttributeName ) = 0; 54 | virtual COLORREF GetValueColor(MCNS::xmlNodeHandle hNode, const WCHAR* szAttributeName) = 0; 55 | 56 | virtual bool GetValue(long* OUT ptValue, xmlNodeHandle hNode, const WCHAR* szAttributeName) = 0; 57 | virtual bool GetValue(INT64* OUT ptValue, xmlNodeHandle hNode, const WCHAR* szAttributeName) = 0; 58 | 59 | virtual bool SetValue( xmlNodeHandle node , const WCHAR* szAttributeName , const WCHAR* szValue , bool bCreate = false ) = 0; 60 | virtual bool SetValue( xmlNodeHandle node , const WCHAR* szAttributeName , DWORD dwValue , bool bCreate = false ) = 0; 61 | virtual bool SetValue( xmlNodeHandle node , const WCHAR* szAttributeName , long lValue , bool bCreate = false ) = 0; 62 | virtual bool SetValue( xmlNodeHandle node , const WCHAR* szAttributeName , int iValue , bool bCreate = false ) = 0; 63 | virtual bool SetValue( xmlNodeHandle node , const WCHAR* szAttributeName , INT64 nValue , bool bCreate = false ) = 0; 64 | virtual bool SetValueColor( xmlNodeHandle node , const WCHAR* szAttributeName , DWORD dwValue ,bool bPrefix, bool bCreate = false ) = 0; 65 | 66 | virtual void Release() = 0; 67 | }; 68 | 69 | MCNSEND 70 | -------------------------------------------------------------------------------- /MultiCommander/SDK/MCAutoRelease.h: -------------------------------------------------------------------------------- 1 | // RIIA Helper lasses 2 | // 3 | // 4 | #pragma once 5 | 6 | #include "MCNamespace.h" 7 | #include "Collections.h" 8 | 9 | MCNSBEGIN 10 | 11 | class AutoFileItemCollection 12 | { 13 | public: 14 | AutoFileItemCollection(IFileItemCollection* p = nullptr) 15 | : m_pCollection(p) 16 | { 17 | 18 | } 19 | 20 | ~AutoFileItemCollection() 21 | { 22 | Release(); 23 | } 24 | 25 | bool isValid() 26 | { 27 | if (m_pCollection) 28 | return true; 29 | 30 | return false; 31 | } 32 | void Release() 33 | { 34 | if (isValid()) 35 | { 36 | m_pCollection->Release(); 37 | m_pCollection = nullptr; 38 | } 39 | } 40 | 41 | AutoFileItemCollection& operator=(IFileItemCollection* p) 42 | { 43 | Release(); 44 | m_pCollection = p; 45 | return *this; 46 | } 47 | 48 | operator IFileItemCollection*() 49 | { 50 | return m_pCollection; 51 | } 52 | 53 | IFileItemCollection* operator->() 54 | { 55 | return m_pCollection; 56 | } 57 | 58 | private: 59 | IFileItemCollection* m_pCollection; 60 | }; 61 | 62 | MCNSEND 63 | -------------------------------------------------------------------------------- /MultiCommander/SDK/MCErrorCodes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * Error codes 8 | * 9 | * TODO 10 | * Error codes need to be redesigned 11 | * use HRESULT kind of codes instead. 12 | * use DWORD as error code and use the HIWORD as mask for different categoryes and LOWORD for error code. 13 | * All WinError codes are 0 - 65000, always lower bits, So use Higher bits for control codes. 14 | * examples 15 | * 0x10000000 // Windows Error 16 | * 0x20000000 // MC Volume errors 17 | * 18 | * 0x10000005 = Windows Error code ACCESS_DENIED (5) 19 | * 0x20000014 = MC Volume Error code for VERROR_ACCESS_DENIED (20, 0x14) 20 | * Or 21 | * 0x10000005 = Windows Error code ACCESS_DENIED (5) 22 | * 0x20140000= MC Volume Error code for VERROR_ACCESS_DENIED (20, 0x14) 23 | * Then they can be combined to hold both WInError and MCerror. 24 | * 0x30140005 25 | * 26 | * Have one bit for fileopeation type. Copy/Move/Delete/Rename because a error might need to be handled different 27 | * 28 | * Changes 29 | * 30 | * --------------------- 31 | * 32 | **/ 33 | 34 | #include "MCNamespace.h" 35 | MCNSBEGIN 36 | 37 | // Error Codes 38 | // 39 | // Error Codes needs to be remapped to match Windows Error codes better. and MC specific code should start with a higher number 40 | // 41 | // TODO - Redesign and move codes around - Use Windows Error Code up to X and Put MC error Code at xxxxx+ 42 | // ^^^^ 43 | // 44 | #define VERROR_NOERROR 0L // No error 45 | #define VERROR_FILE_NOT_FOUND 2L // File can not be found. 46 | #define VERROR_PATH_NOT_FOUND 3L // Path can not be found. 47 | #define VERROR_ALREADY_EXISTS 10L // Cannot create a file, It already exists. 48 | #define VERROR_ALREADY_EXISTS_AS_FILE 11L // Cannot create Folder, A FILE already exits with the same name 49 | #define VERROR_ALREADY_EXISTS_AS_FOLDER 12L // Can not create file, a FOLDER already exists with the same name 50 | 51 | #define VERROR_ACCESS_DENIED 20L // Access to file/folder is denied 52 | 53 | #define VERROR_WACCESS_DENIED_PROTECTED 24L // Replaces Error 25,26, File has S/H/RO attribute can cannot be overwritten without removing attribute 54 | #define VERROR_WACCESS_DENIED_RO 25L // Write Access Denied. File/folders is Readonly 55 | #define VERROR_WACCESS_DENIED_VRO 26L // Write Access Denied. volumes is Readonly ( CD/DVD ROM or write protected disk) 56 | #define VERROR_WACCESS_DENIED_SH 27L // Write Access Denied. file/folder is System or Hidden 57 | #define VERROR_CANT_ACCESS_PLACEHOLDER 28L // Cant access file becuse it is only a placeholder 58 | 59 | #define VERROR_SHARING_VIOLATION 32L // File is being used by another process 60 | 61 | #define VERROR_VOLUME_NOT_ENOUGH_SPACE 39L // There is not enough space on volume 62 | #define VERROR_VOLUME_FULL 40L // Volume is full (use the error code above in most cases instead.) 63 | #define VERROR_VOLUME_BADFORMAT 41L // Volume file is bad. corrupt or invalid format. 64 | #define VERROR_VOLUME_NOTFOUND 42L // Can open volume. Corrupt or bad volume file. 65 | 66 | //#define VERROR_FOLDER_NOT_EMPTY 50L // Can not Delete folder. folder not empty 67 | 68 | #define VERROR_CONNECTION_LOST 55 // Connection to volume is lost (eg if connect to FTP or other remote conection is lost) 69 | #define VERROR_OP_TIMEOUT_TRYAGAIN 60 // Operation took long time and timed out, but try again later 70 | // Eg ReadFile/WriteFile operation on IRWFile can return this if a read/write takes too long. 71 | // This so we can handle abort/skip request from the user. ( good for slow volumes likes FTP) 72 | 73 | #define VERROR_SOURCE_TARGET_SAME 109 // Operation Failed, Source and Target is file/folder is the same. ( eg Renaming a file and new and old name are identical ) 74 | #define VERROR_OPEN_FAILED 110 // 75 | #define VERROR_OPEN_FAILED_UNSUPPORTED_FORMAT 111 // Unable to open file because it is located in a unsupported format. 76 | // (eg opening a file inside zip archive that is compressed with an unsupported compression mode ) 77 | #define VERROR_OPEN_FAILED_BADPASSWORD 112 78 | 79 | #define VERROR_PATH_TO_LONG 120 // Path is to Long 80 | #define VERROR_PATH_INVALID_CHAR 121 // Path is Invalid. Invalid characters in Path 81 | #define VERROR_INVALID_PATH_NAME 123 // The filename, directory name, or volume label syntax is incorrect. 82 | #define VERROR_INVALID_PATH_OR_VOLUME 124 83 | 84 | #define VERROR_CANT_OPEN_SOURCEVOLUME 150 // Can open volume.. pVolume->Open( path ) failed.. 85 | #define VERROR_CANT_OPEN_TARGETVOLUME 151 // Can open volume.. pVolume->Open( path ) failed.. 86 | #define VERROR_TARGETVOLUME_ALREADY_EXISTS 152 // Can not create TargetVolume. it already exists 87 | 88 | #define VERROR_READERROR 158 // Error when trying to read data 89 | 90 | #define VERROR_DELETE_READONLY 160 // Can not delete file. because it is read-only 91 | #define VERROR_DELETE_HIDDEN 161 // Can not delete file. because it is hidden 92 | #define VERROR_DELETE_SYSTEM 162 // Can not delete file. because it is a system file 93 | #define VERROR_DELETE_DIRNOTEMPTY 163 // Can not delete directory. because it is not empty 94 | #define VERROR_DELETE_ACCESSDENIED 164 // Can not delete file/folder. Access is denied. no permission to delete folders 95 | #define VERROR_FILE_INCOMPLETE 165 // A file write have been aborted.. file X is incomplete 96 | 97 | #define VERROR_DELETE_PROTECTED 166 // Can't delete file, it is protected. has S/H or RO attributes 98 | 99 | #define VERROR_FILE_CORRUPT 170 // file X is corrupt 100 | #define VERROR_FILE_CORRUPT_CRC 171 // File %s is corrupt due to CRC error! 101 | 102 | #define VERROR_MISSING_VOLFILE 172 // Volume file is missing.. like ( RAR . if a rar file is missing. or other sold archive stuff ) 103 | #define VERROR_BROWSING_VOLUME 173 // Error browsing volume 104 | //#define VERROR_FILE_CORRUPT_KEEP 171 // file X is corrupt, Keep it anyway ? 105 | 106 | #define VERROR_WRITEERROR_SC1 175 // Write happened during write.. (Special case, no sys buffer, HW do not support that) 107 | #define VERROR_WRITEERROR 176 // Unknown error happen while writing 108 | 109 | #define VERROR_CUSTOM 178 // Custom error. 110 | 111 | #define VERROR_NOT_SAME_ROOTPATH 180 112 | #define VERROR_EXISTS_NOT_SAME_ROOTPATH 181 // Exists Function - Not Same Rootpath.. can't check if path exists.. 113 | #define VERROR_NOT_SAME_ROOTVOLUME 182 // (ERROR_NOT_SAME_DEVICE 17 ) 114 | 115 | #define VERROR_AUTORENAME_FAILED 183 116 | #define VERROR_COMMAND_FAILED 186 117 | #define VERROR_FAILED_TO_OPEN_CONNECTION 187 // eg FTP error 425 118 | #define VERROR_VOLUME_OPERATION_NOTSUPPORTED 196L // If a operation on a volume is not supported. 119 | #define VERROR_INVALID_PARAMETERS 197L 120 | #define VERROR_NOTIMPLEMENTED 198L 121 | #define VERROR_ABORT_FILEOPERATION 199L 122 | 123 | #define VERROR_CANCELLED_BY_USER ERROR_CANCELLED // 1223 124 | #define VERROR_READERROR_AUTORETRY 3500L // Some read error happen. But Just autoretry 125 | #define VERROR_ABORTED_PROCESS_IN_SHUTDOWN 3998L // Operation was aborted, Process is in Shutdown mode 126 | #define VERROR_INVALID 3999L 127 | #define VERROR_UNKNOWN_ERROR 4000L // Error code with 4000 and over is Unknown. 128 | 129 | MCNSEND -------------------------------------------------------------------------------- /MultiCommander/SDK/MCNamespace.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | */ 8 | 9 | #pragma once 10 | 11 | #define MCNS MultiCommander::SDK 12 | 13 | #define MCNSBEGIN namespace MultiCommander { namespace SDK { 14 | #define MCNSEND } } 15 | 16 | -------------------------------------------------------------------------------- /MultiCommander/SDK/MultiExtension.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * Changes 8 | * --------------------- 9 | * 10 | */ 11 | 12 | #pragma once 13 | 14 | #include "SDKVersion.h" 15 | #include "Multi_Type.h" 16 | #include "ExtensionInfo.h" 17 | #include "MultiApp_Def.h" 18 | 19 | #include "IAppInterface.h" 20 | 21 | #include "MCNamespace.h" 22 | MCNSBEGIN 23 | 24 | 25 | class IRunAdminCommand; 26 | /* 27 | All Application extension must inherit from IPluginInterface 28 | TODO - Rename IPluginInterface to IAppExtension 29 | */ 30 | class IAppMenu; 31 | 32 | struct CloseContext 33 | { 34 | bool Shutdown; 35 | bool DoNotAsk; 36 | bool ClosingMany; 37 | }; 38 | 39 | 40 | class __declspec(novtable) IPluginInterface 41 | { 42 | public: 43 | virtual ~IPluginInterface() = default; 44 | // MultiApp is Initialized 45 | virtual long PreStartInit( IMultiAppInterface* pInterface )= 0; 46 | 47 | // This function is the first to be called right after the module is loaded 48 | // this function should return some Flags, like what type of module this is and so on.. 49 | // But all connections between this module and framework is not done yet so any interface function my not be called yet 50 | virtual long GetModuleFlags() = 0; 51 | 52 | // This function is always run after CreateParam() is run 53 | virtual BOOL Init( IMultiAppInterface* pInterface ) = 0; 54 | 55 | // Return the module ID that is a GUID string 56 | virtual char* Get_ModuleID() = 0; 57 | 58 | // If created control can send notifications to the module. those notification message will be received here 59 | virtual bool OnNotify( ZHANDLE hFrom , DWORD nNotifyMsg , WPARAM wParam = 0 , LPARAM lParam = 0 , void* pExtra = NULL ) = 0; 60 | 61 | // Messages sent from the Core framework to the module. 62 | // If hView is not 0 then it is the handle of a UI Component created by the extension. 63 | virtual BOOL OnMessage( long msg , ZHANDLE hView , WPARAM param1 , LPARAM param2 ) = 0; 64 | 65 | // Registered Action is activated. and it is up to the module to handle it 66 | virtual BOOL OnAction( IZAction* /*pAction*/ ) { return FALSE; } 67 | 68 | // An custom command that this extension has registered is activated. Lets handle it. 69 | virtual BOOL OnCustomCommand(ICustomCommand* pCustomCommand) = 0; 70 | 71 | // Called from The AdminHelper Process if a command is sent using the IRunAsAdmin Interface, 72 | // The caller should send everything the function need in the RunAsAdmin data. since the IMultiAppInterface is not available 73 | // and the init function is NOT Called. Think of this function as a static function. 74 | // And pAdminCommand->SetResponse(...); should ALWAYS be run. else a result is not returned back to MultiCommand and that 75 | // function might sit and wait for an response forever and lockup.. (or until timeout happens) 76 | virtual BOOL OnAdminCommand(DWORD /*nCommand*/, IRunAdminCommand* /*pAdminCommand*/) { return FALSE; } 77 | 78 | // A Register script function is about to be run. (Optional) 79 | virtual BOOL OnScriptFunction(IScriptFunctionContext* /*pScriptFuncContext*/) { return FALSE; } 80 | 81 | // Add Context menu items to a application context menu. 82 | // nContextMenuID = 1 : Tab ContextMenu 83 | // 84 | // If a extension command is chosen a AM_CONTEXTMENU message is sent with nContextMenuID as lParam has the extension command value 85 | virtual BOOL OnAddContextMenuItems(DWORD /*nContextMenuID*/, IAppMenu* /*pMenu*/) { return FALSE; } 86 | 87 | // Modules is requested to close. return TRUE if cleanup was successfully or FALSE if modules should not close down 88 | // bShutdownClose is TRUE if MultiCommander is shutting down. 89 | virtual BOOL OnClose(CloseContext& context) = 0; 90 | 91 | // Import/Export Interface for transferring data between extensions. 92 | // return 0 : False ZIMPORT_FALSE 93 | // return 1 : Successful ZIMPORT_SUCCESS 94 | // return 2 : Use ImportData Object.. ZIMPORT_USEIMPOBJECT 95 | virtual int DoImportData( IXData *pXData ) = 0; 96 | 97 | virtual IImportData* Get_ImportObject() = 0; 98 | virtual IExportData* Get_ExportObject() = 0; 99 | 100 | private: 101 | 102 | }; 103 | 104 | 105 | MCNSEND -------------------------------------------------------------------------------- /MultiCommander/SDK/Multi_Type.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * Changes 8 | * --------------------- 9 | * 10 | */ 11 | 12 | #pragma once 13 | 14 | #include "MCNamespace.h" 15 | MCNSBEGIN 16 | 17 | // Change to void* 18 | typedef DWORD_PTR ZHANDLE; 19 | 20 | typedef DWORD_PTR XHANDLE; 21 | typedef void* PHANDLE; 22 | 23 | typedef long ZRETURN; // return code 24 | typedef DWORD_PTR ZCMDID; 25 | 26 | constexpr ZHANDLE ZHANDLE_INVALIDHANDLE = ((ZHANDLE)(LONG_PTR)-1); 27 | 28 | class __declspec(novtable) IHObject 29 | { 30 | public: 31 | virtual ZHANDLE GetHandle() = 0; 32 | virtual HWND GetHWND() = 0; 33 | // Might be useful when connecting SDK created controls with WTL 34 | virtual BOOL PreTranslateMessage(MSG* /*pMsg*/) { return FALSE; } 35 | }; 36 | 37 | // Macros for handling TextID's 38 | #define GROUPID(l) (char)LOWORD(l) 39 | #define ITEMID(l) HIWORD(l) 40 | #define MAKETEXTID(c,w) MAKELONG((WORD)c,w) 41 | 42 | #define GETACCEL_KEY(l) (WORD)LOWORD(l) 43 | #define GETACCEL_MOD(m) (BYTE)HIWORD(m) 44 | #define MAKEACCELKEY(k,m) MAKELONG((WORD)k,m) 45 | 46 | #ifndef _MC_MAXPATH_ 47 | #define _MC_MAXPATH_ 4096 48 | #endif 49 | 50 | MCNSEND 51 | 52 | -------------------------------------------------------------------------------- /MultiCommander/SDK/PluginInterface.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi Commander - SDK 3 | * 4 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 5 | * ======================================================================================= 6 | * 7 | * Changes 8 | * --------------------- 9 | * 10 | */ 11 | 12 | #ifndef _PLUGININTERFACE_ 13 | #define _PLUGININTERFACE_ 14 | 15 | #pragma once 16 | 17 | #include 18 | #include 19 | #include 20 | #include "MultiApp_Def.h" 21 | 22 | #include "MCNamespace.h" 23 | MCNSBEGIN 24 | 25 | // Generic Settings Viewer. 26 | class __declspec(novtable) IGSettingsViewInterface : public IHObject 27 | { 28 | public: 29 | virtual void SetMessageCommands( DWORD dwSettingsChange, DWORD dwOnPresetClicked ) = 0; 30 | 31 | // if szFont is NULL default font will be used. So it is possible to just change size 32 | virtual bool SetFont_List(const TCHAR* szFont, long nSize, long lStyle) = 0; 33 | virtual bool SetFont_Buttons(const TCHAR* szFont, long nSize, long lStyle) = 0; 34 | 35 | virtual BOOL Init( DWORD_PTR pConfigDataReader , DWORD_PTR pConfigLayoutReader , DWORD_PTR pConfigTextReader = 0 , BOOL bAutoDelete = FALSE ) = 0; 36 | virtual BOOL Load( long lModuleID ) = 0; 37 | virtual BOOL Save() = 0; 38 | 39 | virtual void GoToAndHighlightItem(const wchar_t* szSettingsItem) = 0; 40 | }; 41 | 42 | MCNSEND 43 | #endif 44 | -------------------------------------------------------------------------------- /MultiCommander/SDK/Readme.txt: -------------------------------------------------------------------------------- 1 | 2 | Multi Commander SDK v0.9 3 | ======================== 4 | ( This document is far from complete.) 5 | 6 | About 7 | ------ 8 | Multi Commander has a intensive plugin/extension architecture. Almost everything you see in Multi Commander is from an extension. 9 | The Zip Filesystem is an Extension. The Explorer Panel is an extension, UI part of Search is an extension, and more. 10 | Some of the extension are built into MultiCommander.exe but they are using the same interfaces that you find in the SDK. 11 | You will see all of the extension of you go to the Extension Manager in the configuration menu in Multi Commander. 12 | 13 | 14 | Extension /Plugins types 15 | ------------------------ 16 | There are a wide vararity of extension/plugins that are supported 17 | 18 | 19 | Application Extension - This can create UI inside a panel tab, or a new windows. They can add Commands and Menu options, 20 | Extend CustomCommands or Multi-Script with new command. 21 | (Eg MultiRename, CheckSum (sfv) Tools) 22 | 23 | Volume Plugins - Add Support for virtual filesystem. Like archives or other things that can be shown as a file system 24 | ( Eg Zip, FTP, Registry ) 25 | 26 | FileProperties Extension - Add support for extended file preoperty data. that can be shown in columns in Explorer Panel or used by MultiRename or other extensions 27 | ( ExiF Image Tags, IDv3 Mp3 Tags ) 28 | 29 | FileOperationPlugins - Plugin that are call before/during file copy. Allowing the plugin do changes to the file being copyied. 30 | (Not fully supported for 3d part usage yet) 31 | 32 | 33 | 34 | How Multi Commander loads extensions 35 | ---------------------------------------- 36 | When MultiCommander starts it will scan the "Extensions/" subfolder and for all *.dll files it finds there it will 37 | check if it is a MultiCommander Extension. If it is it will check the configuration if it should be loaded or not. 38 | If there is not configuration to exclude that extension it will register the extension in MultiCommander. 39 | If the Extension is of APP type it will create an instance of the extension an call PreInitStart 40 | this allows the extension to register commands and menus and other stuff into the MultiCommander core system. 41 | It will then destory the created instance. and continue with startup. 42 | 43 | When is an App-Extension instance created 44 | ------------------------------------------ 45 | The App Extension registered some commands for its functions during PreInitStart. and when one of thouse commands is run 46 | an instance of the extension is created and the command is then pass to the extension so it can do its work. 47 | 48 | When is a Volume-Plugin created 49 | ----------------------------------------- 50 | MultiCommander will register the Volume plugin during start up. And when a filesystem of that type is requested an instance of it is created. 51 | 52 | Volume plugin do not have access to the entire App Interface as App-Extension do. So depending on your command 53 | -------------------------------------------------------------------------------- /MultiCommander/SDK/SDKVersion.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Multi Commander - SDK 4 | * 5 | * Copyright (C) 2024 All Rights Reserved , http://multicommander.com 6 | * ======================================================================================= 7 | * 8 | Defines what interface version the extensions/plugins are built with. 9 | 10 | If interfaces and MultiCommander has different version they may NOT be able to load them 11 | Minor changes to interface might be allowed anyway. 12 | 13 | MultiCommander will check the SDK Version an extension is build with and will not load the extension if the 14 | SDK version mismatch on FrameWork or Major version part. 15 | 16 | Version Number Description 17 | 18 | Version 1.2.3.4 19 | 20 | 1 = Interface Framework version for MultiCommander. if this change plugins or extension will need major rewrites to work again. 21 | 22 | 2 = Major Interface change. Most likely the extension/plugins just need to be rebuilt to work again. 23 | A major changes has happened to some interfaces. like functions have been removed, rearrange. or parameters for existing functions have changed. 24 | Or even complete interfaces have been removed. Anything that will change the layout of the interface. 25 | 26 | 3 = Minor Interface changes 27 | None critical change to the layout has accrued. New functions has been added to the end of existing interface. (Extension using the previous layout will still work). 28 | Or NEW interfaces added. 29 | 30 | 4 = (Will load extension even if this is different) 31 | none critical change has accrued. Like a function or parameter got a name change, but they are still at the same position in 32 | the interface so existing extensions/plugins should still work 33 | 34 | summary 35 | 36 | Version No Change has been made Loaded? Need to fix 37 | --------------------------------------------------------------------------------------------------------------------- 38 | 1.x.x.x | MC Interface Framework Changed | No | Rebuild and major Rewrites of Extension/Plugin required 39 | x.2.x.x | Major Interface Changes | No | Rebuild of Extension/Plugin should fix any problems 40 | x.x.3.x | Minor Interface Changes | Yes | Should work but Rebuild is recommended 41 | x.x.x.4 | Insignificant Interface Changes | Yes | No rebuild is required. 42 | --------------------------------------------------------------------------------------------------------------------- 43 | 44 | */ 45 | #pragma once 46 | 47 | // MIV = MULTI_INTERFACE_VERSION 48 | #define MIV_FRAMEWORK 1 49 | 50 | #define MIV_MAJOR 100 51 | #define MIV_MINOR 0 52 | #define MIV_MICRO 0 53 | 54 | // 91300 // 1.2.3.4 => 01.02.03.04 => 1020304 , 90930 = 0.9.9.30 55 | #define MULTI_INTERFACE_VERSION (DWORD)((MIV_FRAMEWORK * 1000000) + (MIV_MAJOR * 10000) +(MIV_MINOR * 100) + MIV_MICRO) 56 | #define MULTI_INTERFACE_VERSION_DOTTED "1.100.0.0" 57 | 58 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SDK 2 | 3 | MultiCommander SDK 4 | 5 | SDK and Sample on how to build FileSystem Extension or App Extension to MultiCommander 6 | 7 | Require MultiCommand to run the plugins 8 | http://multicommander.com 9 | 10 | -------------------------------------------------------------------------------- /SDKSamples/MCAppExtensionSample/Config/AppExtSample.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SDKSamples/MCAppExtensionSample/Config/Languages/AppExtSample_lang_en.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /SDKSamples/MCAppExtensionSample/Config/Languages/FilePropSample_lang_en.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /SDKSamples/MCAppExtensionSample/DLL_Exports.def: -------------------------------------------------------------------------------- 1 | LIBRARY "MCAppExtensionSample" 2 | 3 | EXPORTS 4 | ; Explicit exports can go here 5 | Create @1 6 | Delete @2 7 | GetExtensionInfo @3 8 | -------------------------------------------------------------------------------- /SDKSamples/MCAppExtensionSample/MCAppExtensionSample.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 10 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav 11 | 12 | 13 | {d75f7e2d-4bbb-4fa3-a125-ce122a781ae0} 14 | 15 | 16 | {0de28918-198d-4375-b9a2-203966f04559} 17 | 18 | 19 | 20 | 21 | Source Files 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | Source Files 30 | 31 | 32 | Source Files 33 | 34 | 35 | Source Files 36 | 37 | 38 | Source Files 39 | 40 | 41 | 42 | 43 | Source Files 44 | 45 | 46 | Source Files 47 | 48 | 49 | Source Files 50 | 51 | 52 | Source Files 53 | 54 | 55 | 56 | 57 | Config\Language 58 | 59 | 60 | Config 61 | 62 | 63 | Config\Language 64 | 65 | 66 | -------------------------------------------------------------------------------- /SDKSamples/MCAppExtensionSample/PostBuild_win32.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | # Path to Portable version use to test the Plugin 4 | SET MCPATH=D:\Projects\MultiCommander\EXE\Win32\UDebug\ 5 | 6 | rem Set The folder name of the Extension 7 | SET EXTENSIONNAME=MCAppSampleExtension 8 | 9 | if not exist "%MCPATH%Extensions\%EXTENSIONNAME%" mkdir "%MCPATH%Extensions\%EXTENSIONNAME%" 10 | 11 | rem if not exist "%MCPATH%Extensions\%EXTENSIONNAME%\Languages" mkdir "%MCPATH%Extensions\%EXTENSIONNAME%\Languages" 12 | 13 | copy /y %1 "%MCPATH%Extensions\%EXTENSIONNAME%\" 14 | 15 | xcopy /S /Y "%~dp0Config\*" "%MCPATH%Extensions\%EXTENSIONNAME%\" 16 | -------------------------------------------------------------------------------- /SDKSamples/MCAppExtensionSample/PostBuild_x64.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | SET MCPATH=D:\Projects\MultiCommander\EXE\x64\UDebug\ 4 | 5 | rem Set The folder name of the Extension 6 | SET EXTENSIONNAME=MCAppSampleExtension 7 | 8 | if not exist "%MCPATH%Extensions\%EXTENSIONNAME%" mkdir "%MCPATH%Extensions\%EXTENSIONNAME%" 9 | 10 | if not exist "%MCPATH%Extensions\%EXTENSIONNAME%\Languages" mkdir "%MCPATH%Extensions\%EXTENSIONNAME%\Languages" 11 | 12 | copy /y %1 "%MCPATH%Extensions\%EXTENSIONNAME%\" 13 | 14 | xcopy /S /Y "%~dp0Config\*" "%MCPATH%Extensions\%EXTENSIONNAME%\" 15 | -------------------------------------------------------------------------------- /SDKSamples/MCAppExtensionSample/ReadMe.txt: -------------------------------------------------------------------------------- 1 | Version 0.3 - Copyright 2025 - Mathias Svensson 2 | 3 | Introduction 4 | ===================================================== 5 | 6 | This DLL contains 2 extennsion/plugins in the same dll. 7 | An App Extension and a FileProperties Plugin for Multi Commander. 8 | 9 | With the AppExtension sample you can see and understanding on how Application Extensions for Multi Commander are created and how they work. 10 | An Application Extension can add Commands/Menu/Toolbars and build UI in tabs and interact with existing UI, and with the core system. 11 | 12 | 13 | Setup and Build 14 | ===================================================== 15 | 16 | To be able to debug you need to have Multi Commander portable. Both 32 and 64bit is recommended so you can test for both. 17 | 18 | * Change the PostBuild_x64.bat and PostBuild_win32.bat so that the path to the Portable version of MultiCommander is correct. 19 | 20 | * Change the paths to the MultiCommander SDK in stdafx.h so it matches where you have the SDK. 21 | 22 | * Configure the project to Launch the portable version of Multi Commander when you select to debug the DLL. (Assuming Portable version is in E:\MCPortable\64Bit) 23 | * Show the Properties for MCAppExtensionSample project 24 | * Select Debugging 25 | * Set "Command" to "E:\MCPortable\64bit\MultiCommander.exe" 26 | * Set "Working dir" to E:\MCPortable\64bit\ 27 | (For 32bit build configuration you should ofcourse setup so that the 32bit version of MultiCommander.exe is run ) 28 | 29 | The Sample project is setup to build both the 32bit adn 64bit versions. 30 | and it is setup to link the CRT static. If you include other 3de party libraries in your code you might need to change that 31 | but then remember to include the dynamic CRT with your plugin. Shipped version of MC is static linked so it require no external dependencies so 32 | you need to provide your on dependencies if you have any. 33 | 34 | 35 | Create you own extension 36 | ======================================================== 37 | You can use this as a base for you own extension 38 | 39 | However you need to change the project and class names and also the extension name 40 | The most importent thing you MOST change is the GUID. 41 | 42 | * Rename the MCAppExtensionSample.h/cpp and Class name to suite your purpose. 43 | * Also change the Library name in DLL_Exports.def or you will get a big fat warning 44 | * in DLL_Exports.cpp make sure Create/Delete/GetExtensionInfo is calling your extensions. 45 | * Fill out the information in the GetExtensionInfo in the extension class 46 | * Change the Extension GUID 47 | * Build both 32 and 64bit 48 | * Create a subfolder /Extensions// 49 | * Copy the .dll and your config and language files there. 50 | 51 | For help use the forum 52 | http://forum.multicommander.com/forum/index.php/board,9.0.html 53 | -------------------------------------------------------------------------------- /SDKSamples/MCAppExtensionSample/Source/AppExtensionCmd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Commands that the Extension will register and use. 4 | // Place the command value between 30000-50000 5 | // 6 | 7 | #define APPEXT_CMD_COMMAND1 30000 8 | #define APPEXT_CMD_COMMAND2 30001 9 | #define APPEXT_CMD_COMMAND3 30002 10 | 11 | -------------------------------------------------------------------------------- /SDKSamples/MCAppExtensionSample/Source/DLL_Exports.cpp: -------------------------------------------------------------------------------- 1 | // MCExtensionTemplate.cpp : Defines the entry point for the DLL application. 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "MCAppExtensionSample.h" 6 | #include "MCFilePropSample.h" 7 | 8 | #ifdef _MANAGED 9 | #pragma managed(push, off) 10 | #endif 11 | 12 | ////////////////////////////////////////////////////////////////////////// 13 | BOOL APIENTRY DllMain(HMODULE /*hModule*/, DWORD ul_reason_for_call, LPVOID /*lpReserved*/) 14 | { 15 | switch (ul_reason_for_call) 16 | { 17 | case DLL_PROCESS_ATTACH: 18 | case DLL_THREAD_ATTACH: 19 | case DLL_THREAD_DETACH: 20 | case DLL_PROCESS_DETACH: 21 | break; 22 | } 23 | return TRUE; 24 | } 25 | 26 | ////////////////////////////////////////////////////////////////////////// 27 | 28 | // nID is the ID of the extensions that it should create. This is 29 | extern "C" /*__declspec(dllexport)*/ PVOID APIENTRY Create( int nID ) 30 | { 31 | if( nID == 0 ) 32 | { 33 | MCNS::MCAppExtensionSample* pExtension = new MCNS::MCAppExtensionSample(); 34 | MCNS::IPluginInterface* pInterface = static_cast(pExtension); 35 | return pInterface; 36 | } 37 | 38 | if( nID == 1 ) 39 | { 40 | MCNS::MCFilePropSample* pExtension = new MCNS::MCFilePropSample(); 41 | MCNS::IFileProperties* pInterface = static_cast(pExtension); 42 | return pInterface; 43 | } 44 | 45 | return NULL; 46 | } 47 | 48 | // pModule is an pointer to and extension that was Created with Create( int nID ). 49 | // nID is the ID of the extension that pModule is 50 | extern "C" /*__declspec(dllexport)*/ bool APIENTRY Delete( MCNS::IPluginInterface* pModule , int nID ) 51 | { 52 | if( pModule == NULL ) 53 | return false; 54 | 55 | if( nID == 0 ) 56 | { 57 | MCNS::MCAppExtensionSample* pExtension = dynamic_cast(pModule); 58 | if( pExtension ) 59 | { 60 | delete pExtension; 61 | return true; 62 | } 63 | 64 | } 65 | 66 | if( nID == 1 ) 67 | { 68 | MCNS::MCFilePropSample* pExtension = dynamic_cast(pModule); 69 | if( pExtension ) 70 | { 71 | delete pExtension; 72 | return true; 73 | } 74 | 75 | } 76 | 77 | return false; 78 | } 79 | 80 | /* 81 | GetExtensionInfo is called until it returns false when Multi Commander is enumerating what Extensions and PLugins exists in this DLL. 82 | nID will increase for every call. And if a ExtensionInfo is returned then that nID will be connected to that extension. 83 | 84 | This way you can have many extensions in the same dll. 85 | */ 86 | 87 | extern "C" /*__declspec(dllexport) */bool APIENTRY GetExtensionInfo( int nID , MCNS::DLLExtensionInfo* pInfo ) 88 | { 89 | if( nID == 0 ) 90 | return MCNS::MCAppExtensionSample::GetExtensionInfo( pInfo ); 91 | 92 | if( nID == 1 ) 93 | return MCNS::MCFilePropSample::GetExtensionInfo(pInfo); 94 | 95 | return false; 96 | } 97 | 98 | 99 | #ifdef _MANAGED 100 | #pragma managed(pop) 101 | #endif 102 | -------------------------------------------------------------------------------- /SDKSamples/MCAppExtensionSample/Source/MCAppExtensionSample.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | // IPluginInterface in located inside the MultiCommander namespace. and since all MC SDK types and interface are inside that namespace it is 5 | // easier to just place your extension inside that interface too. 6 | // (If you do not want that. you need to inherit from MCNS::IPluginInterface. and also add MCNS:: infront of alot of type and interface below..) 7 | // ONLY put "using namespace MCNS;" in the .cpp file.. 8 | MCNSBEGIN 9 | 10 | class MCAppExtensionSample : public IPluginInterface 11 | { 12 | public: 13 | MCAppExtensionSample(void); 14 | ~MCAppExtensionSample(void); 15 | 16 | static bool GetExtensionInfo( DLLExtensionInfo* pInfo ); 17 | public: 18 | 19 | ////////////////////////////////////////////////////////////////////////// 20 | // [ Start - MultiCommander Extension API ] 21 | ////////////////////////////////////////////////////////////////////////// 22 | long PreStartInit( IMultiAppInterface* pAppInterface ) override; 23 | long GetModuleFlags() override; 24 | BOOL Init( IMultiAppInterface* pAppInterface ) override; 25 | char* Get_ModuleID() override { return m_GuidString; } 26 | bool OnNotify( ZHANDLE hFrom , DWORD nNotifyMsg , WPARAM wParam = 0 , LPARAM lParam = 0 , void* pExtra = NULL ) override; 27 | BOOL OnMessage( long msg , ZHANDLE hView , WPARAM param1 , LPARAM param2 ) override; 28 | 29 | BOOL OnCustomCommand( ICustomCommand* pCustomCommand ) override; 30 | 31 | BOOL OnClose(CloseContext& context) override; 32 | 33 | // Use to send data between different kind of extensions 34 | int DoImportData( IXData *pXData ) override; 35 | IImportData* Get_ImportObject() override; 36 | IExportData* Get_ExportObject() override; 37 | 38 | // OPTIONAL - This function is only required to be overridden if you adding MultiScript functions 39 | BOOL OnScriptFunction(IScriptFunctionContext* pScriptFuncContext) override; 40 | ////////////////////////////////////////////////////////////////////////// 41 | // [ End - MultiCommander Extension API ] 42 | ////////////////////////////////////////////////////////////////////////// 43 | private: 44 | void OnCommand1(); 45 | void OnCommand2(); 46 | void OnCommand3(); 47 | 48 | static char m_GuidString[34]; 49 | IMultiAppInterface* m_pAppInterface; 50 | 51 | BOOL OnCommandUI(DWORD nCommandID , DWORD* pFlags); 52 | 53 | }; 54 | 55 | MCNSEND 56 | 57 | -------------------------------------------------------------------------------- /SDKSamples/MCAppExtensionSample/Source/MCFilePropSample.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "MCFilePropSample.h" 3 | 4 | using namespace MCNS; 5 | 6 | #define MCFILEPROP_SAMPLE1 10 7 | #define MCFILEPROP_SAMPLE2 11 8 | 9 | // This GUID MUST be unique, in VS2005+ go to Tools->CreateGUID and select "Registry formt" and remove { } and - 10 | #pragma message(" ** If you create your own Plugin then change this GUID \n ** In visual studio go to Menu > Tools > Create GUID. And remove all ") 11 | char MCFilePropSample::m_GuidString[34] = "AB5FED6DA9AA4D91B16FAB52BB3465A4"; // THIS MUST BE CHANGED TO A UNIQUE ID WHEN CREATING YOU OWN 12 | 13 | WORD MCFilePropSample::m_ExtensionID = 0; 14 | 15 | MCFilePropSample::MCFilePropSample() 16 | { 17 | 18 | } 19 | 20 | MCFilePropSample::~MCFilePropSample() 21 | { 22 | 23 | } 24 | 25 | bool MCFilePropSample::GetExtensionInfo( DLLExtensionInfo* pInfo ) 26 | { 27 | if( pInfo == NULL ) 28 | return false; 29 | 30 | wcsncpy( pInfo->wsName , L"FileProperties Sample" , 100 ); // Name of the Extension (Shown in Extension Manager) 31 | wcsncpy( pInfo->wsPublisher , L"" , 100 ); // Name of the Publisher (Shown in Extension Manager) 32 | wcsncpy( pInfo->wsURL , L"http:\\\\" , 100 ); // URL to Publishers WebPage (Shown in Extension Manager) 33 | wcsncpy( pInfo->wsDesc , L"This is a sample of file properties plugin" , 160 ); // Description of what this extension are doing (Shown in Extension Manager) 34 | wcsncpy( pInfo->wsBaseName , L"FilePropSample" , 100 ); // The basename for language and config files. 35 | // eg if it is "MyExt" then it will look for MyExt_lang_en.xml and MyExt.xml 36 | 37 | strncpy( pInfo->strVersion , "1.1.0.0" , 10 ); // Version no of Your Extension 38 | strncpy( pInfo->strGuid , m_GuidString , 34 ); // The Unique quid that this extension has. 39 | 40 | // PreStartInit is normally not called for FileProperties plugins.. add EXT_PREINIT flag if you want PreStartInit to be called during initialization 41 | #ifdef _UNICODE 42 | pInfo->dwFlags = EXT_TYPE_PROP | EXT_PREINIT | EXT_OS_UNICODE; 43 | #else 44 | pInfo->dwFlags = EXT_TYPE_PROP | EXT_PREINIT | EXT_OS_ANSI; 45 | #endif 46 | 47 | pInfo->dwInitOrder = 2010; // All 3de party extension must start use 2000 or more 48 | pInfo->dwInterfaceVersion = MULTI_INTERFACE_VERSION; // What version of MultiCommander Extension Interface this extensions is built for 49 | return true; 50 | } 51 | 52 | char* MCFilePropSample::Get_ModuleID() 53 | { 54 | return m_GuidString; 55 | } 56 | 57 | long MCFilePropSample::PreStartInit( IMultiAppInterface* pAppInterface ) 58 | { 59 | IFilePropertiesManager* pPropMan = (IFilePropertiesManager*)pAppInterface->QueryInterface(ZOBJ_PROPMANGER, 0); 60 | 61 | if(pPropMan) 62 | { 63 | pPropMan->Init(m_GuidString); 64 | 65 | FilePropData fpd; 66 | ZeroMemory(&fpd, sizeof(FilePropData)); 67 | 68 | std::wstring strCategory = pAppInterface->GetText(MAKETEXTID('p',200)); 69 | fpd.szCategoryName = strCategory.c_str(); 70 | fpd.szDescription = nullptr; 71 | 72 | fpd.PropertyId = MCFILEPROP_SAMPLE1; 73 | fpd.szPropName = L"SampleProp1"; // Machine name. only use Latin chars. This name is not shown to user. 74 | fpd.szDisplayName = pAppInterface->GetText(MAKETEXTID('p',201)); 75 | fpd.dwOptions = FILEPROP_STRING|FILEPROP_ASYNC|FILEPROP_CUSTOMIZABLE; 76 | fpd.IdealWidth = 100; 77 | fpd.Align = DT_LEFT; 78 | pPropMan->RegisterProperty(&fpd); 79 | 80 | fpd.PropertyId = MCFILEPROP_SAMPLE2; 81 | fpd.szPropName = L"SampleProp2"; // Machine name. only use Latin chars. This name is not shown to user. 82 | fpd.szDisplayName = pAppInterface->GetText(MAKETEXTID('p',202)); 83 | fpd.dwOptions = FILEPROP_NUM|FILEPROP_ASYNC|FILEPROP_CUSTOMIZABLE | FILEPROP_EXECUTE; // If user Ctrl+DblClick on this column MCFilePropSample::Execute(..) is called. 84 | fpd.IdealWidth = 40; 85 | fpd.Align = DT_CENTER; 86 | pPropMan->RegisterProperty(&fpd); 87 | 88 | 89 | // pPropMan->Release(); 90 | pAppInterface->ReleaseInterface((ZHANDLE)pPropMan, ZOBJ_PROPMANGER); 91 | 92 | m_ExtensionID = (WORD)pAppInterface->ModuleIDStrToID(m_GuidString); 93 | } 94 | 95 | return 0; 96 | } 97 | 98 | // pParentFileItem is the fileitem to the folder/parent volume that we are about to ask for file properties. 99 | bool MCFilePropSample::Open( IFileItem* /*pParentFileItem*/ ) 100 | { 101 | return false; 102 | } 103 | 104 | bool MCFilePropSample::Open( const WCHAR* /*szParentPath*/ ) 105 | { 106 | return false; 107 | } 108 | 109 | // We no are no longer getting file property for the Parent sent in Open(..) 110 | bool MCFilePropSample::Close() 111 | { 112 | return true; 113 | } 114 | 115 | // If the file property has a special Display text. If this function return false. GetPropStr or GetPropNum is called. 116 | // This can be used if a NUM property should be displayed in a text way. but sorted as NUM. 117 | bool MCFilePropSample::GetDisplayValue( IFileItem* /*pFileItem*/, WCHAR* /*propData*/, WORD /*nLen*/, WORD /*propType*/, const volatile bool* /*pAbort*/ ) 118 | { 119 | return false; 120 | } 121 | 122 | // Get Property for properties of FILEPROP_STRING type 123 | bool MCFilePropSample::GetPropStr( IFileItem* pFileItem, WCHAR* propData, WORD nLen, WORD propType, const volatile bool* /*pAbort*/ ) 124 | { 125 | WCHAR szFilename[_MC_MAXPATH_]; 126 | pFileItem->Get_FullPath(szFilename, _countof(szFilename)); 127 | 128 | ////////////////////////////////////////////////////////////////////////// 129 | // Extras... (This part is not required) 130 | // Before you get the property you can check if it is already set. (Well if it is then this call should not have happened ) 131 | // But you might have stored another property you need before getting the requested one. or something. 132 | ExtraProp prop; 133 | ZeroMemory(&prop, sizeof(ExtraProp)); 134 | if(pFileItem->GetExtraPropData(m_ExtensionID, (WORD)propType, &prop)) 135 | { 136 | if(prop.Flag & ZFXP_DISPLAYNAME) // If the stored property has display name set. then use it 137 | { 138 | wcsncpy(propData, (const WCHAR*)prop.szDisplayName, nLen); 139 | return true; 140 | } 141 | } 142 | ////////////////////////////////////////////////////////////////////////// 143 | 144 | std::wstring strPropData; 145 | if(propType == MCFILEPROP_SAMPLE1) 146 | { 147 | // Get the property for szFilename. 148 | // But since we are got fetching any file value we will only take the filename and reverse it 149 | 150 | strPropData = pFileItem->Get_Name(szFilename, _countof(szFilename)); 151 | std::reverse(strPropData.begin(),strPropData.end()); 152 | wcsncpy(propData, strPropData.c_str(), nLen); 153 | return true; 154 | } 155 | return false; 156 | } 157 | 158 | // Get Property for properties of FILEPROP_NUM type 159 | bool MCFilePropSample::GetPropNum( IFileItem* pFileItem, INT64* propData, WORD propType, const volatile bool* /*pAbort*/ ) 160 | { 161 | WCHAR szFilename[_MC_MAXPATH_]; 162 | pFileItem->Get_FullPath(szFilename, _countof(szFilename)); 163 | 164 | if(propType == MCFILEPROP_SAMPLE2) 165 | { 166 | // Get the property for szFilename. 167 | // But since we are got fetching any file value we will only take the filename and reverse it 168 | std::wstring strPropData; 169 | strPropData = pFileItem->Get_Name(szFilename, _countof(szFilename)); 170 | 171 | *propData = strPropData.size(); 172 | return true; 173 | } 174 | 175 | return false; 176 | } 177 | 178 | bool MCFilePropSample::GetPropDouble(IFileItem* pFileItem, double* propData, WORD propType, const volatile bool* pAbort) 179 | { 180 | UNREFERENCED_PARAMETER(pFileItem); 181 | UNREFERENCED_PARAMETER(propData); 182 | UNREFERENCED_PARAMETER(propType); 183 | UNREFERENCED_PARAMETER(pAbort); 184 | 185 | return false; 186 | } 187 | 188 | 189 | // Called if user change a property (Not Supported yet) 190 | bool MCFilePropSample::SetProp( IFileItem* /*pFileItem*/, WORD /*propType*/, const BYTE* /*propData*/ ) 191 | { 192 | return false; 193 | } 194 | 195 | bool MCFilePropSample::Execute(ExecuteInfo* pExecuteInfo) 196 | { 197 | WCHAR szFilename[_MC_MAXPATH_]; 198 | szFilename[0] = '\0'; 199 | 200 | if(pExecuteInfo && pExecuteInfo->pFileItem) 201 | pExecuteInfo->pFileItem->Get_Name(szFilename, _countof(szFilename)); 202 | 203 | MessageBox(NULL, szFilename, _T("FileProp Sample"), MB_OK); 204 | return true; 205 | } 206 | -------------------------------------------------------------------------------- /SDKSamples/MCAppExtensionSample/Source/MCFilePropSample.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | // IPluginInterface in located inside the MultiCommander namespace. and since all MC SDK types and interface are inside that namespace it is 5 | // easier to just place your extension inside that interface too. 6 | // (If you do not want that. you need to inherit from MCNS::IPluginInterface. and also add MCNS:: infront of alot of type and interface below..) 7 | // ONLY put "using namespace MCNS;" in the .cpp file.. 8 | MCNSBEGIN 9 | 10 | class MCFilePropSample : public IFileProperties 11 | { 12 | public: 13 | MCFilePropSample(); 14 | ~MCFilePropSample(); 15 | 16 | static bool GetExtensionInfo( DLLExtensionInfo* pInfo ); 17 | ////////////////////////////////////////////////////////////////////////// 18 | // IFileProperties overrides 19 | // ////////////////////////////////////////////////////////////////////////// 20 | char* Get_ModuleID() override; 21 | 22 | long PreStartInit( IMultiAppInterface* pAppInterface ) override; 23 | 24 | bool Open(IFileItem* pParentFileItem) override; 25 | bool Open(const WCHAR* szParentPath) override; 26 | 27 | bool Close() override; 28 | 29 | bool GetDisplayValue(IFileItem* pFileItem, WCHAR* propData, WORD nLen, WORD propType, const volatile bool* pAbort) override; 30 | bool GetPropStr(IFileItem* pFileItem, WCHAR* propData, WORD nLen, WORD propType, const volatile bool* pAbort) override; 31 | bool GetPropNum(IFileItem* pFileItem, INT64* propData, WORD propType, const volatile bool* pAbort) override; 32 | bool GetPropDouble(IFileItem* pFileItem, double* propData, WORD propType, const volatile bool* pAbort) override; 33 | 34 | bool SetProp(IFileItem* pFileItem, WORD propType, const BYTE* propData) override; 35 | 36 | // Optional - Do not need to be overriden 37 | bool Execute(ExecuteInfo* pExecuteInfo) override; 38 | ////////////////////////////////////////////////////////////////////////// 39 | protected: 40 | IFileItem* m_pCurrentFileItem; // We will cache the fileitem locally becuse so we can 41 | 42 | static char m_GuidString[34]; 43 | static WORD m_ExtensionID; // Internal Extension ID. Can be different between run so query it in PreStartInit 44 | }; 45 | 46 | MCNSEND 47 | -------------------------------------------------------------------------------- /SDKSamples/MCAppExtensionSample/Source/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // MCExtensionTemplate.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /SDKSamples/MCAppExtensionSample/Source/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | // Modify the following defines if you have to target a platform prior to the ones specified below. 9 | // Refer to MSDN for the latest info on corresponding values for different platforms. 10 | #ifndef WINVER // Allow use of features specific to Windows XP or later. 11 | #define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows. 12 | #endif 13 | 14 | #ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later. 15 | #define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows. 16 | #endif 17 | 18 | #ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later. 19 | #define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later. 20 | #endif 21 | 22 | #ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later. 23 | #define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE. 24 | #endif 25 | 26 | #define _CRT_SECURE_NO_DEPRECATE 27 | 28 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 29 | 30 | // Windows Header Files: 31 | #include 32 | 33 | #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit 34 | 35 | #include 36 | #include 37 | 38 | // STL 39 | #include 40 | #include 41 | 42 | // Multi Commander SDK 43 | #include "..\..\..\MultiCommander\SDK\MultiExtension.h" // AppExtension 44 | #include "..\..\..\MultiCommander\SDK\IFileItem.h" 45 | #include "..\..\..\MultiCommander\SDK\IFileProperties.h" 46 | #include "..\..\..\MultiCommander\SDK\IFilePropertiesManager.h" 47 | 48 | -------------------------------------------------------------------------------- /SDKSamples/MCAppSampleExtension.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.40629.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MCAppExtensionSample", "MCAppExtensionSample\MCAppExtensionSample.vcxproj", "{D7C67C08-F1EE-413D-A0F7-5785F449C480}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MCFSPluginSamples", "MCFSPluginSample\MCFSPluginSample.vcxproj", "{1F8AFFDD-E34F-4D85-8703-B06AE5CB48D4}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Win32 = Debug|Win32 13 | Debug|x64 = Debug|x64 14 | Release|Win32 = Release|Win32 15 | Release|x64 = Release|x64 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {D7C67C08-F1EE-413D-A0F7-5785F449C480}.Debug|Win32.ActiveCfg = Debug|Win32 19 | {D7C67C08-F1EE-413D-A0F7-5785F449C480}.Debug|Win32.Build.0 = Debug|Win32 20 | {D7C67C08-F1EE-413D-A0F7-5785F449C480}.Debug|x64.ActiveCfg = Debug|x64 21 | {D7C67C08-F1EE-413D-A0F7-5785F449C480}.Debug|x64.Build.0 = Debug|x64 22 | {D7C67C08-F1EE-413D-A0F7-5785F449C480}.Release|Win32.ActiveCfg = Release|Win32 23 | {D7C67C08-F1EE-413D-A0F7-5785F449C480}.Release|Win32.Build.0 = Release|Win32 24 | {D7C67C08-F1EE-413D-A0F7-5785F449C480}.Release|x64.ActiveCfg = Release|x64 25 | {D7C67C08-F1EE-413D-A0F7-5785F449C480}.Release|x64.Build.0 = Release|x64 26 | {1F8AFFDD-E34F-4D85-8703-B06AE5CB48D4}.Debug|Win32.ActiveCfg = Debug|Win32 27 | {1F8AFFDD-E34F-4D85-8703-B06AE5CB48D4}.Debug|Win32.Build.0 = Debug|Win32 28 | {1F8AFFDD-E34F-4D85-8703-B06AE5CB48D4}.Debug|x64.ActiveCfg = Debug|x64 29 | {1F8AFFDD-E34F-4D85-8703-B06AE5CB48D4}.Debug|x64.Build.0 = Debug|x64 30 | {1F8AFFDD-E34F-4D85-8703-B06AE5CB48D4}.Release|Win32.ActiveCfg = Release|Win32 31 | {1F8AFFDD-E34F-4D85-8703-B06AE5CB48D4}.Release|Win32.Build.0 = Release|Win32 32 | {1F8AFFDD-E34F-4D85-8703-B06AE5CB48D4}.Release|x64.ActiveCfg = Release|x64 33 | {1F8AFFDD-E34F-4D85-8703-B06AE5CB48D4}.Release|x64.Build.0 = Release|x64 34 | EndGlobalSection 35 | GlobalSection(SolutionProperties) = preSolution 36 | HideSolutionNode = FALSE 37 | EndGlobalSection 38 | EndGlobal 39 | -------------------------------------------------------------------------------- /SDKSamples/MCCopyDataSendGetSample/MCCopyDataSendGetSample.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "stdafx.h" 3 | #include "MCCopyDataSendGetSample.h" 4 | #include 5 | #include "MCCopyData.h" 6 | #include 7 | 8 | 9 | // Global Variables: 10 | HINSTANCE hInst; // current instance 11 | INT_PTR CALLBACK DialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); 12 | 13 | int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, 14 | _In_opt_ HINSTANCE hPrevInstance, 15 | _In_ LPTSTR lpCmdLine, 16 | _In_ int nCmdShow) 17 | { 18 | MSG msg; 19 | BOOL ret; 20 | 21 | HWND hDlg; 22 | hDlg = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_DIALOG1), 0, DialogProc, 0); 23 | ShowWindow(hDlg, nCmdShow); 24 | 25 | while ((ret = GetMessage(&msg, 0, 0, 0)) != 0) 26 | { 27 | if (ret == -1) 28 | return -1; 29 | 30 | if (!IsDialogMessage(hDlg, &msg)) 31 | { 32 | TranslateMessage(&msg); 33 | DispatchMessage(&msg); 34 | } 35 | } 36 | 37 | 38 | return (int) msg.wParam; 39 | } 40 | 41 | std::wstring GetDlgText(HWND hDlg, UINT nDlgID) 42 | { 43 | wchar_t szText[1024] = { 0 }; 44 | GetDlgItemText(hDlg, nDlgID, szText, _countof(szText)); 45 | return szText; 46 | } 47 | void OnCancel(HWND hDlg) 48 | { 49 | SendMessage(hDlg, WM_CLOSE, 0, 0); 50 | } 51 | DWORD GetOptionsFlags(HWND hDlg) 52 | { 53 | DWORD dwFlags = 0; 54 | if (IsDlgButtonChecked(hDlg, IDC_RADIO1) == BST_CHECKED) 55 | dwFlags |= CPF_LEFT; 56 | else if (IsDlgButtonChecked(hDlg, IDC_RADIO2) == BST_CHECKED) 57 | dwFlags |= CPF_LEFT; 58 | else if (IsDlgButtonChecked(hDlg, IDC_RADIO3) == BST_CHECKED) 59 | dwFlags |= CPF_SOURCE; 60 | else if (IsDlgButtonChecked(hDlg, IDC_RADIO4) == BST_CHECKED) 61 | dwFlags |= CPF_TARGET; 62 | 63 | if (IsDlgButtonChecked(hDlg, IDC_CHECK_FOCUS) == BST_CHECKED) 64 | dwFlags |= CPF_FOCUSITEM; 65 | if (IsDlgButtonChecked(hDlg, IDC_CHECK_NEWTAB) == BST_CHECKED) 66 | dwFlags |= CPF_NEWTAB; 67 | 68 | return dwFlags; 69 | } 70 | 71 | void OnButton_GetCurrentItemFullPath(HWND hDlg) 72 | { 73 | MultiCommander::MCCopyDataHelper MCCopyData; 74 | 75 | MCCopyData.Subclass(hDlg); 76 | std::wstring path = MCCopyData.GetCurrentItemFullW(hDlg, GetOptionsFlags(hDlg)); 77 | MCCopyData.ReleaseSubClass(hDlg); 78 | 79 | if (path[0] != '\0') 80 | { 81 | SetDlgItemText(hDlg, IDC_EDIT_PATH, path.c_str()); 82 | } 83 | 84 | } 85 | 86 | void OnButton_GetCurrentItem(HWND hDlg) 87 | { 88 | MultiCommander::MCCopyDataHelper MCCopyData; 89 | 90 | MCCopyData.Subclass(hDlg); 91 | std::wstring path = MCCopyData.GetCurrentItemW(hDlg, GetOptionsFlags(hDlg)); 92 | MCCopyData.ReleaseSubClass(hDlg); 93 | 94 | if (path[0] != '\0') 95 | { 96 | SetDlgItemText(hDlg, IDC_EDIT_PATH, path.c_str()); 97 | } 98 | } 99 | 100 | void OnButton_GetCurrentPath(HWND hDlg) 101 | { 102 | USES_CONVERSION; 103 | MultiCommander::MCCopyDataHelper MCCopyData; 104 | 105 | MCCopyData.Subclass(hDlg); 106 | std::wstring path = MCCopyData.GetCurrentPathW(hDlg, GetOptionsFlags(hDlg)); 107 | MCCopyData.ReleaseSubClass(hDlg); 108 | 109 | if (path[0] != '\0') 110 | { 111 | SetDlgItemText(hDlg, IDC_EDIT_PATH, path.c_str()); 112 | } 113 | 114 | } 115 | 116 | void OnButton_GoToPath(HWND hDlg) 117 | { 118 | TCHAR szPath[1024] = { 0 }; 119 | GetDlgItemText(hDlg, IDC_EDIT_PATH, szPath, _countof(szPath)); 120 | 121 | MultiCommander::MCCopyDataHelper MCCopyData; 122 | MCCopyData.GoToPath(szPath, GetOptionsFlags(hDlg) , hDlg); 123 | } 124 | 125 | 126 | void OnInitDialog(HWND hDlg) 127 | { 128 | SetDlgItemText(hDlg, IDC_EDIT_PATH, L"C:\\Windows\\System32"); 129 | CheckRadioButton(hDlg, IDC_RADIO1, IDC_RADIO4, IDC_RADIO3); 130 | } 131 | INT_PTR CALLBACK DialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) 132 | { 133 | switch (uMsg) 134 | { 135 | case WM_CLOSE: 136 | { 137 | DestroyWindow(hDlg); 138 | return TRUE; 139 | } 140 | 141 | case WM_DESTROY: 142 | { 143 | PostQuitMessage(0); 144 | return TRUE; 145 | } 146 | 147 | case WM_INITDIALOG : 148 | { 149 | OnInitDialog(hDlg); 150 | return TRUE; 151 | } 152 | case WM_COPYDATA: 153 | { 154 | // IF you did not subclass then you need to call it your self 155 | if (MultiCommander::g_pCaller) 156 | { 157 | HWND hWnd = (HWND) wParam; 158 | COPYDATASTRUCT* pCDS = (COPYDATASTRUCT*) lParam; 159 | MultiCommander::g_pCaller->OnWMCopyData(hWnd, pCDS); 160 | } 161 | return TRUE; 162 | } 163 | case WM_COMMAND: 164 | { 165 | switch (LOWORD(wParam)) 166 | { 167 | case IDCANCEL: OnCancel(hDlg); return TRUE; 168 | case IDC_BUTTON1: OnButton_GetCurrentItemFullPath(hDlg); return TRUE; 169 | case IDC_BUTTON2: OnButton_GetCurrentItem(hDlg); return TRUE; 170 | case IDC_BUTTON3: OnButton_GetCurrentPath(hDlg); return TRUE; 171 | case IDC_BUTTON4: OnButton_GoToPath(hDlg); return TRUE; 172 | } 173 | break; 174 | } 175 | } 176 | return FALSE; 177 | } 178 | 179 | -------------------------------------------------------------------------------- /SDKSamples/MCCopyDataSendGetSample/MCCopyDataSendGetSample.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "resource.h" 4 | -------------------------------------------------------------------------------- /SDKSamples/MCCopyDataSendGetSample/MCCopyDataSendGetSample.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiCommander/MultiCommander-SDK/885499ee70e1377c87f9ad78ed41fff2926370f0/SDKSamples/MCCopyDataSendGetSample/MCCopyDataSendGetSample.ico -------------------------------------------------------------------------------- /SDKSamples/MCCopyDataSendGetSample/MCCopyDataSendGetSample.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiCommander/MultiCommander-SDK/885499ee70e1377c87f9ad78ed41fff2926370f0/SDKSamples/MCCopyDataSendGetSample/MCCopyDataSendGetSample.rc -------------------------------------------------------------------------------- /SDKSamples/MCCopyDataSendGetSample/MCCopyDataSendGetSample.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MCCopyDataSendGetSample", "MCCopyDataSendGetSample.vcxproj", "{72F50E92-AE62-4282-90F4-2C781C0B73A3}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {72F50E92-AE62-4282-90F4-2C781C0B73A3}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {72F50E92-AE62-4282-90F4-2C781C0B73A3}.Debug|Win32.Build.0 = Debug|Win32 16 | {72F50E92-AE62-4282-90F4-2C781C0B73A3}.Release|Win32.ActiveCfg = Release|Win32 17 | {72F50E92-AE62-4282-90F4-2C781C0B73A3}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /SDKSamples/MCCopyDataSendGetSample/MCCopyDataSendGetSample.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {72F50E92-AE62-4282-90F4-2C781C0B73A3} 15 | Win32Proj 16 | MCCopyDataSendGetSample 17 | 18 | 19 | 20 | Application 21 | true 22 | v140 23 | Unicode 24 | 25 | 26 | Application 27 | false 28 | v140 29 | true 30 | Unicode 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | true 44 | 45 | 46 | false 47 | 48 | 49 | 50 | Use 51 | Level3 52 | Disabled 53 | WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) 54 | true 55 | MultiThreadedDebug 56 | 57 | 58 | Windows 59 | true 60 | 61 | 62 | 63 | 64 | Level3 65 | Use 66 | MaxSpeed 67 | true 68 | true 69 | WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) 70 | true 71 | MultiThreaded 72 | 73 | 74 | Windows 75 | true 76 | true 77 | true 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | Create 94 | Create 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /SDKSamples/MCCopyDataSendGetSample/MCCopyDataSendSample.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | Header Files 29 | 30 | 31 | Header Files 32 | 33 | 34 | 35 | 36 | Source Files 37 | 38 | 39 | Source Files 40 | 41 | 42 | 43 | 44 | Resource Files 45 | 46 | 47 | 48 | 49 | Resource Files 50 | 51 | 52 | Resource Files 53 | 54 | 55 | -------------------------------------------------------------------------------- /SDKSamples/MCCopyDataSendGetSample/ReadMe.txt: -------------------------------------------------------------------------------- 1 | =========================================================================== 2 | == Sample of how to Send and Get Data from MultiCommander using WM_COPYDATA 3 | =========================================================================== 4 | 5 | 6 | MCCopyData.h is a helper class that will help you to Send/Get data To/From MC 7 | 8 | 9 | To be able to recieve data from MultiCommander the caller must be a program 10 | that has a HWND window to recieve message. 11 | 12 | Sending GOTO command to MultiCommander do not sends a response back so GOTO can 13 | be send from program without a HWND. 14 | 15 | If the path you are sending are ASCII/ANSI then the flag CPF_ANSI must be specified. 16 | However if posible only send UNICODE (wide char) string. Since that works better with 17 | none english characters. 18 | 19 | The Helper class (MCCopyData) will send the command to the first MultiCommander 20 | that it find. If you need a special instance of MultiCommander then you need to write your 21 | own code to find that. 22 | 23 | Examples if using the include help class 24 | 25 | # Send GOTO command to Source Panel. 26 | MultiCommander::MCCopyDataHelper MCCopyData; 27 | MCCopyData.GoToPath(L"C:\\Windows\\System32", CPF_SOURCE, 0); 28 | 29 | # Send GOTO command to Source Panel, open as new tab 30 | MultiCommander::MCCopyDataHelper MCCopyData; 31 | MCCopyData.GoToPath(L"C:\\Windows\\System32", CPF_SOURCE|CPF_NEWTAB, 0); 32 | 33 | # Send GOTO command to Source Panel, open as new tab 34 | MultiCommander::MCCopyDataHelper MCCopyData; 35 | MCCopyData.GoToPath(L"C:\\Windows\\System32", CPF_SOURCE|CPF_NEWTAB, 0); 36 | 37 | # Send GOTO command to Source Panel, and also set MyTxt.txt as the focused item 38 | MultiCommander::MCCopyDataHelper MCCopyData; 39 | MCCopyData.GoToPath(L"D:\\temp\\MyTxt.txt", CPF_SOURCE|CPF_FOCUSITEM, 0); 40 | 41 | # To Get Path/Item Name from MultiCommander, You need to response to the WM_COPYDATA message. 42 | If your program is a pure win32 (not MFC) you can use the included subclass functions in the helper class 43 | and let it process the message. 44 | 45 | # Get CurrentPath from source panel 46 | MultiCommander::MCCopyDataHelper MCCopyData; 47 | MCCopyData.Subclass(hDlg); 48 | std::wstring path = MCCopyData.GetCurrentPathW(hDlg, CPF_SOURCE); 49 | MCCopyData.ReleaseSubClass(hDlg); 50 | 51 | 52 | # Get CurrentItem name from source panel (name of item in focus. No path) 53 | MultiCommander::MCCopyDataHelper MCCopyData; 54 | MCCopyData.Subclass(hDlg); 55 | std::wstring path = MCCopyData.GetCurrentItemW(hDlg, CPF_SOURCE); 56 | MCCopyData.ReleaseSubClass(hDlg); 57 | 58 | # Get full path to Current item in focus in source panel 59 | MultiCommander::MCCopyDataHelper MCCopyData; 60 | MCCopyData.Subclass(hDlg); 61 | std::wstring path = MCCopyData.GetCurrentItemFullW(hDlg, CPF_SOURCE); 62 | MCCopyData.ReleaseSubClass(hDlg); 63 | 64 | -------------------------------------------------------------------------------- /SDKSamples/MCCopyDataSendGetSample/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiCommander/MultiCommander-SDK/885499ee70e1377c87f9ad78ed41fff2926370f0/SDKSamples/MCCopyDataSendGetSample/resource.h -------------------------------------------------------------------------------- /SDKSamples/MCCopyDataSendGetSample/small.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiCommander/MultiCommander-SDK/885499ee70e1377c87f9ad78ed41fff2926370f0/SDKSamples/MCCopyDataSendGetSample/small.ico -------------------------------------------------------------------------------- /SDKSamples/MCCopyDataSendGetSample/stdafx.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "stdafx.h" 3 | 4 | // TODO: reference any additional headers you need in STDAFX.H 5 | // and not in this file 6 | -------------------------------------------------------------------------------- /SDKSamples/MCCopyDataSendGetSample/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | #define _CRT_SECURE_NO_WARNINGS 12 | 13 | // Windows Header Files: 14 | #include 15 | 16 | // C RunTime Header Files 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | 23 | // TODO: reference additional headers your program requires here 24 | -------------------------------------------------------------------------------- /SDKSamples/MCCopyDataSendGetSample/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /SDKSamples/MCFSPluginSample/DLL_Exports.def: -------------------------------------------------------------------------------- 1 | LIBRARY "MCFSPluginSamples" 2 | 3 | EXPORTS 4 | ; Explicit exports can go here 5 | Create @1 6 | Delete @2 7 | GetExtensionInfo @3 8 | -------------------------------------------------------------------------------- /SDKSamples/MCFSPluginSample/FS-Sample-ReadMe.txt: -------------------------------------------------------------------------------- 1 | Version 0.3 - Copyright 2025 - Mathias Svensson 2 | 3 | Introduction 4 | ===================================================== 5 | 6 | This DLL contains 2 File System plugins in the same dll. 7 | One FileSystem Plugin that are using Streaming mode and one that support internal mode. 8 | 9 | A FSPlugin can support both. 10 | 11 | FSPlugin can also be 2 different types. It can be Virtual Device FileSystem or File Based FileSystem. 12 | File Base FileSystem is what you see when you browse into a .zip or other around then your path can be c:\folder\myarchive.zip\subfolder 13 | As you see, the zip is "mounted" in the file system. 14 | Virtual Device FS are like Registry or FTP plugin. you browse them by accessing a virtual device like REG: FTP: 15 | The difference is just how they are mounted and that with file based filesystem you need to be extra carefull when converting paths 16 | from MC Paths to local paths. BUt everything on how plugins are read/written are the same. 17 | 18 | All FSPlugins are inherited from IVolume. When you look at this first it can look scary but you do not have do support all of the 19 | features that you see in IVolume. Some of the functions are only used for Streaming mode and some for Internal Mode. 20 | 21 | Internal Mode plugin are the easiest. But Internal mode plugin can only work aginst the Local Filesystem 22 | (That also include network path \\server\share\, Everything the built in filesystem in Windows support ) 23 | All the work to Add/Extract/Remove/Rename is done internally. If the user read a file the plugin will get a path where to save to file to. 24 | (Eg used by FSRAR, FS7Zip ) 25 | 26 | With Streaming Mode plugin a user can copy from FTP directory to a Streaming Mode FileSystem plugin without data being stored locally first. 27 | If the user read a file the plugin will be asked to return a RWFile interface, and then ReadFile/WriteFile is used to read/write bytes from the file. 28 | This is similar to how the filesystem API works for files in Windows. 29 | (Eg used by FSLocal, FSFTP ) 30 | 31 | A plugin can use a mix of both streaming and internal mode. 32 | FSZip is using both. If you read one file from a zip streaming mode is used. 33 | But if you are copying many files internal mode is used IF the target is local filesystem (C:\, \\server\share ) Because when using internal mode 34 | we can extract the file in the order they are stored inside the zip and it will be faster. 35 | But if the user copy files from inside a Zip to FTP then streaming mode is used. 36 | 37 | With IVolume::GetSupportedOperations() you return what operation your plugin support 38 | 39 | Also one think to keep in mind when create a FileSystem Plugin is that Multi Commander is Multi-Threaded. 40 | All file copy operation is run in background threads, So it is possible to get call from different threads into the same instance of the plugin. 41 | So make sure you protect importent data with locks. 42 | (The FileSystem Plugin Sample are NOT thread safe. ) 43 | 44 | Also all FileSystem Plugins are reference counted. And a instace of a FSPlugin is deleted when reference returns to zero (0). 45 | MC Core system only holds a reference when it absolutley needs to. When you browse away from the filesystem it "might" be removed. 46 | So do not store data that must survive a delete of the instance inside the IVolume inherited class. 47 | 48 | Setup and Build 49 | ===================================================== 50 | 51 | To be able to debug you need to have Multi Commander portable. Both 32 and 64bit is recommended so you can test for both. 52 | 53 | * Change the PostBuild_x64.bat and PostBuild_win32.bat so that the path to the Portable version of MultiCommander is correct. 54 | 55 | * Change the paths to the MultiCommander SDK in stdafx.h so it matches where you have the SDK. 56 | 57 | * Configure the project to Launch the portable version of Multi Commander when you select to debug the DLL. (Assuming Portable version is in E:\MCPortable\64Bit) 58 | * Show the Properties for MCAppExtensionSample project 59 | * Select Debugging 60 | * Set "Command" to "E:\MCPortable\64bit\MultiCommander.exe" 61 | * Set "Working dir" to E:\MCPortable\64bit\ 62 | (For 32bit build configuration you should ofcourse setup so that the 32bit version of MultiCommander.exe is run ) 63 | 64 | The Sample project is setup to build both the 32bit adn 64bit versions. 65 | and it is setup to link the CRT static. If you include other 3de party libraries in your code you might need to change that 66 | but then remember to include the dynamic CRT with your plugin. Shipped version of MC is static linked so it require no external dependencies so 67 | you need to provide your on dependencies if you have any. 68 | 69 | 70 | Create you own extension 71 | ======================================================== 72 | You can use this as a base for you own extension 73 | 74 | However you need to change the project and class names and also the extension name 75 | The most importent thing you MOST change is the GUID. 76 | 77 | * Rename the MCAppExtensionSample.h/cpp and Class name to suite your purpose. 78 | * Also change the Library name in DLL_Exports.def or you will get a big fat warning 79 | * in DLL_Exports.cpp make sure Create/Delete/GetExtensionInfo is calling your extensions. 80 | * Fill out the information in the GetExtensionInfo in the extension class 81 | * Change the Extension GUID 82 | * Build both 32 and 64bit 83 | * Create a subfolder /Extensions// 84 | * Copy the .dll and your config and language files there. 85 | 86 | For help use the forum 87 | http://forum.multicommander.com/forum/index.php/board,9.0.html 88 | -------------------------------------------------------------------------------- /SDKSamples/MCFSPluginSample/MCFSPluginSample.cpp: -------------------------------------------------------------------------------- 1 | // MCFSPluginSample.cpp : Defines the exported functions for the DLL application. 2 | // 3 | 4 | #include "stdafx.h" 5 | 6 | 7 | -------------------------------------------------------------------------------- /SDKSamples/MCFSPluginSample/MCFSPluginSample.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | Header Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | Header Files 41 | 42 | 43 | 44 | 45 | Source Files 46 | 47 | 48 | Source Files 49 | 50 | 51 | Source Files 52 | 53 | 54 | Source Files 55 | 56 | 57 | Source Files 58 | 59 | 60 | Source Files 61 | 62 | 63 | Source Files 64 | 65 | 66 | 67 | 68 | Source Files 69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /SDKSamples/MCFSPluginSample/PostBuild_win32.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | # Path to Portable version use to test the Plugin 4 | SET MCPATH=D:\Projects\MultiCommander\EXE\Win32\UDebug\ 5 | 6 | rem Set The folder name of the Extension 7 | SET EXTENSIONNAME=MCFSSamples 8 | 9 | if not exist "%MCPATH%Extensions\%EXTENSIONNAME%" mkdir "%MCPATH%Extensions\%EXTENSIONNAME%" 10 | 11 | rem if not exist "%MCPATH%Extensions\%EXTENSIONNAME%\Languages" mkdir "%MCPATH%Extensions\%EXTENSIONNAME%\Languages" 12 | 13 | copy /y %1 "%MCPATH%Extensions\%EXTENSIONNAME%\" 14 | 15 | xcopy /S /Y "%~dp0Config\*" "%MCPATH%Extensions\%EXTENSIONNAME%\" 16 | -------------------------------------------------------------------------------- /SDKSamples/MCFSPluginSample/PostBuild_x64.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | SET MCPATH=D:\Projects\MultiCommander\EXE\x64\UDebug\ 4 | 5 | rem Set The folder name of the Extension 6 | SET EXTENSIONNAME=MCFSSamples 7 | 8 | if not exist "%MCPATH%Extensions\%EXTENSIONNAME%" mkdir "%MCPATH%Extensions\%EXTENSIONNAME%" 9 | 10 | if not exist "%MCPATH%Extensions\%EXTENSIONNAME%\Languages" mkdir "%MCPATH%Extensions\%EXTENSIONNAME%\Languages" 11 | 12 | echo Copy Extension 13 | copy /y %1 "%MCPATH%Extensions\%EXTENSIONNAME%\" 14 | 15 | echo Copy Configuration for Extension 16 | xcopy /S /Y "%~dp0Config\*" "%MCPATH%Extensions\%EXTENSIONNAME%\" 17 | 18 | exit 0 -------------------------------------------------------------------------------- /SDKSamples/MCFSPluginSample/Source/AutoHandle.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class AutoHandle 4 | { 5 | public: 6 | AutoHandle(HANDLE h = INVALID_HANDLE_VALUE) 7 | : m_hHandle(h) 8 | { 9 | 10 | } 11 | ~AutoHandle() 12 | { 13 | Release(); 14 | } 15 | 16 | void Release() 17 | { 18 | if(isValid()) 19 | { 20 | CloseHandle(m_hHandle); 21 | m_hHandle = INVALID_HANDLE_VALUE; 22 | } 23 | } 24 | 25 | bool isValid() 26 | { 27 | if(m_hHandle == INVALID_HANDLE_VALUE) 28 | return false; 29 | 30 | return true; 31 | } 32 | 33 | AutoHandle& operator=(const HANDLE& handle) 34 | { 35 | Release(); 36 | m_hHandle = handle; 37 | return *this; 38 | } 39 | 40 | operator HANDLE() 41 | { 42 | return m_hHandle; 43 | } 44 | 45 | private: 46 | HANDLE m_hHandle; 47 | 48 | }; -------------------------------------------------------------------------------- /SDKSamples/MCFSPluginSample/Source/DLL_Exports.cpp: -------------------------------------------------------------------------------- 1 | // MCExtensionTemplate.cpp : Defines the entry point for the DLL application. 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "FSSampleStream.h" 6 | #include "FSSampleInternal.h" 7 | 8 | #ifdef _MANAGED 9 | #pragma managed(push, off) 10 | #endif 11 | 12 | ////////////////////////////////////////////////////////////////////////// 13 | BOOL APIENTRY DllMain(HMODULE /*hModule*/, DWORD ul_reason_for_call, LPVOID /*lpReserved*/) 14 | { 15 | switch (ul_reason_for_call) 16 | { 17 | case DLL_PROCESS_ATTACH: break; 18 | case DLL_THREAD_ATTACH: break; 19 | case DLL_THREAD_DETACH: break; 20 | case DLL_PROCESS_DETACH: 21 | { 22 | MCNS::MCFSSampleStream::MemFSClear(); 23 | MCNS::MCFSSampleInternal::MemFSClear(); 24 | } 25 | break; 26 | } 27 | return TRUE; 28 | } 29 | 30 | ////////////////////////////////////////////////////////////////////////// 31 | 32 | // nID is the ID of the extensions that it should create. This is 33 | extern "C" /*__declspec(dllexport)*/ PVOID APIENTRY Create( int nID ) 34 | { 35 | if( nID == 0 ) 36 | { 37 | MCNS::MCFSSampleStream* pExtension = new MCNS::MCFSSampleStream(); 38 | MCNS::IVolume* pIVolume = static_cast(pExtension); 39 | return pIVolume; 40 | } 41 | 42 | if( nID == 1 ) 43 | { 44 | MCNS::MCFSSampleInternal* pExtension = new MCNS::MCFSSampleInternal(); 45 | MCNS::IVolume* pIVolume = static_cast(pExtension); 46 | return pIVolume; 47 | } 48 | 49 | return NULL; 50 | } 51 | 52 | // pModule is an pointer to and extension that was Created with Create( int nID ). 53 | // nID is the ID of the extension that pModule is 54 | extern "C" /*__declspec(dllexport)*/ bool APIENTRY Delete( MCNS::IVolume* pModule , int nID ) 55 | { 56 | if( pModule == NULL ) 57 | return false; 58 | 59 | if( nID == 0 ) 60 | { 61 | MCNS::MCFSSampleStream* pFSPlugin = dynamic_cast(pModule); 62 | if( pFSPlugin ) 63 | { 64 | delete pFSPlugin; 65 | return true; 66 | } 67 | 68 | } 69 | if( nID == 1 ) 70 | { 71 | MCNS::MCFSSampleInternal* pFSPlugin = dynamic_cast(pModule); 72 | if( pFSPlugin ) 73 | { 74 | delete pFSPlugin; 75 | return true; 76 | } 77 | 78 | } 79 | 80 | 81 | return false; 82 | } 83 | 84 | /* 85 | GetExtensionInfo is called until it returns false when Multi Commander is enumerating what Extensions and PLugins exists in this DLL. 86 | nID will increase for every call. And if a ExtensionInfo is returned then that nID will be connected to that extension. 87 | 88 | This way you can have many extensions in the same dll. 89 | */ 90 | 91 | extern "C" /*__declspec(dllexport) */bool APIENTRY GetExtensionInfo( int nID , MCNS::DLLExtensionInfo* pInfo ) 92 | { 93 | if( nID == 0 ) 94 | return MCNS::MCFSSampleStream::GetExtensionInfo( pInfo ); 95 | 96 | if( nID == 1 ) 97 | return MCNS::MCFSSampleInternal::GetExtensionInfo( pInfo ); 98 | 99 | return false; 100 | } 101 | 102 | 103 | #ifdef _MANAGED 104 | #pragma managed(pop) 105 | #endif 106 | -------------------------------------------------------------------------------- /SDKSamples/MCFSPluginSample/Source/FSSampleInternal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "MemoryFileSystem.h" 4 | 5 | // This is a sample of a file system plugin for Multi Commander that support the INTERNAL mode of reading/writing files. 6 | // A FileSystem Plugin that support internal mode can NOT read/write file using bytes of data sent to it. 7 | // When adding files to a FSPlugin supporting internal mode path to file on the local filesystem is sent to the plugin and 8 | // it will handle all of the adding of them INTERNALLY 9 | // Example of Streaming FileSystems are Rar, 7Zip, 10 | // 11 | // Read FS-Sample-ReadMe.txt first. 12 | 13 | MCNSBEGIN 14 | 15 | class MCFSSampleInternal : public IVolume 16 | { 17 | public: 18 | static bool GetExtensionInfo( DLLExtensionInfo* pInfo ); 19 | 20 | MCFSSampleInternal(); 21 | virtual ~MCFSSampleInternal(); 22 | 23 | char* Get_ModuleID() override { return m_GuidString; } 24 | 25 | long PreStartInit(IMultiAppInterface* pInterface) override; 26 | 27 | bool GetIcon(HICON* pIcon, const WCHAR* fileExtension, MCIconSize iconSize) override; 28 | DWORD GetSupportedOperations() override; 29 | bool IsBusy() override; 30 | BOOL CreateVolume(const WCHAR* szVolume, const WCHAR* szMountPath = NULL, eVCREATE_MODE nCreateMode = VCM_NEW, VolumePackOptions* pOptions = NULL, DWORD nItemHint = 0) override; 31 | 32 | BOOL Open(const WCHAR* szVolume , const WCHAR* szMountPath = NULL , eVOPEN_MODE nOpenMode = VOM_READ, DWORD dwFlags = 0) override; 33 | 34 | // nOverrideMode is to Reopen to nOpenMode even if CurrentMode is nOrverrideMode 35 | BOOL ReOpen(int nOpenMode , int nOverrideMode = 0, DWORD dwOpenFlags = 0) override; 36 | 37 | // Close volume. Unpack/Disconnect 38 | BOOL Close() override; 39 | 40 | BOOL isOpen() override; 41 | 42 | // Return VERROR_NOERROR if path is Okey, return VERROR_PATH_TO_LONG if it is too long. or some other error code if it is invalid 43 | DWORD VerifyPath(const WCHAR* szPath) override; 44 | 45 | // GetRootPath() ( eg if open with Open( "c:\myzipvolume.zip" ); then GetRootPath should return "c:\myzipvolume.zip\" 46 | // if open with c:\kalle\nisse then root path is "c:\" 47 | // if open with c:\myzipvolume.zip\source\crypt then root path is "c:\myzipvolume.zip\" 48 | const WCHAR* GetMountPath() override; // Return the path to where this volume is mounted into the virtual file system 49 | const WCHAR* GetVolumePath() override; // return the real volume path 50 | 51 | // Enum Volume Content 52 | ZHANDLE InitFind( const WCHAR* strPath , const WCHAR* szPattern = NULL , DWORD dwFlags = 0, IVolumeFindCallback* pFindCallback = nullptr) override; 53 | BOOL FindNext( ZHANDLE h , /*[out]*/ IFileItem *pItem = NULL ) override ; 54 | BOOL FindNext( ZHANDLE h , /*[out]*/ WCHAR* szFileName , int nameLen, UINT64& dwAttributes ) override; 55 | //return 0xfffffff or (unsigned long)-1 if error.. else update flags 56 | // date that is set is LOCALTIME.. 57 | DWORD SetFileData( ZHANDLE h , /*[out]*/ IFileItem *pItem , BOOL bUpdate = FALSE ) override; 58 | BOOL FindClose( ZHANDLE h ) override; 59 | ////////////////////////////////////////////////////////////////////////// 60 | 61 | // check if file/path exists in this volume 62 | BOOL Exists( const WCHAR* szPath ) override; 63 | 64 | BOOL Makedir( const WCHAR* szPath , const FILETIME* pFileTime = NULL, DWORD dwExecuteOptions = 0 /* EXO_ */) override; 65 | BOOL MoveItem( const WCHAR* szExistingFile , const WCHAR* szNewFilename, DWORD dwExecuteOptions /* EXO_ */) override; 66 | BOOL DeleteItem( const WCHAR* strExistingFile , DWORD dwExecuteOptions = EXO_ISFILE) override; 67 | 68 | UINT64 GetAttributes( const WCHAR* szFilename ) override; // return INVALID_FILE_ATTRIBUTES if strFilename does not exists on volume. 69 | BOOL SetAttributes( const WCHAR* szFilename , UINT64 dwAttribute, DWORD dwExecuteOptions /* EXO_ */) override; 70 | 71 | BOOL SetFileTime( const WCHAR* szFilename , const FILETIME *lpCreationTime, const FILETIME *lpLastAccessTime, const FILETIME *lpLastWriteTime, DWORD dwExecuteOptions /* EXO_ */ ) override; 72 | 73 | // Get file info 74 | BOOL GetFileInfo( const WCHAR* szFilename , ZFILEINFO &info ) override; 75 | 76 | // 1 = YES , 0 = NO , -1 Dont Know, maybe ( -1 will mostly be threated as NO during delete then.) 77 | INT IsFolderEmpty( const WCHAR* szFolderPath ) override; 78 | 79 | DWORD GetLastError() override; 80 | DWORD GetLastError_InternalErrorCode() override; // Use when GetLastError is VERROR_UNKNOWN, Then it will show an internal ErrorCode 81 | 82 | DWORD ExtractFile( const WCHAR* strFilename , const WCHAR* strWritePath, DWORD dwFlags = 0 ) override; // VSO_NOMEMBUFFER 83 | 84 | IRWFile* CreateItem( const WCHAR* strFilename , DWORD dwAccessMode , DWORD dwCreateMode , UINT64 dwAttributes = 0 , DWORD dwRWFlags = 0 , const FILETIME* ftFileTime = NULL , INT64 nFileSize = 0) override; 85 | BOOL CloseItem(IRWFile *pIFile, bool bAbort) override; 86 | 87 | DWORD GetOptionalFunctions() override; // IVF_xxxxx 88 | 89 | // return size (in size parameter) of file or folder. if folder it should scan recursive and use filter 90 | // return TRUE if successful or FALSE if not 91 | // you should check if bAbort goes FALSE. if it does user have chosen to break this operation 92 | BOOL GetSize( const WCHAR* szPath , const WCHAR* szFilter , /*[out]*/ INT64& size, bool followLinks, volatile bool *bAbort ) override; 93 | 94 | BOOL ShowConfigDlg( DWORD& dwConfigValue , BOOL bReadConfig = TRUE , BOOL* bSaveAsDefault = NULL ) override; 95 | 96 | ZHANDLE BatchFileOperations_Init( IProgress* pProgress , DWORD dwFlags = 0, BatchMode mode = BatchModePut) override; 97 | BOOL BatchFileOperations_QueueGetItem( ZHANDLE hIntOp , const WCHAR* szFilename , const WCHAR* szWriteName , DWORD dwFlags = 0, DWORD dwWriteFlags = 0, DWORD_PTR refID = 0 ) override; 98 | BOOL BatchFileOperations_QueueInsertItem( ZHANDLE hIntOp , const IFileItem* pItem, const WCHAR* szWriteName , DWORD dwFlags = 0, DWORD dwWriteFlags = 0, DWORD_PTR refID = 0 ) override; 99 | DWORD BatchFileOperations_QueueDeleteItem( ZHANDLE hIntOp, const WCHAR* szFilename , DWORD dwFlags = 0, DWORD_PTR refID = 0) override; 100 | 101 | BOOL BatchFileOperations_Start( ZHANDLE hIntOp , DWORD &dwOptions, MCNS::OverwriteOption& owOption, BatchMode mode) override; 102 | BOOL BatchFileOperations_Release( ZHANDLE hIntOp ) override; 103 | 104 | bool NeedParseContent() override; 105 | 106 | static void MemFSClear() 107 | { 108 | m_MemFS.Clear(); 109 | } 110 | protected: 111 | void ResetLastError(); 112 | 113 | protected: 114 | static char m_GuidString[34]; 115 | std::wstring m_strMountPath; 116 | 117 | DWORD m_nLastError; 118 | 119 | // MCFSSampleInternal will be deleted when refcounter is 0. 120 | // Since this "fake" FS is memory based. We do not want to loose it. so use a static 121 | // Just make sure that you clean it up in DllMain when DLL_PROCESS_DETACH is sent. 122 | static MemoryFileSystem m_MemFS; 123 | }; 124 | 125 | MCNSEND 126 | 127 | -------------------------------------------------------------------------------- /SDKSamples/MCFSPluginSample/Source/FSSampleStream.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "MemoryFileSystem.h" 3 | 4 | // This is a sample of a file system plugin for Multi Commander that support the STREAM modes of reading/writing files. 5 | // A FileSystem Plugin that support stream modes can act as it was a normal file system. It read/writes data in chunks 6 | // Example of Streaming FileSystems are Local (of course), FTP, Some part of Zip, (Zip support both) 7 | // 8 | // Read FS-Sample-ReadMe.txt first. 9 | // 10 | // Not all functions are overridden here. Look at IVolume for a complete list of supported functions 11 | // 12 | 13 | MCNSBEGIN 14 | 15 | class MCFSSampleStream : public IVolume 16 | { 17 | public: 18 | static bool GetExtensionInfo( DLLExtensionInfo* pInfo ); 19 | 20 | MCFSSampleStream(); 21 | virtual ~MCFSSampleStream(); 22 | 23 | char* Get_ModuleID() override { return m_GuidString; } 24 | 25 | long PreStartInit(IMultiAppInterface* pInterface) override; 26 | 27 | bool GetIcon(HICON* pIcon, const WCHAR* fileExtension, MCIconSize iconSize) override; 28 | DWORD GetSupportedOperations() override; 29 | bool IsBusy() override; 30 | BOOL CreateVolume(const WCHAR* szVolume, const WCHAR* szMountPath = NULL, eVCREATE_MODE nCreateMode = VCM_NEW, VolumePackOptions* pOptions = NULL, DWORD nItemHint = 0) override; 31 | 32 | BOOL Open(const WCHAR* szVolume , const WCHAR* szMountPath = NULL , eVOPEN_MODE nOpenMode = VOM_READ, DWORD dwFlags = 0) override; 33 | 34 | // nOverrideMode is to Reopen to nOpenMode even if CurrentMode is nOrverrideMode 35 | BOOL ReOpen(int nOpenMode , int nOverrideMode = 0, DWORD dwOpenFlags = 0) override; 36 | 37 | // Close volume. Unpack/Disconnect 38 | BOOL Close() override; 39 | 40 | BOOL isOpen() override; 41 | 42 | // Return VERROR_NOERROR if path is Okey, return VERROR_PATH_TO_LONG if it is too long. or some other error code if it is invalid 43 | DWORD VerifyPath(const WCHAR* szPath) override; 44 | 45 | // GetRootPath() ( eg if open with Open( "c:\myzipvolume.zip" ); then GetRootPath should return "c:\myzipvolume.zip\" 46 | // if open with c:\kalle\nisse then root path is "c:\" 47 | // if open with c:\myzipvolume.zip\source\crypt then root path is "c:\myzipvolume.zip\" 48 | const WCHAR* GetMountPath() override; // Return the path to where this volume is mounted into the virtual file system 49 | const WCHAR* GetVolumePath() override; // return the real volume path 50 | 51 | // Enum Volume Content 52 | ZHANDLE InitFind( const WCHAR* szPath , const WCHAR* szPattern = NULL , DWORD dwFlags = 0, IVolumeFindCallback* pFindCallback = nullptr) override; 53 | BOOL FindNext( ZHANDLE h , /*[out]*/ IFileItem *pItem = NULL ) override; 54 | BOOL FindNext( ZHANDLE h , /*[out]*/ WCHAR* szFileName , int nameLen, UINT64& dwAttributes ) override; 55 | 56 | DWORD SetFileData( ZHANDLE h , /*[out]*/ IFileItem *pItem , BOOL bUpdate = FALSE ) override; 57 | BOOL FindClose( ZHANDLE h ) override; 58 | ////////////////////////////////////////////////////////////////////////// 59 | 60 | // check if file/path exists in this volume 61 | BOOL Exists( const WCHAR* szPath ) override; 62 | 63 | BOOL Makedir( const WCHAR* szPath , const FILETIME* pFileTime = NULL, DWORD dwExecuteOptions = 0 /* EXO_ */) override; 64 | BOOL MoveItem( const WCHAR* strExistingFile , const WCHAR* strNewFilename, DWORD dwExecuteOptions /* EXO_ */) override; 65 | BOOL DeleteItem( const WCHAR* strExistingFile , DWORD dwExecuteOptions = EXO_ISFILE) override; 66 | 67 | UINT64 GetAttributes( const WCHAR* szFilename ) override; // return INVALID_FILE_ATTRIBUTES if strFilename does not exists on volume. 68 | BOOL SetAttributes( const WCHAR* szFilename , UINT64 dwAttribute, DWORD dwExecuteOptions /* EXO_ */) override; 69 | 70 | BOOL SetFileTime( const WCHAR* szFilename , const FILETIME *lpCreationTime, const FILETIME *lpLastAccessTime, const FILETIME *lpLastWriteTime, DWORD dwExecuteOptions /* EXO_ */ ) override; 71 | 72 | // Get file info 73 | BOOL GetFileInfo( const WCHAR* szFilename , ZFILEINFO &info ) override; 74 | 75 | // 1 = YES , 0 = NO , -1 Dont Know, maybe ( -1 will mostly be threated as NO during delete then.) 76 | INT IsFolderEmpty( const WCHAR* szFolderPath ) override; 77 | 78 | DWORD GetLastError() override; 79 | DWORD GetLastError_InternalErrorCode() override; // Use when GetLastError is VERROR_UNKNOWN, Then it will show an internal ErrorCode 80 | 81 | DWORD ExtractFile( const WCHAR* szFilename , const WCHAR* szWritePath, DWORD dwFlags = 0 ) override; // VSO_NOMEMBUFFER 82 | 83 | IRWFile* CreateItem( const WCHAR* szFilename , DWORD dwAccessMode , DWORD dwCreateMode , UINT64 dwAttributes = 0 , DWORD dwRWFlags = 0 , const FILETIME* ftFileTime = NULL , INT64 nFileSize = 0) override; 84 | BOOL CloseItem(IRWFile *pIFile, bool bAbort) override; 85 | 86 | DWORD GetOptionalFunctions() override; // IVF_xxxxx 87 | 88 | // return size (in the size parameter) of file or folder. if folder it should scan recursive and use filter 89 | // return TRUE if successful or FALSE if not 90 | // you should check if bAbort goes FALSE. if it does user have chosen to break this operation 91 | BOOL GetSize( const WCHAR* strPath , const WCHAR* szFilter , /*[out]*/ INT64& size, bool followLinks, volatile bool* bAbort ) override; 92 | 93 | BOOL ShowConfigDlg( DWORD& dwConfigValue , BOOL bReadConfig = TRUE , BOOL* bSaveAsDefault = NULL ) override; 94 | 95 | ZHANDLE BatchFileOperations_Init( IProgress* pProgress , DWORD dwFlags = 0, BatchMode mode = BatchModePut) override; 96 | BOOL BatchFileOperations_QueueGetItem( ZHANDLE hIntOp , const WCHAR* szFilename , const WCHAR* szWriteName , DWORD dwFlags = 0, DWORD dwWriteFlags = 0, DWORD_PTR refID = 0 ) override; 97 | BOOL BatchFileOperations_QueueInsertItem( ZHANDLE hIntOp , const IFileItem* pItem, const WCHAR* szWriteName , DWORD dwFlags = 0, DWORD dwWriteFlags = 0, DWORD_PTR refID = 0 ) override; 98 | DWORD BatchFileOperations_QueueDeleteItem( ZHANDLE hIntOp, const WCHAR* szFilename , DWORD dwFlags = 0, DWORD_PTR refID = 0) override; 99 | 100 | BOOL BatchFileOperations_Start( ZHANDLE hIntOp , DWORD &dwOptions, MCNS::OverwriteOption& owOption, BatchMode mode) override; 101 | BOOL BatchFileOperations_Release( ZHANDLE hIntOp ) override; 102 | 103 | bool NeedParseContent() override; 104 | 105 | 106 | static void MemFSClear() 107 | { 108 | m_MemFS.Clear(); 109 | } 110 | 111 | protected: 112 | IRWFile* CreateFileWrite( const WCHAR* szFilename , DWORD dwAccessMode , DWORD dwCreateMode , UINT64 dwAttributes /*= 0 */, DWORD dwRWFlags /*= 0 */, const FILETIME* ftFileTime /*= NULL */, INT64 nFileSize /*= 0*/ ); 113 | IRWFile* CreateFileRead( const WCHAR* szFilename , DWORD dwAccessMode , DWORD dwCreateMode , UINT64 dwAttributes /*= 0 */, DWORD dwRWFlags /*= 0 */, const FILETIME* ftFileTime /*= NULL */, INT64 nFileSize /*= 0*/ ); 114 | 115 | void ResetLastError(); 116 | 117 | protected: 118 | static char m_GuidString[34]; 119 | std::wstring m_strMountPath; 120 | 121 | DWORD m_nLastError; 122 | 123 | // MCFSSampleStream will be deleted when refcounter is 0. 124 | // Since this "fake" FS is memory based. We do not want to loose it. so use a static 125 | // Just make sure that you clean it up in DllMain when DLL_PROCESS_DETACH is sent. 126 | static MemoryFileSystem m_MemFS; 127 | }; 128 | 129 | MCNSEND 130 | -------------------------------------------------------------------------------- /SDKSamples/MCFSPluginSample/Source/InternalFileOperations.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include // std::unique_ptr 4 | 5 | class MCNS::IProgress; 6 | class MemoryFileSystem; 7 | class MemoryFile; 8 | 9 | class WriteItem 10 | { 11 | public: 12 | WriteItem(const MCNS::IFileItem* pItem, const WCHAR* szTargetName) 13 | : m_pSourceItem(pItem) 14 | { 15 | if(szTargetName) 16 | m_strTargetName = szTargetName; 17 | } 18 | 19 | const MCNS::IFileItem* m_pSourceItem; // Source item to add into the plugin filesystem 20 | std::wstring m_strTargetName; // Target path relative to plugin filesystem 21 | }; 22 | 23 | class DeleteItem 24 | { 25 | public: 26 | DeleteItem(const WCHAR* szDeleteItem) 27 | { 28 | if(szDeleteItem) 29 | m_strDeleteItem = szDeleteItem; 30 | } 31 | 32 | std::wstring m_strDeleteItem; 33 | }; 34 | 35 | #define IFOBJ_READ 0x00001000L 36 | #define IFOBJ_WRITE 0x00010000L 37 | 38 | class WriteToDiskItem 39 | { 40 | public: 41 | WriteToDiskItem() 42 | { 43 | } 44 | WriteToDiskItem(std::shared_ptr& pSourceFile, const WCHAR* szTargetName) 45 | : pFile(pSourceFile) 46 | , m_strTargetName(szTargetName) 47 | { 48 | } 49 | 50 | std::shared_ptr pFile; 51 | std::wstring m_strTargetName; 52 | }; 53 | 54 | class InternalFileOperation 55 | { 56 | public: 57 | InternalFileOperation(DWORD t) 58 | : ObjType(t) 59 | { 60 | 61 | } 62 | virtual ~InternalFileOperation() 63 | { 64 | 65 | } 66 | 67 | DWORD ObjType = 0; 68 | }; 69 | 70 | // Read FROM out internal filesystem 71 | class InternalReadFileOperations : public InternalFileOperation 72 | { 73 | public: 74 | InternalReadFileOperations(MCNS::IProgress* pProgress , DWORD dwFlags); 75 | virtual ~InternalReadFileOperations() 76 | { 77 | 78 | } 79 | void Add(std::shared_ptr& pFile, const WCHAR* szWriteName) 80 | { 81 | m_vItems.push_back(std::make_unique(pFile, szWriteName)); 82 | } 83 | DWORD WriteQueuedItemsToDisk(); 84 | protected: 85 | DWORD WriteItem(WriteToDiskItem* pItem); 86 | 87 | std::vector> m_vItems; 88 | MCNS::IProgress* m_pProgress; 89 | DWORD m_dwFlags; 90 | 91 | }; 92 | 93 | // Write TO out Internal filesystem 94 | class InternalWriteFileOperations: public InternalFileOperation 95 | { 96 | public: 97 | InternalWriteFileOperations(MCNS::IProgress* pProgress , DWORD dwFlags); 98 | virtual ~InternalWriteFileOperations() 99 | { 100 | 101 | } 102 | 103 | bool AddItem(const MCNS::IFileItem* pItem, const WCHAR* szTargetName); 104 | bool AddDeleteItem(const WCHAR* szDeleteFileItem); 105 | 106 | DWORD StartFileOperations(MemoryFileSystem* pFS); 107 | 108 | // Copy Operations 109 | DWORD CountItems(); 110 | const MCNS::IFileItem* SourceItemAt(DWORD n); 111 | std::wstring TargetNameAt(DWORD n); 112 | 113 | // 114 | DWORD CountDeleteItems(); 115 | const std::wstring& GetDeleteItemAt(DWORD n) const; 116 | void ClearDeleteItems(); 117 | 118 | private: 119 | void NotifyPathChange(const std::wstring& pathItem, bool bDelete = false) const; 120 | 121 | DWORD StartCopyFileOperations(); 122 | DWORD StartDeleteFileOperations(); 123 | DWORD DeleteFileItem(const std::wstring& strDeleteItem); 124 | 125 | DWORD CopyFileItem(const MCNS::IFileItem* pSourceItem, const std::wstring& strTargetPath); 126 | void SetProgressTargetPath(const std::wstring& strTargetPath); 127 | void SetProgressSourceInfo(const MCNS::IFileItem* pSourceItem, WCHAR* szSourcePath, size_t len); 128 | 129 | void SetFileDateAndAttributes(std::shared_ptr& pFile, const MCNS::IFileItem* pFileItem); 130 | 131 | MemoryFileSystem* m_pMemFS; 132 | MCNS::IProgress* m_pProgress; 133 | DWORD m_dwFlags; 134 | 135 | std::wstring m_Empty; 136 | std::vector m_vItems; 137 | std::vector m_vDeleteItems; 138 | 139 | std::unique_ptr m_pBuffer; 140 | }; -------------------------------------------------------------------------------- /SDKSamples/MCFSPluginSample/Source/MemoryFileSystem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | // Both FSSampleInternal and FSSampleStream is using this MemoryFileSystem. 7 | const INT64 BLOCKSIZE = 32*1024; 8 | 9 | class MemoryFile 10 | { 11 | public: 12 | MemoryFile(); 13 | 14 | const WCHAR* Name() const { return m_Name.c_str(); } 15 | void Name(const WCHAR* szName) { m_Name = szName; } 16 | 17 | INT64 Size() const { return m_Size; } 18 | bool IsFolder() const { return (m_Attributes & ZFF_FOLDER) > 0; } 19 | 20 | UINT64 Attributes() const { return m_Attributes; } 21 | void Attributes(UINT64 dwAttribute) { m_Attributes = dwAttribute; } 22 | 23 | void SetFileTime(const FILETIME* ft) { m_FileTime = *ft; } 24 | void GetFileTime(FILETIME* ft) const { *ft = m_FileTime; } 25 | INT64 GetFileSize() const { return m_Size; } 26 | INT64 CalculateFolderSize() const; 27 | 28 | void Init(const WCHAR* szName, DWORD attribute, INT64 size, const FILETIME& time); 29 | 30 | bool ReserveContentSize(INT64 nContentSize); 31 | INT64 ContentCapacity(); 32 | 33 | DWORD SetFileData(MCNS::IFileItem* pFileItem); 34 | bool WriteBytes(const BYTE* pData, DWORD dwLen, DWORD* pWritten); 35 | bool ReadBytes(BYTE* pData, DWORD dwLen, DWORD* pWritten); 36 | void Seek(INT64 nSeekPos); 37 | 38 | bool DeleteFileItem(std::shared_ptr& pFile); 39 | // Find Subitems. 40 | size_t SubItems() { return m_Files.size(); } 41 | std::shared_ptr At(size_t idx); 42 | 43 | std::shared_ptr FindByName(const WCHAR* szName); 44 | std::shared_ptr CreateFolderItem(const WCHAR* szName); 45 | std::shared_ptr CreateNewFile(const WCHAR* szName); 46 | bool AddFileItem(std::shared_ptr& pFile); 47 | 48 | DWORD WriteToDisk(const WCHAR* szTargetName); 49 | 50 | protected: 51 | DWORD AddContent(const BYTE* pData, DWORD dwLen); 52 | BYTE* GetBlockData(DWORD& nBlockCapacity); 53 | std::wstring m_Name; 54 | UINT64 m_Attributes; 55 | FILETIME m_FileTime; 56 | 57 | INT64 m_Size; 58 | INT64 m_RWCursor; // next read/write pos - This should not be stored here. Only 1 thread can now read a file. Move to StreamRWFile 59 | 60 | // We do not allocate 1 entire block for the file 61 | // Because for large file the system might not be able to return large blocks. 62 | std::vector< std::unique_ptr > m_vContent; 63 | 64 | // Only valid if m_Attributes & ZFF_FOLDER 65 | std::vector< std::shared_ptr > m_Files; 66 | }; 67 | 68 | class MemoryFileSystem 69 | { 70 | public: 71 | MemoryFileSystem(); 72 | ~MemoryFileSystem(); 73 | 74 | void Clear(); 75 | 76 | std::shared_ptr FindByPath(const WCHAR* szPath, bool bFindParent = false); 77 | std::shared_ptr FindCreateItemByPath(const WCHAR* szPath); // Create item by path 78 | std::shared_ptr FindParentByPath(const WCHAR* szPath); 79 | std::shared_ptr CreateFolderItem(const WCHAR* szPath); 80 | 81 | protected: 82 | std::shared_ptr m_pRoot; 83 | }; 84 | 85 | class MemoryFileEnumerator 86 | { 87 | public: 88 | MemoryFileEnumerator(std::shared_ptr& pParent); 89 | ~MemoryFileEnumerator(); 90 | 91 | void Reset() { m_nNextIdx = 0; } 92 | 93 | std::shared_ptr GetNext(); 94 | std::shared_ptr PeakNext(); // Get Next, But do not advance m_nNextIdx 95 | 96 | std::shared_ptr GetCurrent(); 97 | 98 | protected: 99 | size_t m_nNextIdx; 100 | std::shared_ptr m_pCurrent; 101 | std::shared_ptr m_pParent; 102 | }; 103 | -------------------------------------------------------------------------------- /SDKSamples/MCFSPluginSample/Source/StreamRWFile.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "StreamRWFile.h" 3 | #include "MemoryFileSystem.h" 4 | 5 | using namespace MCNS; 6 | 7 | StreamRWFile::StreamRWFile(std::shared_ptr& pMemFile) 8 | : m_pFile(pMemFile) 9 | { 10 | m_pFile->Seek(0); 11 | } 12 | 13 | StreamRWFile::~StreamRWFile() 14 | { 15 | 16 | } 17 | 18 | BOOL StreamRWFile::WriteFile( LPVOID lpBuffer , DWORD nBytesToWrite , LPDWORD lpBytesWritten ) 19 | { 20 | if(m_pFile->WriteBytes((const BYTE*)lpBuffer, nBytesToWrite, lpBytesWritten)) 21 | return TRUE; 22 | 23 | return FALSE; 24 | } 25 | 26 | BOOL StreamRWFile::WriteFlush() 27 | { 28 | return TRUE; 29 | } 30 | 31 | BOOL StreamRWFile::ReadFile( LPVOID lpBuffer , DWORD nBytesToRead , LPDWORD lpBytesRead ) 32 | { 33 | if(m_pFile->ReadBytes((BYTE*)lpBuffer, nBytesToRead, lpBytesRead)) 34 | return TRUE; 35 | 36 | return FALSE; 37 | } 38 | 39 | DWORD StreamRWFile::GetLastError() 40 | { 41 | return VERROR_NOERROR; 42 | } 43 | DWORD StreamRWFile::GetInternalError() 44 | { 45 | return ERROR_SUCCESS; 46 | } 47 | // Resume a copy of file 48 | DWORD StreamRWFile::Seek( INT64 /*nPos*/ , DWORD /*nMode*/ ) 49 | { 50 | // if(nMode == VSEEK_FILE_END) 51 | // { 52 | // 53 | // } 54 | return FALSE; 55 | } 56 | 57 | INT64 StreamRWFile::GetFileSize() 58 | { 59 | m_pFile->GetFileSize(); 60 | return FALSE; 61 | } 62 | 63 | BOOL StreamRWFile::SetFileTime( FILETIME /*ftCreate*/, FILETIME /*ftAccess*/ , FILETIME ftWrite ) 64 | { 65 | m_pFile->SetFileTime(&ftWrite); 66 | return TRUE; 67 | } 68 | 69 | BOOL StreamRWFile::GetFileTime( FILETIME &ftCreate, FILETIME &ftAccess , FILETIME &ftWrite ) 70 | { 71 | m_pFile->GetFileTime(&ftCreate); 72 | m_pFile->GetFileTime(&ftAccess); 73 | m_pFile->GetFileTime(&ftWrite); 74 | return TRUE; 75 | } 76 | 77 | void StreamRWFile::PostClose() 78 | { 79 | // 80 | // Todo - Remove LOCK. So that file can be opened again. 81 | // 82 | int x = 0; 83 | x++; 84 | } 85 | 86 | ////////////////////////////////////////////////////////////////////////// 87 | void StreamRWFile::PrepareForWriting(UINT64 /*dwAttributes*/, DWORD /*dwRWFlags*/, const FILETIME* /*ftFileTime*/, INT64 nFileSize) 88 | { 89 | // nFileSize is a hit on how much data might be sent. (It might be less, it might be more. it is only a hit ) 90 | m_pFile->ReserveContentSize(nFileSize); 91 | } 92 | -------------------------------------------------------------------------------- /SDKSamples/MCFSPluginSample/Source/StreamRWFile.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class MemoryFile; 6 | 7 | MCNSBEGIN 8 | 9 | class StreamRWFile : public IRWFile 10 | { 11 | public: 12 | StreamRWFile(std::shared_ptr& pMemFile); 13 | ~StreamRWFile(); 14 | 15 | ////////////////////////////////////////////////////////////////////////// 16 | // Overridden from IRWFile 17 | virtual BOOL WriteFile( LPVOID lpBuffer , DWORD nBytesToWrite , LPDWORD lpBytesWritten ) override; 18 | virtual BOOL WriteFlush() override; 19 | virtual BOOL ReadFile( LPVOID lpBuffer , DWORD nBytesToRead , LPDWORD lpBytesRead ) override; 20 | virtual DWORD GetLastError() override; 21 | virtual DWORD GetInternalError() override; 22 | virtual DWORD Seek( INT64 nPos , DWORD nMode ) override; 23 | virtual INT64 GetFileSize() override; 24 | virtual BOOL SetFileTime( FILETIME ftCreate, FILETIME ftAccess , FILETIME ftWrite ) override; 25 | virtual BOOL GetFileTime( FILETIME &ftCreate, FILETIME &ftAccess , FILETIME &ftWrite ) override; 26 | virtual void PostClose() override; 27 | ////////////////////////////////////////////////////////////////////////// 28 | 29 | void PrepareForWriting(UINT64 dwAttributes, DWORD dwRWFlags, const FILETIME* ftFileTime, INT64 nFileSize); 30 | protected: 31 | std::shared_ptr m_pFile; 32 | }; 33 | 34 | MCNSEND -------------------------------------------------------------------------------- /SDKSamples/MCFSPluginSample/Source/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // MCExtensionTemplate.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /SDKSamples/MCFSPluginSample/Source/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #define _CRT_SECURE_NO_DEPRECATE 9 | 10 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | 12 | #include 13 | 14 | 15 | // Windows Header Files: 16 | #include 17 | 18 | #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit 19 | 20 | #include 21 | #include 22 | 23 | // STL 24 | #include 25 | #include 26 | 27 | // Multi Commander SDK 28 | #include "..\..\..\MultiCommander\SDK\FileSystemPlugin.h" // FileSystem Plugin 29 | #include "..\..\..\MultiCommander\SDK\IFileItem.h" 30 | #include "..\..\..\MultiCommander\SDK\IFileSystemManager.h" 31 | #include "..\..\..\MultiCommander\SDK\IAppInterface.h" 32 | #include "..\..\..\MultiCommander\SDK\IVolumeContextMenu.h" 33 | -------------------------------------------------------------------------------- /SDKSamples/MCFSPluginSample/Source/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /SDKSamples/MultiCommander_SDK.txt: -------------------------------------------------------------------------------- 1 | 2 | Multi Commander SDK - BETA v1.72 3 | ================================= 4 | 5 | This SDK require atleast Build 2352 is Multi Commander. 6 | 7 | 8 | To build the sample please read the description first. 9 | 10 | SDKSamples\MCAppExtensionSample\ReadMe.txt 11 | SDKSamples\MCFSPluginSample\FS-Sample-ReadMe.txt 12 | 13 | for help please use the forum 14 | http://forum.multicommander.com/forum/index.php/board,9.0.html 15 | 16 | --------------------------------------------------------------------------------