-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Switch to using explorer command verbs for adding to the context menu. - Fix issue with packing to a glb from a special folder (e.g., Downloads) where it would open the destination folder in a new explorer window. - Add a Windows Application Packaging Project to enable submission to the Windows Store. - Add icons to context menu items.
- Loading branch information
Showing
71 changed files
with
1,585 additions
and
847 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
.vs | ||
bin | ||
obj | ||
*.user | ||
/Source/packages | ||
/Source/Setup/Debug | ||
/Source/Setup/Release | ||
.vs | ||
Build | ||
*.aps | ||
*.user |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<BuildDir>$([MSBuild]::NormalizeDirectory($(MSBuildThisFileDirectory)..))Build\$(MSBuildProjectName)\</BuildDir> | ||
|
||
<BaseIntermediateOutputPath>$(BuildDir)obj\</BaseIntermediateOutputPath> | ||
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\$(Platform)\</IntermediateOutputPath> | ||
<OutputPath>$(BuildDir)bin\$(Configuration)\$(Platform)\</OutputPath> | ||
|
||
<IntDir>$(IntermediateOutputPath)</IntDir> | ||
<OutDir>$(OutputPath)</OutDir> | ||
|
||
<PlatformSpecificBundleArtifactsListDir>$(BuildDir)BundleArtifacts\</PlatformSpecificBundleArtifactsListDir> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
#pragma once | ||
|
||
#include <Windows.h> | ||
#include <new> | ||
|
||
template <typename T> | ||
class ClassFactory : public IClassFactory | ||
{ | ||
public: | ||
static HRESULT CreateInstance(REFIID riid, void** ppv) | ||
{ | ||
*ppv = nullptr; | ||
|
||
ClassFactory* pClassFactory = new(std::nothrow) ClassFactory(); | ||
if (pClassFactory == nullptr) | ||
{ | ||
return E_OUTOFMEMORY; | ||
} | ||
|
||
HRESULT hr = pClassFactory->QueryInterface(riid, ppv); | ||
pClassFactory->Release(); | ||
return hr; | ||
} | ||
|
||
ClassFactory() | ||
{ | ||
DllAddRef(); | ||
} | ||
|
||
// IUnknown | ||
|
||
IFACEMETHODIMP QueryInterface(REFIID riid, void** ppv) | ||
{ | ||
IUnknown* punk = nullptr; | ||
|
||
if (riid == __uuidof(IUnknown) || riid == __uuidof(IClassFactory)) | ||
{ | ||
punk = static_cast<IClassFactory*>(this); | ||
} | ||
|
||
*ppv = punk; | ||
|
||
if (punk == nullptr) | ||
{ | ||
return E_NOINTERFACE; | ||
} | ||
|
||
punk->AddRef(); | ||
return S_OK; | ||
} | ||
|
||
IFACEMETHODIMP_(ULONG) AddRef() | ||
{ | ||
return InterlockedIncrement(&m_ref); | ||
} | ||
|
||
IFACEMETHODIMP_(ULONG) Release() | ||
{ | ||
LONG cRef = InterlockedDecrement(&m_ref); | ||
if (cRef == 0) | ||
{ | ||
delete this; | ||
} | ||
return cRef; | ||
} | ||
|
||
// IClassFactory | ||
|
||
IFACEMETHODIMP CreateInstance(IUnknown* punkOuter, REFIID riid, void** ppv) | ||
{ | ||
if (punkOuter != nullptr) | ||
{ | ||
return CLASS_E_NOAGGREGATION; | ||
} | ||
|
||
return T::CreateInstance(riid, ppv); | ||
} | ||
|
||
IFACEMETHODIMP LockServer(BOOL fLock) | ||
{ | ||
if (fLock) | ||
{ | ||
DllAddRef(); | ||
} | ||
else | ||
{ | ||
DllRelease(); | ||
} | ||
|
||
return S_OK; | ||
} | ||
|
||
private: | ||
~ClassFactory() | ||
{ | ||
DllRelease(); | ||
} | ||
|
||
LONG m_ref{1}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#include "Dll.h" | ||
#include "ClassFactory.h" | ||
#include "ExplorerCommand.h" | ||
|
||
namespace | ||
{ | ||
long g_refModule = 0; | ||
} | ||
|
||
void DllAddRef() | ||
{ | ||
InterlockedIncrement(&g_refModule); | ||
} | ||
|
||
void DllRelease() | ||
{ | ||
InterlockedDecrement(&g_refModule); | ||
} | ||
|
||
STDAPI_(BOOL) DllMain(HINSTANCE hInstance, DWORD dwReason, void*) | ||
{ | ||
if (dwReason == DLL_PROCESS_ATTACH) | ||
{ | ||
DisableThreadLibraryCalls(hInstance); | ||
} | ||
|
||
return TRUE; | ||
} | ||
|
||
STDAPI DllCanUnloadNow() | ||
{ | ||
// Only allow the DLL to be unloaded after all outstanding references have been released | ||
return (g_refModule == 0) ? S_OK : S_FALSE; | ||
} | ||
|
||
STDAPI DllGetClassObject(REFCLSID clsid, REFIID riid, void **ppv) | ||
{ | ||
if (clsid == __uuidof(ExplorerCommand)) | ||
{ | ||
return ClassFactory<ExplorerCommand>::CreateInstance(riid, ppv); | ||
} | ||
|
||
return CLASS_E_CLASSNOTAVAILABLE; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
EXPORTS | ||
DllCanUnloadNow PRIVATE | ||
DllGetClassObject PRIVATE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#pragma once | ||
|
||
#include <Windows.h> | ||
|
||
void DllAddRef(); | ||
void DllRelease(); |
Oops, something went wrong.