summaryrefslogtreecommitdiff
path: root/plugins/QuickContacts
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-02-10 14:42:51 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-02-10 14:42:51 +0000
commit33953cc6a0fab6a91af293c6838f8a46dd7922da (patch)
tree2dbbe718ad42545bde6c9f7672387827c530550a /plugins/QuickContacts
parente190a7fde521bd6af9ea485cc730f854aaf38e11 (diff)
HCONTACT, part 3
git-svn-id: http://svn.miranda-ng.org/main/trunk@8081 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/QuickContacts')
-rw-r--r--plugins/QuickContacts/src/quickcontacts.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp
index 6d35216f40..fd52f59a93 100644
--- a/plugins/QuickContacts/src/quickcontacts.cpp
+++ b/plugins/QuickContacts/src/quickcontacts.cpp
@@ -571,15 +571,12 @@ HCONTACT GetSelectedContact(HWND hwndDlg)
}
// get array position from handle
-int GetItemPos(HANDLE hcontact)
+int GetItemPos(HCONTACT hcontact)
{
- int loop;
-
- for(loop=0;loop<contacts.getCount();loop++)
- {
- if(hcontact==contacts[loop]->hcontact)
+ for(int loop=0; loop < contacts.getCount(); loop++)
+ if(hcontact == contacts[loop]->hcontact)
return loop;
- }
+
return -1;
}
@@ -819,12 +816,9 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
LoadContacts(hwndDlg, FALSE);
EnableButtons(hwndDlg, NULL);
- if (db_get_b(NULL, MODULE_NAME, "EnableLastSentTo", 0))
- {
- int pos = GetItemPos((HANDLE) db_get_dw(NULL, MODULE_NAME, "LastSentTo", -1));
-
- if (pos != -1)
- {
+ if (db_get_b(NULL, MODULE_NAME, "EnableLastSentTo", 0)) {
+ int pos = GetItemPos((HCONTACT)db_get_dw(NULL, MODULE_NAME, "LastSentTo", -1));
+ if (pos != -1) {
SendDlgItemMessage(hwndDlg, IDC_USERNAME, CB_SETCURSEL, (WPARAM) pos, 0);
EnableButtons(hwndDlg, contacts[pos]->hcontact);
}