summaryrefslogtreecommitdiff
path: root/plugins/WhenWasIt/src/services.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-25 14:40:02 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-25 14:40:02 +0000
commit65a5f40baaae20a733da94df023221159b334e2b (patch)
tree5771f98d03384669e288f58dc10db4aa1b1a80fc /plugins/WhenWasIt/src/services.cpp
parent81464df93124380cecbf7e5dace914f1c06aaf5d (diff)
WhenWasIt - correct work with icons & extra icons
git-svn-id: http://svn.miranda-ng.org/main/trunk@2484 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/WhenWasIt/src/services.cpp')
-rw-r--r--plugins/WhenWasIt/src/services.cpp28
1 files changed, 12 insertions, 16 deletions
diff --git a/plugins/WhenWasIt/src/services.cpp b/plugins/WhenWasIt/src/services.cpp
index 32241b33b9..170c9275d6 100644
--- a/plugins/WhenWasIt/src/services.cpp
+++ b/plugins/WhenWasIt/src/services.cpp
@@ -172,32 +172,28 @@ INT_PTR AddBirthdayService(WPARAM wParam, LPARAM lParam)
{
HWND hWnd = WindowList_Find(hAddBirthdayWndsList, (HANDLE) wParam);
if ( !hWnd) {
- hWnd = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_ADD_BIRTHDAY), NULL, DlgProcAddBirthday);
- if (hWnd == NULL) {
- TCHAR buffer[1024];
- _stprintf(buffer, _T("Error #%d while trying to create add birthday dialog"), GetLastError());
- MessageBox(0, buffer, _T("Error"), MB_OK);
- }
+ hWnd = CreateDialogParam(hInstance, MAKEINTRESOURCE(IDD_ADD_BIRTHDAY), NULL, DlgProcAddBirthday, wParam);
WindowList_Add(hAddBirthdayWndsList, hWnd, (HANDLE) wParam);
- SetWindowLongPtr(hWnd, GWLP_USERDATA, wParam);
}
return ShowWindow(hWnd, SW_SHOW);
}
-void ShowPopupMessage(TCHAR *title, TCHAR *message, HICON icon)
+void ShowPopupMessage(TCHAR *title, TCHAR *message, HANDLE icon)
{
POPUPDATAT pd = {0};
- pd.lchIcon = icon;
+ pd.lchIcon = Skin_GetIconByHandle(icon);
_tcscpy(pd.lptzContactName, title);
_tcscpy(pd.lptzText, message);
pd.colorText = commonData.foreground;
pd.colorBack = commonData.background;
PUAddPopUpT(&pd);
+
+ Skin_ReleaseIcon(pd.lchIcon);
}
DWORD WINAPI RefreshUserDetailsWorkerThread(LPVOID param)
{
- ShowPopupMessage(TranslateT("WhenWasIt"), TranslateT("Starting to refresh user details"), hiRefreshUserDetails);
+ ShowPopupMessage(TranslateT("WhenWasIt"), TranslateT("Starting to refresh user details"), hRefreshUserDetails);
int delay = db_get_w(NULL, ModuleName, "UpdateDelay", REFRESH_DETAILS_DELAY);
int res;
@@ -208,7 +204,7 @@ DWORD WINAPI RefreshUserDetailsWorkerThread(LPVOID param)
if (hContact)
Sleep(delay); //sleep for a few seconds between requests
}
- ShowPopupMessage(TranslateT("WhenWasIt"), TranslateT("Done refreshing user details"), hiRefreshUserDetails);
+ ShowPopupMessage(TranslateT("WhenWasIt"), TranslateT("Done refreshing user details"), hRefreshUserDetails);
return 0;
}
@@ -245,9 +241,9 @@ INT_PTR ImportBirthdaysService(WPARAM wParam, LPARAM lParam)
if ( GetOpenFileName(&of)) {
TCHAR buffer[2048];
mir_sntprintf(buffer, SIZEOF(buffer), TranslateT("Importing birthdays from file: %s"), fileName);
- ShowPopupMessage(TranslateT("WhenWasIt"), buffer, hiImportBirthdays);
+ ShowPopupMessage(TranslateT("WhenWasIt"), buffer, hImportBirthdays);
DoImport(fileName);
- ShowPopupMessage(TranslateT("WhenWasIt"), TranslateT("Done importing birthdays"), hiImportBirthdays);
+ ShowPopupMessage(TranslateT("WhenWasIt"), TranslateT("Done importing birthdays"), hImportBirthdays);
}
return 0;
@@ -273,9 +269,9 @@ INT_PTR ExportBirthdaysService(WPARAM wParam, LPARAM lParam)
_tcscat(fileName, _T(BIRTHDAY_EXTENSION));
_stprintf(buffer, TranslateT("Exporting birthdays to file: %s"), fileName);
- ShowPopupMessage(TranslateT("WhenWasIt"), buffer, hiExportBirthdays);
+ ShowPopupMessage(TranslateT("WhenWasIt"), buffer, hExportBirthdays);
DoExport(fileName);
- ShowPopupMessage(TranslateT("WhenWasIt"), TranslateT("Done exporting birthdays"), hiExportBirthdays);
+ ShowPopupMessage(TranslateT("WhenWasIt"), TranslateT("Done exporting birthdays"), hExportBirthdays);
}
return 0;
@@ -320,7 +316,7 @@ int DoImport(TCHAR *fileName)
else {
TCHAR tmp[2048];
_stprintf(tmp, TranslateT(NOTFOUND_FORMAT), szHandle, szProto);
- ShowPopupMessage(TranslateT("Warning"), tmp, hiImportBirthdays);
+ ShowPopupMessage(TranslateT("Warning"), tmp, hImportBirthdays);
}
}
}