summaryrefslogtreecommitdiff
path: root/plugins/FirstRun/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/FirstRun/main.cpp')
-rw-r--r--plugins/FirstRun/main.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/plugins/FirstRun/main.cpp b/plugins/FirstRun/main.cpp
index 206d2cd518..7799a9c474 100644
--- a/plugins/FirstRun/main.cpp
+++ b/plugins/FirstRun/main.cpp
@@ -4,17 +4,18 @@ HINSTANCE hInst;
PLUGINLINK *pluginLink;
HANDLE hModulesLoaded;
int hLangpack;
+struct MM_INTERFACE mmi;
PLUGININFOEX pluginInfo={
sizeof(PLUGININFOEX),
"First Run Plugin",
PLUGIN_MAKE_VERSION(0,0,0,2),
- "Displays the Accounts window at the first start",
+ "Displays the Accounts window at the first start.",
"Yasnovidyashii",
"yasnovidyashii@gmail.com",
"© 2008 Mikhail Yuriev",
"http://miranda-im.org/",
- 0, //not transient
+ UNICODE_AWARE, //not transient
0, //doesn't replace anything built-in
// Generate your own unique id for your plugin.
// Do not use this UUID!
@@ -24,17 +25,18 @@ PLUGININFOEX pluginInfo={
int ModulesLoaded(WPARAM wParam,LPARAM lParam)
{
- char* ptszDllName;
- char ptszDllPath[MAX_PATH];
+ TCHAR* ptszDllName;
+ TCHAR ptszDllPath[MAX_PATH];
GetModuleFileName(hInst, ptszDllPath, MAX_PATH);
- ptszDllName = _strlwr(strrchr(ptszDllPath, '\\'));
+ ptszDllName = _tcslwr(_tcsrchr(ptszDllPath, '\\'));
if (ptszDllName!=NULL)
ptszDllName=ptszDllName + 1;
- CallService(MS_PROTO_SHOWACCMGR, (WPARAM) NULL, (LPARAM)NULL);
- DBWriteContactSettingByte(NULL,"PluginDisable",ptszDllName,1);
+ CallService(MS_PROTO_SHOWACCMGR, (WPARAM) NULL, (LPARAM)NULL);
+
+ DBWriteContactSettingByte(NULL, "PluginDisable", _T2A(ptszDllName), 1);
return 0;
}
@@ -45,22 +47,21 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
return TRUE;
}
-
-__declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
{
return &pluginInfo;
}
-
-int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
{
pluginLink=link;
mir_getLP(&pluginInfo);
+ mir_getMMI(&mmi);
hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED,ModulesLoaded);
return 0;
}
-int __declspec(dllexport) Unload(void)
+extern "C" __declspec(dllexport) int Unload(void)
{
UnhookEvent(hModulesLoaded);
return 0;