summaryrefslogtreecommitdiff
path: root/plugins/Restart
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-12-02 18:19:49 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-12-02 18:19:49 +0000
commitc4582dd65b444e5dae29ada7cc3f6c9a9c20edf3 (patch)
tree17a8627550b202d62df8e1df76d2585d3d0cdeaa /plugins/Restart
parent5ea5feb7e052ca45af7bc9ed76e4a252bd71950d (diff)
new easy standard way of registering icons: Icon_Register
git-svn-id: http://svn.miranda-ng.org/main/trunk@2601 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Restart')
-rw-r--r--plugins/Restart/src/restart.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/plugins/Restart/src/restart.cpp b/plugins/Restart/src/restart.cpp
index c4215794a2..ef3dfd383c 100644
--- a/plugins/Restart/src/restart.cpp
+++ b/plugins/Restart/src/restart.cpp
@@ -12,7 +12,7 @@
HINSTANCE hInst;
int hLangpack;
-HANDLE hIconHandle, hRestartMe;
+HANDLE hRestartMe;
PLUGININFOEX pluginInfo={
sizeof(PLUGININFOEX),
@@ -53,28 +53,21 @@ static INT_PTR RestartMe(WPARAM wParam, LPARAM lParam)
return 0;
}
+static IconItem icon = { LPGEN("Restart"), "rst_restart_icon", IDI_RESTARTICON };
+
extern "C" __declspec(dllexport) int Load(void)
{
mir_getLP( &pluginInfo );
- TCHAR szFile[MAX_PATH];
- GetModuleFileName(hInst, szFile, MAX_PATH);
-
// IcoLib support
- SKINICONDESC sid = { sizeof(sid) };
- sid.ptszDefaultFile = szFile;
- sid.flags = SIDF_ALL_TCHAR;
- sid.ptszSection = _T("Restart Plugin");
- sid.ptszDescription = _T("Restart");
- sid.pszName = "rst_restart_icon";
- sid.iDefaultIndex = -IDI_RESTARTICON;
- hIconHandle = Skin_AddIcon(&sid);
+ Icon_Register(hInst, "Restart Plugin", &icon, 1);
hRestartMe = CreateServiceFunction("System/RestartMe", RestartMe);
+
CLISTMENUITEM mi = { sizeof(mi) };
mi.position = -0x7FFFFFFF;
mi.flags = CMIF_ICONFROMICOLIB | CMIF_TCHAR;
- mi.icolibItem = hIconHandle;
+ mi.icolibItem = icon.hIcolib;
mi.ptszName = _T("Restart");
mi.pszService = "System/RestartMe";
Menu_AddMainMenuItem(&mi);