From 20fe45cad49f46bdfad5fc934d3c4ff9cddb26ce Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Sat, 2 Oct 2010 01:37:46 +0300 Subject: options --- options.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'options.cpp') diff --git a/options.cpp b/options.cpp index 740cd8b..4390e49 100644 --- a/options.cpp +++ b/options.cpp @@ -162,7 +162,7 @@ static BOOL CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA ListView_SetItemText(hwndList, iRow, 3, (_tcslen(tmp) > 1)?tmp:_T("not set")); mir_free(tmp); if(DBGetContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0)) - ListView_SetItemState(hwndList, iRow, 0x2000, 0xF000); + ListView_SetCheckState(hwndList, iRow, 1); user_data[i] = hContact; ZeroMemory(&item,sizeof(item)); ListView_SetColumnWidth(hwndList, 0, LVSCW_AUTOSIZE);// not sure about this @@ -367,12 +367,14 @@ static BOOL CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if(hdr && IsWindowVisible(hdr->hdr.hwndFrom) && hdr->iItem != (-1)) { if(hdr->hdr.code == NM_CLICK) + { + item_num = hdr->iItem; + } + else if(hdr->hdr.code == LVN_ITEMCHANGED) { void setClistIcon(HANDLE hContact); void setSrmmIcon(HANDLE hContact); - item_num = hdr->iItem; - int i123 = ListView_GetItemState(hwndList, item_num, 0xF000); - if(ListView_GetItemState(hwndList, item_num, 0xF000) != 0x2000) + if(ListView_GetCheckState(hwndList, item_num)) DBWriteContactSettingByte(user_data[item_num+1], szGPGModuleName, "GPGEncryption", 1); else DBWriteContactSettingByte(user_data[item_num+1], szGPGModuleName, "GPGEncryption", 0); -- cgit v1.2.3