diff options
author | George Hazan <george.hazan@gmail.com> | 2012-07-19 22:48:01 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-07-19 22:48:01 +0000 |
commit | 95aa036670a1ce2c461ffd9bd3a586d191ee4675 (patch) | |
tree | cd244db18622df3462166ed39593ca924c890f6b /plugins/BuddyExpectator | |
parent | f6e0db0590e2f8feeacc29d4e50007fbe358f9d5 (diff) |
- various icolib fixes;
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@1061 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/BuddyExpectator')
-rw-r--r-- | plugins/BuddyExpectator/src/BuddyExpectator.cpp | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index ff0382bd61..9ef2779a02 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -742,10 +742,11 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) g_IECClear.hImage = (HANDLE) -1;
}
+ TCHAR szFile[MAX_PATH];
+ GetModuleFileNameA(hInst, szFile, MAX_PATH);
+
// IcoLib support
SKINICONDESC sid = {0};
- char szFile[MAX_PATH];
- GetModuleFileNameA(hInst, szFile, MAX_PATH);
sid.pszDefaultFile = szFile;
sid.cbSize = sizeof(sid);
sid.pszSection = "BuddyExpectator";
@@ -776,12 +777,12 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) Skin_AddIcon(&sid);
hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, onIconsChanged);
-
+
onIconsChanged(0,0);
-
+
if (options.enableMissYou) {
hPrebuildContactMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, onPrebuildContactMenu);
-
+
CLISTMENUITEM mi = {0};
mi.cbSize = sizeof(CLISTMENUITEM);
mi.flags = CMIF_ICONFROMICOLIB;
@@ -791,23 +792,22 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) mi.pszService = "BuddyExpectator/actionMissYouClick";
hContactMenu = Menu_AddContactMenuItem(&mi);
}
-
-
+
missyouactions[0].cbSize = sizeof(POPUPACTION);
missyouactions[0].lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"disabled_icon");
lstrcpy(missyouactions[0].lpzTitle, Translate("Disable Miss You"));
missyouactions[0].wParam = missyouactions[0].lParam = 1;
-
+
hideactions[0].cbSize = sizeof(POPUPACTION);
hideactions[0].lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"hide_icon");
lstrcpy(hideactions[0].lpzTitle, Translate("Hide contact"));
hideactions[0].wParam = hideactions[0].lParam = 2;
-
+
hideactions[1].cbSize = sizeof(POPUPACTION);
hideactions[1].lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"neverhide_icon");
lstrcpy(hideactions[1].lpzTitle, Translate("Never hide this contact"));
hideactions[1].wParam = hideactions[1].lParam = 3;
-
+
return 0;
}
@@ -825,8 +825,8 @@ int ContactAdded(WPARAM wParam, LPARAM lParam) int onSystemOKToExit(WPARAM wParam,LPARAM lParam)
{
UnhookEvent(hEventContactSetting);
- UnhookEvent(hEventContactAdded);
- UnhookEvent(hEventUserInfoInit);
+ UnhookEvent(hEventContactAdded);
+ UnhookEvent(hEventUserInfoInit);
if (hPrebuildContactMenu) UnhookEvent(hPrebuildContactMenu);
UnhookEvent(hIcoLibIconsChanged);
UnhookEvent(hModulesLoaded);
@@ -834,19 +834,19 @@ int onSystemOKToExit(WPARAM wParam,LPARAM lParam) UnhookEvent(hSystemOKToExit);
UnhookEvent(hHookExtraIconsRebuild);
UnhookEvent(hHookExtraIconsApply);
-
+
DestroyServiceFunction(hContactReturnedAction);
DestroyServiceFunction(hContactStillAbsentAction);
DestroyServiceFunction(hMissYouAction);
DestroyServiceFunction(hMenuMissYouClick);
DeinitOptions();
-
+
if (hIcoLibIconsChanged)
CallService(MS_SKIN2_RELEASEICON, (WPARAM)hIcon, 0);
else
DestroyIcon(hIcon);
-
+
return 0;
}
@@ -873,9 +873,8 @@ extern "C" int __declspec(dllexport) Load(void) DBVARIANT dbv;
HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
DWORD current_time = (DWORD)time(0);
- while (hContact != 0)
- {
- if (!DBGetContactSetting(hContact, MODULE_NAME, "CreationTime", &dbv))
+ while (hContact != 0) {
+ if ( !DBGetContactSetting(hContact, MODULE_NAME, "CreationTime", &dbv))
DBFreeVariant(&dbv);
else
DBWriteContactSettingDword(hContact, MODULE_NAME, "CreationTime", current_time);
@@ -892,4 +891,3 @@ extern "C" int __declspec(dllexport) Unload(void) return 0;
}
-
|