Skip to content

Commit

Permalink
Uploading project code
Browse files Browse the repository at this point in the history
  • Loading branch information
menees committed Mar 28, 2020
0 parents commit 269817d
Show file tree
Hide file tree
Showing 33 changed files with 2,404 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.url
CopyLocation.dll
CopyLocation-Bill-*.zip
6 changes: 6 additions & 0 deletions Bill's Rebuild/Bill's Readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
I rebuilt this in VS2005 to get a version for x64.

I changed the source to turn off the bitmaps on the menu items.

http://www.codeproject.com/shell/copylocation.asp
http://grebulon.com/software/
21 changes: 21 additions & 0 deletions Bill's Rebuild/Bill's Rebuild Differences.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
CopyLocation.cpp
Line 73: Use SetStringValue instead of SetValue and swap the parameter order:
New: lRet = reg.SetStringValue(_T("{A7847D3E-09F3-11D4-8F6D-0080AD87DD41}"), _T("CopyLocationShl extension") );

CopyLocation.def
Remove @n on each line.

CopyLocationShl.cpp
Line 13: Comment out m_hCopyBmp assignment.
Line 106: Change GetCommandString�s first parameter (idCmd) from UINT to UINT_PTR.
Line 197: Change size variable to SIZE_T instead of long.
Line 221: Change pos variable to SIZE_T instead of long.

CopyLocationShl.h
Line 39: Change GetCommandString�s first parameter (idCmd) from UINT to UINT_PTR.

StdAfx.cpp
Remove #include <statreg.cpp> and #include <atlimpl.cpp>.

StdAfx.h
Add #include <shlguid.h>
109 changes: 109 additions & 0 deletions Bill's Rebuild/Source/CopyLocation.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
// CopyLocation.cpp : Implementation of DLL Exports.


// Note: Proxy/Stub Information
// To build a separate proxy/stub DLL,
// run nmake -f CopyLocationps.mk in the project directory.

#include "stdafx.h"
#include "resource.h"
#include <initguid.h>
#include "CopyLocation.h"

#include "CopyLocation_i.c"
#include "CopyLocationShl.h"


CComModule _Module;

BEGIN_OBJECT_MAP(ObjectMap)
OBJECT_ENTRY(CLSID_CopyLocationShl, CCopyLocationShl)
END_OBJECT_MAP()

/////////////////////////////////////////////////////////////////////////////
// DLL Entry Point

extern "C"
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
_Module.Init(ObjectMap, hInstance, &LIBID_COPYLOCATIONLib);
DisableThreadLibraryCalls(hInstance);
}
else if (dwReason == DLL_PROCESS_DETACH)
_Module.Term();
return TRUE; // ok
}

/////////////////////////////////////////////////////////////////////////////
// Used to determine whether the DLL can be unloaded by OLE

STDAPI DllCanUnloadNow(void)
{
return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
}

/////////////////////////////////////////////////////////////////////////////
// Returns a class factory to create an object of the requested type

STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
{
return _Module.GetClassObject(rclsid, riid, ppv);
}

/////////////////////////////////////////////////////////////////////////////
// DllRegisterServer - Adds entries to the system registry

STDAPI DllRegisterServer(void)
{
// If we're on NT, add ourselves to the list of approved shell extensions
if (0 == (GetVersion() & 0x80000000UL))
{
CRegKey reg;
LONG lRet;

lRet = reg.Open(HKEY_LOCAL_MACHINE,
_T("Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"),
KEY_SET_VALUE);

if (ERROR_SUCCESS != lRet)
return E_ACCESSDENIED;

lRet = reg.SetStringValue(_T("{A7847D3E-09F3-11D4-8F6D-0080AD87DD41}"), _T("CopyLocationShl extension") );

if (ERROR_SUCCESS != lRet)
return E_ACCESSDENIED;
}

// registers object, typelib and all interfaces in typelib
return _Module.RegisterServer(TRUE);
}

/////////////////////////////////////////////////////////////////////////////
// DllUnregisterServer - Removes entries from the system registry

STDAPI DllUnregisterServer(void)
{
// If we're on NT, remove ourselves from the list of approved shell extensions.
// Note that if we get an error along the way, I don't bail out since I want
// to do the normal ATL unregistration stuff too.
if (0 == (GetVersion() & 0x80000000UL))
{
CRegKey reg;
LONG lRet;

lRet = reg.Open(HKEY_LOCAL_MACHINE,
_T("Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"),
KEY_SET_VALUE);

if (ERROR_SUCCESS == lRet)
{
lRet = reg.DeleteValue(_T("CopyLocationShl extension"));
}
}

return _Module.UnregisterServer(TRUE);
}


9 changes: 9 additions & 0 deletions Bill's Rebuild/Source/CopyLocation.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
; CopyLocation.def : Declares the module parameters.

LIBRARY "CopyLocation.DLL"

EXPORTS
DllCanUnloadNow PRIVATE
DllGetClassObject PRIVATE
DllRegisterServer PRIVATE
DllUnregisterServer PRIVATE
Loading

0 comments on commit 269817d

Please sign in to comment.