diff options
Diffstat (limited to 'plugins/ShellExt/src')
| -rw-r--r-- | plugins/ShellExt/src/ShellExt.def | 7 | ||||
| -rw-r--r-- | plugins/ShellExt/src/Version.h | 3 | ||||
| -rw-r--r-- | plugins/ShellExt/src/main.cpp | 7 | ||||
| -rw-r--r-- | plugins/ShellExt/src/options.cpp | 2 | ||||
| -rw-r--r-- | plugins/ShellExt/src/shlcom.cpp | 7 | 
5 files changed, 16 insertions, 10 deletions
diff --git a/plugins/ShellExt/src/ShellExt.def b/plugins/ShellExt/src/ShellExt.def new file mode 100644 index 0000000000..e867b9b540 --- /dev/null +++ b/plugins/ShellExt/src/ShellExt.def @@ -0,0 +1,7 @@ +LIBRARY ShlExt
 +
 +EXPORTS
 +DllCanUnloadNow PRIVATE
 +DllGetClassObject PRIVATE
 +DllRegisterServer PRIVATE
 +DllUnregisterServer PRIVATE
 diff --git a/plugins/ShellExt/src/Version.h b/plugins/ShellExt/src/Version.h index 89aa117923..c2f1323bba 100644 --- a/plugins/ShellExt/src/Version.h +++ b/plugins/ShellExt/src/Version.h @@ -6,9 +6,6 @@  #define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
  #define __FILEVERSION_STRING_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM
 -#define __STRINGIFY(x)				#x
 -#define __VERSION_STRING			__STRINGIFY(__FILEVERSION_STRING_DOTS)
 -
  #define __PLUGIN_NAME        "ShlExt"
  #define __FILENAME           "ShlExt.dll"
  #define __DESCRIPTION        "Windows Explorer extension for Miranda NG."
 diff --git a/plugins/ShellExt/src/main.cpp b/plugins/ShellExt/src/main.cpp index 1791fc99f8..2dea9412ed 100644 --- a/plugins/ShellExt/src/main.cpp +++ b/plugins/ShellExt/src/main.cpp @@ -48,15 +48,16 @@ private:  	HKEY m_key;
  };
 -char str1[] = "shlext " __VERSION_STRING " - shell context menu support for Miranda NG";
 +char str1[100];
  char str2[] = "{72013A26-A94C-11d6-8540-A5E62932711D}";
  char str3[] = "miranda.shlext";
  char str4[] = "Apartment";
  TCHAR key1[] = _T("miranda.shlext\\{72013A26-A94C-11d6-8540-A5E62932711D}\\InprocServer32");
 -HRESULT __stdcall DllRegisterServer()
 +STDAPI DllRegisterServer()
  {
 +	sprintf_s(str1, sizeof(str1), "shlext %d.%d.%d.%d - shell context menu support for Miranda NG", __FILEVERSION_STRING);
  	if ( RegSetValueA(HKEY_CLASSES_ROOT, "miranda.shlext", REG_SZ, str1, sizeof(str1)))
  		return E_FAIL;
  	if ( RegSetValueA(HKEY_CLASSES_ROOT, "miranda.shlext\\CLSID", REG_SZ, str2, sizeof(str2)))
 @@ -91,7 +92,7 @@ HRESULT __stdcall DllRegisterServer()  	return S_OK;
  }
 -HRESULT __stdcall DllUnregisterServer()
 +STDAPI DllUnregisterServer()
  {
  	return RemoveCOMRegistryEntries();
  }
 diff --git a/plugins/ShellExt/src/options.cpp b/plugins/ShellExt/src/options.cpp index 05f71ab039..1e92422fcb 100644 --- a/plugins/ShellExt/src/options.cpp +++ b/plugins/ShellExt/src/options.cpp @@ -25,7 +25,7 @@ static TCHAR* COM_OKSTR[2] = {  	LPGENT("Successfully created shell registration.") };
  static TCHAR* COM_APPROVEDSTR[2] = { LPGENT("Not Approved"), LPGENT("Approved") };
 -static LRESULT CALLBACK OptDialogProc(HWND hwndDlg, UINT wMsg, WPARAM wParam, LPARAM lParam)
 +static INT_PTR CALLBACK OptDialogProc(HWND hwndDlg, UINT wMsg, WPARAM wParam, LPARAM lParam)
  {
  	int comReg, iCheck;
  	TCHAR szBuf[MAX_PATH];
 diff --git a/plugins/ShellExt/src/shlcom.cpp b/plugins/ShellExt/src/shlcom.cpp index fbbf299894..11c6616116 100644 --- a/plugins/ShellExt/src/shlcom.cpp +++ b/plugins/ShellExt/src/shlcom.cpp @@ -1508,11 +1508,12 @@ void InvokeThreadServer()  const IID CLSID_ISHLCOM = { 0x72013A26, 0xA94C, 0x11d6, {0x85, 0x40, 0xA5, 0xE6, 0x29, 0x32, 0x71, 0x1D }};
 -HRESULT DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
 +STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  {
 +	MessageBoxA(0, "Ding!", "Dong", MB_OK);
 +
  	if (rclsid == CLSID_ISHLCOM && riid == IID_IClassFactory && FindWindowA(MIRANDANAME, NULL) != 0) {
  		*ppv = new TClassFactoryRec();
 -		MessageBoxA(0, "Ding!", "Dong", MB_OK);
  		return S_OK;
  	}
 @@ -1520,7 +1521,7 @@ HRESULT DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)  	return CLASS_E_CLASSNOTAVAILABLE;
  }
 -HRESULT DllCanUnloadNow()
 +STDAPI DllCanUnloadNow()
  {
  	if (dllobject.FactoryCount == 0 && dllobject.ObjectCount == 0)
  		return S_OK;
  | 
