diff options
author | Gluzskiy Alexandr <sss123next@list.ru> | 2010-08-12 16:02:52 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@list.ru> | 2010-08-12 16:02:52 +0300 |
commit | 5d7dc0a0e6021470eac321b7af090f01a7bfe82f (patch) | |
tree | 2fb499fb996b7069df4d5fd60a86960f36f55549 /main.cpp | |
parent | 5a0201b182d3198540e66700b80b16b528115dde (diff) |
modified: main.cpp
modified: messages.cpp
modified: options.cpp
modified: utilities.cpp
modified: utilities.h
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -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)
{
|