summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp22
1 files changed, 21 insertions, 1 deletions
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)
{