summaryrefslogtreecommitdiff
path: root/plugins/QuickReplies/events.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-20 23:51:53 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-20 23:51:53 +0000
commit57abc51aad272a656282a52a460a47abe24e07d6 (patch)
treec6f3538e63c9c736cfa7129423d1b498273278b6 /plugins/QuickReplies/events.cpp
parentb9f120f97699286410fe902f93135235eed0b127 (diff)
- MS_SKIN2_ADDICON replaced with Skin_AddIcon;
- SKINICONDESC_SIZE* constants removed and replaced with sizeof(sid); - added SIDF_PATH_UNICODE for all plugins; - dynamic translation fixed in the icolib options dialog git-svn-id: http://svn.miranda-ng.org/main/trunk@507 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/QuickReplies/events.cpp')
-rw-r--r--plugins/QuickReplies/events.cpp42
1 files changed, 16 insertions, 26 deletions
diff --git a/plugins/QuickReplies/events.cpp b/plugins/QuickReplies/events.cpp
index fd4991423d..2227c6d6f1 100644
--- a/plugins/QuickReplies/events.cpp
+++ b/plugins/QuickReplies/events.cpp
@@ -35,7 +35,7 @@ INT_PTR QuickRepliesService(WPARAM, LPARAM)
int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
{
UnhookEvent(hOnModulesLoaded);
- HICON hIcon = NULL;
+ HANDLE hIcon = NULL;
char buttonName[32];
if (!ServiceExists(MS_QUICKREPLIES_SERVICE))
@@ -43,34 +43,26 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
iNumber = 0;
hQuickRepliesService = CreateServiceFunction(MS_QUICKREPLIES_SERVICE, QuickRepliesService);
}
- else
- iNumber = DBGetContactSettingByte(NULL, MODULE_NAME, "InstancesCount", 0);
+ else iNumber = DBGetContactSettingByte(NULL, MODULE_NAME, "InstancesCount", 0);
DBWriteContactSettingByte(NULL, MODULE_NAME, "InstancesCount", iNumber + 1);
hOnOptInitialized = HookEvent(ME_OPT_INITIALISE, OnOptInitialized);
hOnButtonPressed = HookEvent(ME_MSG_BUTTONPRESSED, OnButtonPressed);
- if (ServiceExists(MS_SKIN2_ADDICON))
- {
- char buttonNameTranslated[32];
- mir_snprintf(buttonName, SIZEOF(buttonName), "Button %x", iNumber + 1);
- mir_snprintf(buttonNameTranslated, SIZEOF(buttonNameTranslated), "%s %x",Translate("Button"), iNumber + 1);
-
- SKINICONDESC sid = {0};
- sid.cbSize = sizeof(SKINICONDESC);
- sid.pszSection = "TabSRMM/Quick Replies";
- sid.cx = sid.cy = 16;
- sid.pszDescription = buttonNameTranslated;
- sid.pszName = buttonName;
- sid.hDefaultIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_QICON));
-
- hIcon = (HICON)CallService(MS_SKIN2_ADDICON, 0, (LPARAM) &sid);
- }
- else
- hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_QICON));
+ char buttonNameTranslated[32];
+ mir_snprintf(buttonName, SIZEOF(buttonName), "Button %x", iNumber + 1);
+ mir_snprintf(buttonNameTranslated, SIZEOF(buttonNameTranslated), "%s %x",Translate("Button"), iNumber + 1);
- if (ServiceExists(MS_BB_ADDBUTTON))
- {
+ SKINICONDESC sid = {0};
+ sid.cbSize = sizeof(sid);
+ sid.pszSection = "TabSRMM/Quick Replies";
+ sid.cx = sid.cy = 16;
+ sid.pszDescription = buttonNameTranslated;
+ sid.pszName = buttonName;
+ sid.hDefaultIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_QICON));
+ hIcon = Skin_AddIcon(&sid);
+
+ if (ServiceExists(MS_BB_ADDBUTTON)) {
mir_snprintf(buttonName, SIZEOF(buttonName), MODULE_NAME" %x", iNumber + 1);
BBButton bbd = {0};
@@ -78,15 +70,13 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISLSIDEBUTTON;
bbd.pszModuleName = buttonName;
bbd.ptszTooltip = _T("Quick Replies\r\nLeft button - open menu\r\nRight button - options page");
- bbd.hIcon = (HANDLE)hIcon;
+ bbd.hIcon = hIcon;
bbd.dwButtonID = iNumber;
bbd.dwDefPos = 220;
CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&bbd);
}
- DestroyIcon(hIcon);
-
return 0;
}