diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2012-06-23 14:35:02 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2012-06-23 14:35:02 +0000 |
commit | ffb0a9bc75d718891881f884302e2780495d4545 (patch) | |
tree | 130c0730c3d5e7581ebaeeaed1a9dc961132bf9e /plugins/ProfileManager | |
parent | 5ab173a0cbc02e0a35c33f33c4ff9dd8a1754bb9 (diff) |
ProfileManager:
plusified
git-svn-id: http://svn.miranda-ng.org/main/trunk@560 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/ProfileManager')
-rw-r--r-- | plugins/ProfileManager/pmanagerEx.cpp | 77 | ||||
-rw-r--r-- | plugins/ProfileManager/pmanagerEx.vcxproj | 4 | ||||
-rw-r--r-- | plugins/ProfileManager/pmanagerEx.vcxproj.filters | 2 |
3 files changed, 37 insertions, 46 deletions
diff --git a/plugins/ProfileManager/pmanagerEx.cpp b/plugins/ProfileManager/pmanagerEx.cpp index 6556478e25..65b6b055cd 100644 --- a/plugins/ProfileManager/pmanagerEx.cpp +++ b/plugins/ProfileManager/pmanagerEx.cpp @@ -25,6 +25,7 @@ TCHAR fn[MAX_PATH]; TCHAR lmn[MAX_PATH];
TCHAR* pathn;
int hLangpack;
+HANDLE hLoadPM, hChangePM;
PLUGININFOEX pluginInfo={
sizeof(PLUGININFOEX),
@@ -35,7 +36,7 @@ PLUGININFOEX pluginInfo={ "woobind@ukr.net",
"© 2008 - 2010 Roman Gemini",
"http://code.google.com/p/alfamar/",
- 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!
@@ -44,77 +45,67 @@ PLUGININFOEX pluginInfo={ };
-__declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
{
return &pluginInfo;
}
-///////////////////////////////////////////////////////////////////////////////
-
-BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
- hInst=hinstDLL;
+ hInst = hinstDLL;
return TRUE;
}
-///////////////////////////////////////////////////////////////////////////////
-
-static const MUUID interfaces[] = {MIID_TESTPLUGIN, MIID_LAST};
-__declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
-static INT_PTR ChangePM(WPARAM wParam,LPARAM lParam)
+static INT_PTR ChangePM(WPARAM wParam, LPARAM lParam)
{
GetModuleFileName(GetModuleHandle(NULL), fn, SIZEOF(fn));
- ShellExecute(0, "open", fn, "/FORCESHOW", "", 1);
+ ShellExecute(0, _T("open"), fn, _T("/FORCESHOW"), _T(""), 1);
CallService("CloseAction", 0, 0);
return 0;
}
-static INT_PTR LoadPM(WPARAM wParam,LPARAM lParam)
+static INT_PTR LoadPM(WPARAM wParam, LPARAM lParam)
{
GetModuleFileName(GetModuleHandle(NULL), fn, SIZEOF(fn));
- ShellExecute(0, "open", fn, "/FORCESHOW", "", 1);
+ ShellExecute(0, _T("open"), fn, _T("/FORCESHOW"), _T(""), 1);
return 0;
}
-int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
{
CLISTMENUITEM mi;
- pluginLink=link;
+ pluginLink = link;
mir_getLP(&pluginInfo);
- CreateServiceFunction("Database/LoadPM",LoadPM);
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=-500200000;
- mi.flags=0;
- mi.hIcon=LoadIcon(hInst, MAKEINTRESOURCE(IDI_LoadPM));
- mi.pszPopupName = "Database";
- mi.pszName=LPGEN("Load profile");
- mi.pszService="Database/LoadPM";
+ hLoadPM = CreateServiceFunction("Database/LoadPM", LoadPM);
+ ZeroMemory(&mi, sizeof(mi));
+ mi.cbSize = sizeof(mi);
+ mi.position = -500200000;
+ mi.flags = CMIF_TCHAR;
+ mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_LoadPM));
+ mi.ptszPopupName = _T("Database");
+ mi.ptszName = _T("Load profile");
+ mi.pszService = "Database/LoadPM";
Menu_AddMainMenuItem(&mi);
- CreateServiceFunction("Database/ChangePM",ChangePM);
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=-500200000;
- mi.flags=0;
- mi.hIcon=LoadIcon(hInst, MAKEINTRESOURCE(IDI_ChangePM));
- mi.pszPopupName = "Database";
- mi.pszName=LPGEN("Change profile");
- mi.pszService="Database/ChangePM";
+ hChangePM = CreateServiceFunction("Database/ChangePM", ChangePM);
+ ZeroMemory(&mi, sizeof(mi));
+ mi.cbSize = sizeof(mi);
+ mi.position = -500200000;
+ mi.flags = CMIF_TCHAR;
+ mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ChangePM));
+ mi.ptszPopupName = _T("Database");
+ mi.ptszName = _T("Change profile");
+ mi.pszService = "Database/ChangePM";
Menu_AddMainMenuItem(&mi);
+
return 0;
}
-///////////////////////////////////////////////////////////////////////////////
-
-int __declspec(dllexport) Unload(void)
+extern "C" __declspec(dllexport) int Unload(void)
{
+ DestroyServiceFunction(hLoadPM);
+ DestroyServiceFunction(hChangePM);
+
return 0;
}
\ No newline at end of file diff --git a/plugins/ProfileManager/pmanagerEx.vcxproj b/plugins/ProfileManager/pmanagerEx.vcxproj index 888711ed95..ae9fcc41d4 100644 --- a/plugins/ProfileManager/pmanagerEx.vcxproj +++ b/plugins/ProfileManager/pmanagerEx.vcxproj @@ -25,7 +25,7 @@ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<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">
@@ -162,7 +162,7 @@ </Link>
</ItemDefinitionGroup>
<ItemGroup>
- <ClCompile Include="pmanagerEx.c" />
+ <ClCompile Include="pmanagerEx.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="resource.h" />
diff --git a/plugins/ProfileManager/pmanagerEx.vcxproj.filters b/plugins/ProfileManager/pmanagerEx.vcxproj.filters index 29f1ce96f9..91e07c558e 100644 --- a/plugins/ProfileManager/pmanagerEx.vcxproj.filters +++ b/plugins/ProfileManager/pmanagerEx.vcxproj.filters @@ -15,7 +15,7 @@ </Filter>
</ItemGroup>
<ItemGroup>
- <ClCompile Include="pmanagerEx.c">
+ <ClCompile Include="pmanagerEx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
|