From 9041e1e89514d7a1a1df7620b7fdf974a4abac1e Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Sat, 7 Aug 2010 17:47:54 +0300 Subject: userlist --- options.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'options.cpp') diff --git a/options.cpp b/options.cpp index 8eb471c..494a4fd 100644 --- a/options.cpp +++ b/options.cpp @@ -58,6 +58,36 @@ static BOOL CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case WM_INITDIALOG: { TranslateDialogDefault(hwndDlg); + HWND hwndList=GetDlgItem(hwndDlg, IDC_USERLIST); + LVCOLUMN col; + LVITEM item; + NMLISTVIEW *hdr; + col.pszText = _T("Contact"); + col.mask = LVCF_TEXT | LVCF_WIDTH; + col.fmt = LVCFMT_LEFT; + col.cx = 100; + ListView_InsertColumn(hwndList, 0, &col); + col.pszText = _T("PubKey"); + col.mask = LVCF_TEXT | LVCF_WIDTH; + col.fmt = LVCFMT_LEFT; + col.cx = 250; + ListView_InsertColumn(hwndList, 1, &col); + ListView_SetExtendedListViewStyleEx(hwndList, 0, LVS_EX_FULLROWSELECT); + int i = 1, iRow = 0; + for(HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact != NULL; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0)) + { + TCHAR *name = (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR); + item.mask = LVIF_TEXT; + item.iItem = i; + item.iSubItem = 0; + item.pszText = name; + iRow = ListView_InsertItem(hwndList, &item); + ListView_SetItemText(hwndList, iRow, 0, name); + ListView_SetItemText(hwndList, iRow, 1, UniGetContactSettingUtf(hContact, szModuleName, "GPGPubKey", _T("not set"))); + i++; + } + ListView_SetColumnWidth(hwndList, 0, LVSCW_AUTOSIZE);// not sure about this + ListView_SetColumnWidth(hwndList, 1, LVSCW_AUTOSIZE); return TRUE; } -- cgit v1.2.3