summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--commonheaders.h2
-rw-r--r--init.cpp9
-rw-r--r--options.cpp9
3 files changed, 12 insertions, 8 deletions
diff --git a/commonheaders.h b/commonheaders.h
index ab717e8..8760d93 100644
--- a/commonheaders.h
+++ b/commonheaders.h
@@ -19,6 +19,8 @@
#include <locale.h>
#include <shlobj.h>
+#include <map>
+
#define MIRANDA_VER 0x0801
#include <newpluginapi.h>
diff --git a/init.cpp b/init.cpp
index 75ae28a..ea509cb 100644
--- a/init.cpp
+++ b/init.cpp
@@ -113,11 +113,16 @@ extern "C" int __declspec(dllexport) Unload(void)
return 0;
}
+void ShowLoadPublicKeyDialog();
int LoadKey(WPARAM w, LPARAM l)
{
- HANDLE hContact = (HANDLE)w;
- MessageBox(0, _T("Load GPG key function called"), _T("INFO"), MB_OK);
+ extern std::map<int, HANDLE> user_data;
+ extern int item_num;
+ item_num = 0; //black magic here
+ user_data[1] = (HANDLE)w;
+ ShowLoadPublicKeyDialog();
+// MessageBox(0, _T("Load GPG key function called"), _T("INFO"), MB_OK);
return 0;
}
int ToggleEncryption(WPARAM w, LPARAM l)
diff --git a/options.cpp b/options.cpp
index f160500..cf0b75f 100644
--- a/options.cpp
+++ b/options.cpp
@@ -16,7 +16,6 @@
#include "commonheaders.h"
#include <uxtheme.h>
-#include <map>
extern HINSTANCE hInst;
@@ -52,14 +51,13 @@ int GpgOptInit(WPARAM wParam,LPARAM lParam)
}
static HWND hwndLoadPublicKey = NULL;
-HWND hCaller;
std::map<int, HANDLE> user_data;
int item_num = 0;
HWND hwndList_p;
-void ShowLoadPublicKeyDialog(HWND hwndCaller);
+void ShowLoadPublicKeyDialog();
static BOOL CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
HWND hwndList=GetDlgItem(hwndDlg, IDC_USERLIST);
@@ -123,7 +121,7 @@ static BOOL CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
switch (LOWORD(wParam))
{
case IDC_LOAD_KEY_BUTTON:
- ShowLoadPublicKeyDialog(hwndDlg);
+ ShowLoadPublicKeyDialog();
return TRUE;
default:
break;
@@ -278,9 +276,8 @@ static BOOL CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam,LP
return FALSE;
}
-void ShowLoadPublicKeyDialog(HWND hwndCaller)
+void ShowLoadPublicKeyDialog()
{
- hCaller = hwndCaller;
if (hwndLoadPublicKey == NULL)
{
hwndLoadPublicKey = CreateDialog(hInst, MAKEINTRESOURCE(IDD_LOAD_PUBLIC_KEY), NULL, DlgProcLoadPublicKey);