48 |
|
|
49 |
/* Dialog box procedure to display all insecure all ElGamal keys. */ |
/* Dialog box procedure to display all insecure all ElGamal keys. */ |
50 |
BOOL CALLBACK |
BOOL CALLBACK |
51 |
elgamal_warn_dlg_proc( HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam ) |
elgamal_warn_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
52 |
{ |
{ |
53 |
gpg_keycache_t pc; |
gpg_keycache_t pc; |
54 |
gpgme_key_t key; |
gpgme_key_t key; |
60 |
while (!gpg_keycache_next_key (pc, 0, &key)) { |
while (!gpg_keycache_next_key (pc, 0, &key)) { |
61 |
if (key->subkeys->pubkey_algo == GPGME_PK_ELG) { |
if (key->subkeys->pubkey_algo == GPGME_PK_ELG) { |
62 |
_snprintf (tmp, sizeof (tmp)-1, "(0x%s) %s", |
_snprintf (tmp, sizeof (tmp)-1, "(0x%s) %s", |
63 |
key->subkeys->keyid+8, key->uids->uid); |
key->subkeys->keyid+8, key->uids->uid); |
64 |
SendDlgItemMessage( dlg, IDC_ELGWARN_LIST, LB_ADDSTRING, |
SendDlgItemMessage (dlg, IDC_ELGWARN_LIST, LB_ADDSTRING, |
65 |
0, (LPARAM)(const char *) tmp ); |
0, (LPARAM)(const char *) tmp); |
66 |
} |
} |
67 |
} |
} |
68 |
gpg_keycache_rewind (pc); |
gpg_keycache_rewind (pc); |
82 |
} |
} |
83 |
|
|
84 |
|
|
85 |
|
/* @unused |
86 |
static int |
static int |
87 |
cleanup_tmp_files (void) |
cleanup_tmp_files (void) |
88 |
{ |
{ |
104 |
_findclose (hd); |
_findclose (hd); |
105 |
return 0; |
return 0; |
106 |
} |
} |
107 |
|
*/ |
108 |
|
|
109 |
|
|
110 |
/* Dialog box procedure to confirm to delete the clipboard contents. */ |
/* Dialog box procedure to confirm to delete the clipboard contents. */ |
113 |
{ |
{ |
114 |
switch (msg) { |
switch (msg) { |
115 |
case WM_INITDIALOG: |
case WM_INITDIALOG: |
116 |
|
SetWindowText (dlg, _("Delete Clipboard Contents")); |
117 |
center_window (dlg, NULL); |
center_window (dlg, NULL); |
118 |
SetForegroundWindow (dlg); |
SetForegroundWindow (dlg); |
119 |
break; |
break; |
144 |
currwnd_gpg_dlg (HWND hwnd, UINT id, int *ret_set) |
currwnd_gpg_dlg (HWND hwnd, UINT id, int *ret_set) |
145 |
{ |
{ |
146 |
gpgme_error_t err; |
gpgme_error_t err; |
147 |
gpg_pgptype_t type; |
int type; |
148 |
|
|
149 |
if (ret_set) |
if (ret_set) |
150 |
*ret_set = 1; |
*ret_set = 1; |
208 |
clip_gpg_dlg (HWND hwnd, UINT id) |
clip_gpg_dlg (HWND hwnd, UINT id) |
209 |
{ |
{ |
210 |
gpgme_error_t err; |
gpgme_error_t err; |
211 |
gpg_pgptype_t type; |
int type; |
212 |
size_t size = 0; |
size_t size = 0; |
213 |
|
|
214 |
if( (id == ID_WINPT_SIGN || id == ID_WINPT_SIGNENCRYPT) |
if( (id == ID_WINPT_SIGN || id == ID_WINPT_SIGNENCRYPT) |
291 |
} /* clip_gpg_dlg */ |
} /* clip_gpg_dlg */ |
292 |
|
|
293 |
|
|
294 |
gpg_card_t |
/* Load the Card Manager with the current card. */ |
295 |
smartcard_init (void) |
static void |
296 |
|
load_smartcard (void) |
297 |
{ |
{ |
298 |
/* |
gpg_card_t card; |
299 |
pcsc_loadlib (scard_support); |
|
300 |
rc = show_card_status (); |
card = gpg_card_load (); |
301 |
if( rc ) |
if (card) { |
302 |
break; |
dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_CARD_EDIT, |
303 |
*/ |
GetDesktopWindow (), card_edit_dlg_proc, |
304 |
return gpg_load_scard (); |
(LPARAM)card, |
305 |
|
_("Card Edit"), IDS_WINPT_CARD_EDIT); |
306 |
|
gpg_card_release (card); |
307 |
|
card = NULL; |
308 |
|
} |
309 |
} |
} |
310 |
|
|
311 |
|
|
337 |
int rc, set_wc = 0, has_data = 0; |
int rc, set_wc = 0, has_data = 0; |
338 |
INITCOMMONCONTROLSEX cce; |
INITCOMMONCONTROLSEX cce; |
339 |
gpgme_error_t err; |
gpgme_error_t err; |
|
gpg_card_t card; |
|
340 |
|
|
341 |
switch (msg) { |
switch (msg) { |
342 |
case WM_CREATE: |
case WM_CREATE: |
386 |
set_clip_text (NULL, " ", 1); |
set_clip_text (NULL, " ", 1); |
387 |
wipe_contents = 0; |
wipe_contents = 0; |
388 |
} |
} |
389 |
cleanup_tmp_files (); |
debug_end (); |
390 |
|
/*cleanup_tmp_files ();*/ |
391 |
Shell_NotifyIcon (NIM_DELETE, &NID); |
Shell_NotifyIcon (NIM_DELETE, &NID); |
392 |
PostQuitMessage (0); |
PostQuitMessage (0); |
393 |
ExitProcess (0); |
ExitProcess (0); |
417 |
set_menu_state (popup, ID_WINPT_CDISKUNMOUNT, MF_DISABLED|MF_GRAYED); |
set_menu_state (popup, ID_WINPT_CDISKUNMOUNT, MF_DISABLED|MF_GRAYED); |
418 |
} |
} |
419 |
|
|
420 |
set_menu_text( popup, ID_WINPT_EDIT, _("Edit Clipboard") ); |
set_menu_text (popup, ID_WINPT_EDIT, _("Edit Clipboard")); |
421 |
set_menu_text( popup, ID_WINPT_ABOUT, _("About...") ); |
set_menu_text (popup, ID_WINPT_ABOUT, _("About...")); |
422 |
set_menu_text( popup, ID_WINPT_QUIT, _("Exit") ); |
set_menu_text (popup, ID_WINPT_QUIT, _("Exit")); |
423 |
set_menu_text( popup, ID_WINPT_SYMENC, _("Symmetric") ); |
set_menu_text (popup, ID_WINPT_SYMENC, _("Symmetric")); |
424 |
#if 0 |
set_menu_text (popup, ID_WINPT_ENCRYPT, _("Encrypt")); |
425 |
set_menu_text( popup, ID_WINPT_ENCRYPT, _("Encrypt") ); |
set_menu_text (popup, ID_WINPT_SIGNENCRYPT, _("Sign && Encrypt")); |
426 |
set_menu_text( popup, ID_WINPT_SIGNENCRYPT, _("Sign && Encrypt") ); |
set_menu_text (popup, ID_WINPT_DECRYPT, _("Decrypt/Verify")); |
427 |
set_menu_text( popup, ID_WINPT_DECRYPT, _("Decrypt/Verify") ); |
set_menu_text (popup, ID_WINPT_VERIFY, _("Verify")); |
428 |
set_menu_text( popup, ID_WINPT_VERIFY, _("Verify") ); |
set_menu_text (popup, ID_WINPT_CURRWND_ENCRYPT, _("Encrypt")); |
429 |
set_menu_text( popup, ID_WINPT_CURRWND_ENCRYPT, _("Encrypt") ); |
set_menu_text (popup, ID_WINPT_CURRWND_SIGNENCRYPT, _("Sign && Encrypt")); |
430 |
set_menu_text( popup, ID_WINPT_CURRWND_SIGNENCRYPT, _("Sign && Encrypt") ); |
set_menu_text (popup, ID_WINPT_CURRWND_DECRYPT_VERIFY, _("Decrypt/Verify")); |
431 |
set_menu_text( popup, ID_WINPT_CURRWND_DECRYPT_VERIFY, _("Decrypt/Verify") ); |
set_menu_text (popup, ID_WINPT_CURRWND_SIGN, _("Sign")); |
432 |
set_menu_text( popup, ID_WINPT_CURRWND_SIGN, _("Sign") ); |
/* change popup texts */ |
433 |
#endif |
set_menu_text_bypos (popup, 6, _("Clipboard")); |
434 |
|
set_menu_text_bypos (popup, 7, _("Current Window")); |
435 |
|
set_menu_text_bypos (popup, 9, _("Preferences")); |
436 |
|
|
437 |
#endif |
#endif |
438 |
TrackPopupMenu( popup, TPM_RIGHTALIGN, p.x, p.y, 0, hwnd, NULL ); |
TrackPopupMenu( popup, TPM_RIGHTALIGN, p.x, p.y, 0, hwnd, NULL ); |
439 |
PostMessage( hwnd, WM_USER, 0, 0 ); |
PostMessage( hwnd, WM_USER, 0, 0 ); |
563 |
break; |
break; |
564 |
|
|
565 |
case ID_WINPT_CARD: |
case ID_WINPT_CARD: |
566 |
card = smartcard_init (); |
load_smartcard (); |
|
if( card ) { |
|
|
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_CARD_EDIT, |
|
|
GetDesktopWindow(), card_edit_dlg_proc, |
|
|
(LPARAM)card, |
|
|
_("Card Edit"), IDS_WINPT_CARD_EDIT ); |
|
|
gpg_card_release( card ); card = NULL; |
|
|
} |
|
567 |
break; |
break; |
568 |
|
|
569 |
case ID_WINPT_EDIT: |
case ID_WINPT_EDIT: |
617 |
} |
} |
618 |
|
|
619 |
return DefWindowProc (hwnd, msg, wparam, lparam); |
return DefWindowProc (hwnd, msg, wparam, lparam); |
620 |
} /* winpt_main_proc */ |
} |