diff options
author | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2006-11-01 14:48:34 +0000 |
---|---|---|
committer | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2006-11-01 14:48:34 +0000 |
commit | d123e0ce94bf90b2adb0a4000930eb467e293226 (patch) | |
tree | d414dea59908105c4d2f256199a610e0a69c8690 /updater/icons.cpp | |
parent | a13e82647294da4add976a24335fec50d7bfe905 (diff) |
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@16 4f64403b-2f21-0410-a795-97e2b3489a10
Diffstat (limited to 'updater/icons.cpp')
-rw-r--r-- | updater/icons.cpp | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/updater/icons.cpp b/updater/icons.cpp new file mode 100644 index 0000000..345e948 --- /dev/null +++ b/updater/icons.cpp @@ -0,0 +1,61 @@ +#include "common.h"
+#include "icons.h"
+
+HICON hIconCheck, hIconRestart, hIconCheckExit;
+HANDLE hIcoLibIconsChanged = 0;
+
+int ReloadIcons(WPARAM wParam, LPARAM lParam) {
+ hIconCheck = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"updater_check");
+ hIconRestart = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"updater_restart");
+ hIconCheckExit = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"updater_checkexit");
+
+ return 0;
+}
+
+void InitIcons() {
+ if(ServiceExists(MS_SKIN2_ADDICON)) {
+ SKINICONDESC2 sid;
+
+ sid.cbSize = sizeof(SKINICONDESC2);
+ sid.pszSection = "Updater";
+
+ sid.pszDescription = Translate("Check for Updates");
+ sid.pszName = "updater_check";
+ sid.pszDefaultFile = "updater.dll";
+ sid.iDefaultIndex = 0;
+ sid.hDefaultIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MAINMENU), IMAGE_ICON, 0, 0, 0);
+ CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+
+ sid.pszDescription = Translate("Restart");
+ sid.pszName = "updater_restart";
+ sid.pszDefaultFile = "updater.dll";
+ sid.iDefaultIndex = 1;
+ sid.hDefaultIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_RESTART), IMAGE_ICON, 0, 0, 0);//LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS );
+ CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+
+ sid.pszDescription = Translate("Update and Exit");
+ sid.pszName = "updater_checkexit";
+ sid.pszDefaultFile = "updater.dll";
+ sid.iDefaultIndex = 2;
+ sid.hDefaultIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_UPDATEANDEXIT), IMAGE_ICON, 0, 0, 0);//LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS );
+ CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+
+ ReloadIcons(0, 0);
+
+ hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, ReloadIcons);
+ } else {
+ hIconCheck = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MAINMENU), IMAGE_ICON, 0, 0, 0);//LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS );
+ hIconRestart = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_RESTART), IMAGE_ICON, 0, 0, 0);//LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS );
+ hIconCheckExit = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_UPDATEANDEXIT), IMAGE_ICON, 0, 0, 0);//LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS );
+ }
+
+}
+
+void DeinitIcons() {
+ if(hIcoLibIconsChanged) UnhookEvent(hIcoLibIconsChanged);
+ else {
+ DestroyIcon(hIconCheck);
+ DestroyIcon(hIconRestart);
+ DestroyIcon(hIconCheckExit);
+ }
+}
|