diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/FirstRun/FirstRun.vcxproj | 10 | ||||
-rw-r--r-- | plugins/FirstRun/FirstRun.vcxproj.filters | 2 | ||||
-rw-r--r-- | plugins/FirstRun/main.cpp | 25 |
3 files changed, 19 insertions, 18 deletions
diff --git a/plugins/FirstRun/FirstRun.vcxproj b/plugins/FirstRun/FirstRun.vcxproj index 6a1125aa3f..b857876399 100644 --- a/plugins/FirstRun/FirstRun.vcxproj +++ b/plugins/FirstRun/FirstRun.vcxproj @@ -24,20 +24,20 @@ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
@@ -143,7 +143,7 @@ </Link>
</ItemDefinitionGroup>
<ItemGroup>
- <ClCompile Include="main.c" />
+ <ClCompile Include="main.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="commonheaders.h" />
diff --git a/plugins/FirstRun/FirstRun.vcxproj.filters b/plugins/FirstRun/FirstRun.vcxproj.filters index b23033a382..782e0f59ee 100644 --- a/plugins/FirstRun/FirstRun.vcxproj.filters +++ b/plugins/FirstRun/FirstRun.vcxproj.filters @@ -15,7 +15,7 @@ </Filter>
</ItemGroup>
<ItemGroup>
- <ClCompile Include="main.c">
+ <ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
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;
|