summaryrefslogtreecommitdiff
path: root/plugins/FirstRun/main.cpp
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2012-06-23 12:40:39 +0000
committerKirill Volinsky <mataes2007@gmail.com>2012-06-23 12:40:39 +0000
commitbe9081b621b26a244a54fd79325d0a64626c05fb (patch)
tree4a83e5da51fcbc1bec27c4239a5e816d5bd86acc /plugins/FirstRun/main.cpp
parentf6508c1a7ebc417aed838ce0d056c3c8c40f4376 (diff)
FirstRun:
plusified git-svn-id: http://svn.miranda-ng.org/main/trunk@546 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
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;