diff options
Diffstat (limited to 'plugins/IEView/src/ieview_main.cpp')
-rw-r--r-- | plugins/IEView/src/ieview_main.cpp | 50 |
1 files changed, 13 insertions, 37 deletions
diff --git a/plugins/IEView/src/ieview_main.cpp b/plugins/IEView/src/ieview_main.cpp index ebebe01351..20446ab8f4 100644 --- a/plugins/IEView/src/ieview_main.cpp +++ b/plugins/IEView/src/ieview_main.cpp @@ -20,12 +20,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "ieview_common.h"
-char *ieviewModuleName;
HINSTANCE hInstance;
char *workingDirUtf8;
-static int ModulesLoaded(WPARAM wParam, LPARAM lParam);
-static int PreShutdown(WPARAM wParam, LPARAM lParam);
int hLangpack;
PLUGININFOEX pluginInfoEx = {
@@ -42,7 +39,7 @@ PLUGININFOEX pluginInfoEx = { {0x0495171b, 0x7137, 0x4ded, {0x97, 0xf8, 0xce, 0x6f, 0xed, 0x67, 0xd6, 0x91}}
};
-extern "C" BOOL WINAPI DllMain(HINSTANCE hModule, DWORD dwReason, LPVOID lpvReserved)
+BOOL WINAPI DllMain(HINSTANCE hModule, DWORD dwReason, LPVOID lpvReserved)
{
hInstance = hModule;
return TRUE;
@@ -53,11 +50,15 @@ extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD miranda return &pluginInfoEx;
}
-extern "C" int __declspec(dllexport) Load(void)
+static int ModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- char text[_MAX_PATH];
- char *p, *q;
+ IEView::init();
+ Options::init();
+ return 0;
+}
+extern "C" int __declspec(dllexport) Load(void)
+{
int wdsize = GetCurrentDirectory(0, NULL);
TCHAR *workingDir = new TCHAR[wdsize];
GetCurrentDirectory(wdsize, workingDir);
@@ -65,48 +66,23 @@ extern "C" int __declspec(dllexport) Load(void) workingDirUtf8 = mir_utf8encodeT(workingDir);
delete workingDir;
- GetModuleFileNameA(hInstance, text, sizeof(text));
- p = strrchr(text, '\\');
- p++;
- q = strrchr(p, '.');
- *q = '\0';
- ieviewModuleName = _strdup(p);
- _strupr(ieviewModuleName);
-
-
mir_getLP(&pluginInfoEx);
- Utils::hookEvent_Ex(ME_OPT_INITIALISE, IEViewOptInit);
- Utils::hookEvent_Ex(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
- Utils::hookEvent_Ex(ME_SYSTEM_PRESHUTDOWN, PreShutdown);
+ HookEvent(ME_OPT_INITIALISE, IEViewOptInit);
+ HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
- Utils::createServiceFunction_Ex(MS_IEVIEW_WINDOW, HandleIEWindow);
- Utils::createServiceFunction_Ex(MS_IEVIEW_EVENT, HandleIEEvent);
- Utils::createServiceFunction_Ex(MS_IEVIEW_NAVIGATE, HandleIENavigate);
+ CreateServiceFunction(MS_IEVIEW_WINDOW, HandleIEWindow);
+ CreateServiceFunction(MS_IEVIEW_EVENT, HandleIEEvent);
+ CreateServiceFunction(MS_IEVIEW_NAVIGATE, HandleIENavigate);
hHookOptionsChanged = CreateHookableEvent(ME_IEVIEW_OPTIONSCHANGED);
return 0;
}
-static int ModulesLoaded(WPARAM wParam, LPARAM lParam)
-{
- IEView::init();
- Options::init();
- return 0;
-}
-
-static int PreShutdown(WPARAM wParam, LPARAM lParam)
-{
- return 0;
-}
-
extern "C" int __declspec(dllexport) Unload(void)
{
Options::uninit();
- Utils::unhookEvents_Ex();
- Utils::destroyServices_Ex();
DestroyHookableEvent(hHookOptionsChanged);
IEView::release();
mir_free(workingDirUtf8);
- free( ieviewModuleName );
return 0;
}
|