From 5d7dc0a0e6021470eac321b7af090f01a7bfe82f Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Thu, 12 Aug 2010 16:02:52 +0300 Subject: modified: main.cpp modified: messages.cpp modified: options.cpp modified: utilities.cpp modified: utilities.h --- main.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index bd60e6f..7d8ef1f 100644 --- a/main.cpp +++ b/main.cpp @@ -25,19 +25,22 @@ void test() DWORD code; TCHAR cmd[512]; _tcscpy(cmd, _T("--list-secret-keys")); - pxExecute(cmd, "", &out, &code); +// pxExecute(cmd, "", &out, &code); // MessageBoxA(0, out.c_str(), "test", MB_OK); } HWND hwndFirstRun = NULL; +int itemnum = 0; + static BOOL CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam) { HWND hwndList=GetDlgItem(hwndDlg, IDC_KEY_LIST); LVCOLUMN col = {0}; LVITEM item = {0}; NMLISTVIEW * hdr = (NMLISTVIEW *) lParam; + TCHAR fp[16] = {0}; switch (msg) { case WM_INITDIALOG: @@ -143,6 +146,16 @@ static BOOL CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM switch (LOWORD(wParam)) { case ID_OK: + ListView_GetItemText(hwndList, itemnum, 0, fp, 16); + { + string out; + DWORD code; + TCHAR cmd[64]; + _tcscpy(cmd, _T("--export -a ")); + _tcscat(cmd, fp); + pxExecute(cmd, "", &out, &code); + DBWriteContactSettingString(NULL, szModuleName, "GPGPubKey", out.c_str()); + } DestroyWindow(hwndDlg); break; } @@ -151,6 +164,13 @@ static BOOL CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM case WM_NOTIFY: { + if(hdr && IsWindowVisible(hdr->hdr.hwndFrom) && hdr->iItem != (-1)) + { + if(hdr->hdr.code == LVN_ITEMCHANGED) + { + itemnum = hdr->iItem; + } + } switch (((LPNMHDR)lParam)->code) { -- cgit v1.2.3