diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-09-12 19:01:52 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-09-12 19:01:52 +0000 |
commit | d87d3f97d87ab2c621fe304844fbc046e806428c (patch) | |
tree | 8318f8c84f5803590224f2a3430b45706245e8d4 /plugins/!NotAdopted/NoHistory/icons.cpp | |
parent | 59a1ec84b0e17a79815bfcb95ab20bfbc7b2dcec (diff) |
Nohistory addede, not adapted yet
git-svn-id: http://svn.miranda-ng.org/main/trunk@1568 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/!NotAdopted/NoHistory/icons.cpp')
-rw-r--r-- | plugins/!NotAdopted/NoHistory/icons.cpp | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/plugins/!NotAdopted/NoHistory/icons.cpp b/plugins/!NotAdopted/NoHistory/icons.cpp new file mode 100644 index 0000000000..741ad3727e --- /dev/null +++ b/plugins/!NotAdopted/NoHistory/icons.cpp @@ -0,0 +1,55 @@ +#include "common.h"
+#include "icons.h"
+#include "resource.h"
+
+HICON hIconRemove, hIconKeep, hIconClear;
+HANDLE hIcoLibIconsChanged = 0;
+
+int ReloadIcons(WPARAM wParam, LPARAM lParam) {
+ hIconRemove = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)MODULE "_remove");
+ hIconKeep = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)MODULE "_keep");
+ hIconClear = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)MODULE "_clear");
+
+ return 0;
+}
+
+void InitIcons() {
+ if(ServiceExists(MS_SKIN2_ADDICON)) {
+ SKINICONDESC sid = {0};
+ sid.cbSize = sizeof(SKINICONDESC);
+
+ sid.pszSection = MODULE;
+
+#define AddIcon(x,y,z) \
+ sid.pszDescription = Translate(x); \
+ sid.pszName = y; \
+ sid.pszDefaultFile = MODULE ".dll"; \
+ sid.hDefaultIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(z), IMAGE_ICON, 0, 0, 0); \
+ CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); \
+ sid.iDefaultIndex++;
+
+ AddIcon("Disable", MODULE "_remove", IDI_HREMOVE);
+ AddIcon("Enable", MODULE "_keep", IDI_HKEEP);
+ AddIcon("Clear", MODULE "_clear", IDI_HCLEAR);
+
+#undef AddIcon
+
+ ReloadIcons(0, 0);
+
+ hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, ReloadIcons);
+ } else {
+ hIconRemove = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_HREMOVE), IMAGE_ICON, 0, 0, 0);//LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS );
+ hIconKeep = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_HKEEP), IMAGE_ICON, 0, 0, 0);//LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS );
+ hIconClear = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_HCLEAR), IMAGE_ICON, 0, 0, 0);//LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS );
+ }
+
+}
+
+void DeinitIcons() {
+ if(hIcoLibIconsChanged) UnhookEvent(hIcoLibIconsChanged);
+ else {
+ DestroyIcon(hIconRemove);
+ DestroyIcon(hIconKeep);
+ DestroyIcon(hIconClear);
+ }
+}
|