diff options
author | René Schümann <white06tiger@gmail.com> | 2014-08-21 11:42:31 +0000 |
---|---|---|
committer | René Schümann <white06tiger@gmail.com> | 2014-08-21 11:42:31 +0000 |
commit | 2ae4a360da9638ecaaa68bbb683187ef8e1faf35 (patch) | |
tree | 99a533c91fccdd70bb8bde2360f42bd5a6b7703b /plugins/IEHistory/src/services.cpp | |
parent | d33b48c34e2ce98bd5a73698006be3859a7dfbc4 (diff) |
IEHistory: Miranda NG compatibility.
- removed mirandaMem
* GetWindowLong => GetWindowLongPtr
* SetWindowLong => SetWindowLongPtr
* DLGPROC returning int/BOOL => INT_PTR
* CallService(MS_DB_EVENT_*) => db_event_*
* DBGetContactSetting* => db_get_*
* DBWriteContactSetting => db_set_*
* contact HANDLE => MCONTACT
* CallService(MS_CLIST_ADD*MENUITEM,...) => Menu_Add*MenuItem()
* improved GetContactName()
- removed some #pragma warning's
* version bump to 0.0.1.5
git-svn-id: http://svn.miranda-ng.org/main/trunk@10253 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/IEHistory/src/services.cpp')
-rw-r--r-- | plugins/IEHistory/src/services.cpp | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/plugins/IEHistory/src/services.cpp b/plugins/IEHistory/src/services.cpp index 5683eecda8..0cbd957e0a 100644 --- a/plugins/IEHistory/src/services.cpp +++ b/plugins/IEHistory/src/services.cpp @@ -34,29 +34,28 @@ int DestroyServices() return 0; } -int ShowContactHistoryService(WPARAM wParam, LPARAM lParam) +INT_PTR ShowContactHistoryService(WPARAM wParam, LPARAM lParam) { Log("%s", "Entering function " __FUNCTION__); HWND historyDlg; HWND parent = NULL; - historyDlg = WindowList_Find(hOpenWindowsList, (HANDLE) wParam); - if (historyDlg == NULL) - { - int count = DBGetContactSettingDword(NULL, ModuleName, "EventsToLoad", 0); - int loadInBackground = DBGetContactSettingByte(NULL, ModuleName, "UseWorkerThread", 0); - HistoryWindowData *data; - data = (HistoryWindowData *) malloc(sizeof(HistoryWindowData)); - data->hContact = (HANDLE) wParam; - data->hIEView = NULL; - data->itemsPerPage = count; - data->index = 0; - data->count = 0; - data->loadMethod = (loadInBackground) ? LOAD_IN_BACKGROUND : 0; - historyDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_HISTORY), parent, HistoryDlgProc); - SetWindowLong(historyDlg, DWL_USER, (LONG) data); - - WindowList_Add(hOpenWindowsList, historyDlg, (HANDLE) wParam); - } - ShowWindow(historyDlg, SW_SHOW); + historyDlg = WindowList_Find(hOpenWindowsList, (MCONTACT)wParam); + if (historyDlg == NULL){ + int count = db_get_dw(NULL, ModuleName, "EventsToLoad", 0); + int loadInBackground = db_get_b(NULL, ModuleName, "UseWorkerThread", 0); + HistoryWindowData *data; + data = (HistoryWindowData *) malloc(sizeof(HistoryWindowData)); + data->contact = (MCONTACT) wParam; + data->hIEView = NULL; + data->itemsPerPage = count; + data->index = 0; + data->count = 0; + data->loadMethod = (loadInBackground) ? LOAD_IN_BACKGROUND : 0; + historyDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_HISTORY), parent, HistoryDlgProc); + SetWindowLongPtr(historyDlg, DWLP_USER, (LONG_PTR)data); + + WindowList_Add(hOpenWindowsList, historyDlg, (MCONTACT) wParam); + } + ShowWindow(historyDlg, SW_SHOWNORMAL); return 0; -}
\ No newline at end of file +} |