1 |
/* wptMainProc.cpp - Main window procedure |
/* wptMainProc.cpp - Main window procedure |
2 |
* Copyright (C) 2000-2005 Timo Schulz |
* Copyright (C) 2000-2006 Timo Schulz |
3 |
* |
* |
4 |
* This file is part of WinPT. |
* This file is part of WinPT. |
5 |
* |
* |
44 |
#include "wptCard.h" |
#include "wptCard.h" |
45 |
#include "wptCryptdisk.h" |
#include "wptCryptdisk.h" |
46 |
#include "wptCardEdit.h" |
#include "wptCardEdit.h" |
|
#include "wptCrypto.h" |
|
47 |
|
|
48 |
extern HWND activ_hwnd; |
|
49 |
|
void update_keycache (HWND hwnd); |
50 |
|
|
51 |
static int cmd = 0; |
static int cmd = 0; |
52 |
static int wipe_contents = 0; |
static int wipe_contents = 0; |
53 |
|
|
60 |
gpgme_key_t key; |
gpgme_key_t key; |
61 |
char tmp[128+64+1]; |
char tmp[128+64+1]; |
62 |
|
|
63 |
switch( msg ) { |
switch (msg) { |
64 |
case WM_INITDIALOG: |
case WM_INITDIALOG: |
65 |
pc = keycache_get_ctx (1); |
pc = keycache_get_ctx (1); |
66 |
while (!gpg_keycache_next_key (pc, 0, &key)) { |
while (!gpg_keycache_next_key (pc, 0, &key)) { |
88 |
} |
} |
89 |
|
|
90 |
|
|
|
/* @unused |
|
|
static int |
|
|
cleanup_tmp_files (void) |
|
|
{ |
|
|
struct _finddata_t dat; |
|
|
char tmp[384]; |
|
|
long hd; |
|
|
|
|
|
if (GetTempPath (sizeof (tmp)-1, tmp) == FALSE || |
|
|
SetCurrentDirectory (tmp) == FALSE) { |
|
|
winpt_errmsg ("GetTempPath", 0); |
|
|
return WPTERR_GENERAL; |
|
|
} |
|
|
hd = _findfirst ("gpgmeOUT*", &dat); |
|
|
if (hd == -1) |
|
|
return 0; |
|
|
do { |
|
|
secure_unlink (dat.name, WIPE_MODE_SIMPLE); |
|
|
} while (_findnext (hd, &dat) == 0); |
|
|
_findclose (hd); |
|
|
return 0; |
|
|
} |
|
|
*/ |
|
|
|
|
|
|
|
91 |
/* Dialog box procedure to confirm to delete the clipboard contents. */ |
/* Dialog box procedure to confirm to delete the clipboard contents. */ |
92 |
static BOOL CALLBACK |
static BOOL CALLBACK |
93 |
confirm_delclipboard_dlg (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
confirm_delclipboard_dlg (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
95 |
switch (msg) { |
switch (msg) { |
96 |
case WM_INITDIALOG: |
case WM_INITDIALOG: |
97 |
SetWindowText (dlg, _("Delete Clipboard Contents")); |
SetWindowText (dlg, _("Delete Clipboard Contents")); |
98 |
|
SetDlgItemText (dlg, IDC_CONFDELCLIP_BRAIN, _("&Remember the answer")); |
99 |
|
SetDlgItemText (dlg, IDC_CONFDELCLIP_INFO, _("Do you want to delete the contents from the clipboard?")); |
100 |
|
SetDlgItemText (dlg, IDYES, _("&Yes")); |
101 |
|
SetDlgItemText (dlg, IDNO, _("&No")); |
102 |
center_window (dlg, NULL); |
center_window (dlg, NULL); |
103 |
SetForegroundWindow (dlg); |
SetForegroundWindow (dlg); |
104 |
break; |
break; |
175 |
} |
} |
176 |
} |
} |
177 |
else if ((type & PGP_PUBKEY) && !(type & PGP_CLEARSIG)) |
else if ((type & PGP_PUBKEY) && !(type & PGP_CLEARSIG)) |
178 |
km_clip_import (GetDesktopWindow ()); |
km_clip_import (GetDesktopWindow (), NULL, NULL); |
179 |
else { |
else { |
180 |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_VERIFY, hwnd, |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_VERIFY, hwnd, |
181 |
clip_verify_dlg_proc, 0, |
clip_verify_dlg_proc, 0, |
182 |
_("Verify"), IDS_WINPT_VERIFY ); |
_("Verify"), IDS_WINPT_VERIFY ); |
183 |
err = gpg_error (GPG_ERR_EOF); /* make sure window is ot updated. */ |
err = gpg_error (GPG_ERR_EOF); /* make sure window is not updated. */ |
184 |
} |
} |
185 |
break; |
break; |
186 |
} |
} |
195 |
gpgme_error_t err; |
gpgme_error_t err; |
196 |
int type; |
int type; |
197 |
|
|
198 |
if( (id == ID_WINPT_SIGN || id == ID_WINPT_SIGNENCRYPT) |
if ((id == ID_WINPT_SIGN || id == ID_WINPT_SIGNENCRYPT) |
199 |
&& gnupg_access_keyring (0) ) { |
&& gnupg_access_keyring (0)) { |
200 |
msg_box( hwnd, _("Could not access secret keyring."), _("Sign"), MB_ERR ); |
msg_box (hwnd, _("Could not access secret keyring."), _("Sign"), MB_ERR); |
201 |
return; |
return; |
202 |
} |
} |
203 |
|
|
204 |
switch( id ) { |
switch( id ) { |
205 |
case ID_WINPT_SYMENC: |
case ID_WINPT_SYMENC: |
206 |
gpg_encrypt_symmetric(); |
gpg_encrypt_symmetric (); |
207 |
break; |
break; |
208 |
|
|
209 |
case ID_WINPT_ENCRYPT: |
case ID_WINPT_ENCRYPT: |
268 |
_("Verify"), IDS_WINPT_VERIFY ); |
_("Verify"), IDS_WINPT_VERIFY ); |
269 |
} |
} |
270 |
else if ((type & PGP_PUBKEY) || (type & PGP_SECKEY)) |
else if ((type & PGP_PUBKEY) || (type & PGP_SECKEY)) |
271 |
km_clip_import (GetDesktopWindow ()); |
km_clip_import (GetDesktopWindow (), NULL, NULL); |
272 |
else |
else |
273 |
msg_box (hwnd, _("Unknown OpenPGP type."), _("Clipboard"), MB_ERR); |
msg_box (hwnd, _("Unknown OpenPGP type."), _("Clipboard"), MB_ERR); |
274 |
} |
} |
275 |
} /* clip_gpg_dlg */ |
} |
276 |
|
|
277 |
|
|
278 |
|
static bool |
279 |
|
secret_key_available (void) |
280 |
|
{ |
281 |
|
gpg_keycache_t sec = keycache_get_ctx (0); |
282 |
|
if (!sec || gpg_keycache_get_size (sec) == 0) |
283 |
|
return false; |
284 |
|
return true; |
285 |
|
} |
286 |
|
|
287 |
|
|
288 |
/* Load the Card Manager with the current card. */ |
/* Load the Card Manager with the current card. */ |
289 |
static void |
static void |
290 |
load_smartcard (void) |
load_card_manager (void) |
291 |
{ |
{ |
292 |
gpg_card_t card; |
gpg_card_t card; |
293 |
|
|
294 |
card = gpg_card_load (); |
card = gpg_card_load (); |
295 |
if (card) { |
if (!card) |
296 |
dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_CARD_EDIT, |
return; |
297 |
GetDesktopWindow (), card_edit_dlg_proc, |
|
298 |
(LPARAM)card, |
dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_CARD_EDIT, |
299 |
_("Card Edit"), IDS_WINPT_CARD_EDIT); |
GetDesktopWindow (), card_edit_dlg_proc, |
300 |
gpg_card_release (card); |
(LPARAM)card, |
301 |
card = NULL; |
_("Card Edit"), IDS_WINPT_CARD_EDIT); |
302 |
} |
gpg_card_release (card); |
303 |
} |
} |
304 |
|
|
305 |
|
|
318 |
} |
} |
319 |
|
|
320 |
|
|
321 |
|
static void |
322 |
|
init_common_controls (void) |
323 |
|
{ |
324 |
|
INITCOMMONCONTROLSEX cce; |
325 |
|
|
326 |
|
/* date control, toolbar, trackbar, ... */ |
327 |
|
cce.dwSize = sizeof (INITCOMMONCONTROLSEX); |
328 |
|
cce.dwICC = ICC_DATE_CLASSES|ICC_BAR_CLASSES; |
329 |
|
InitCommonControlsEx (&cce); |
330 |
|
} |
331 |
|
|
332 |
|
|
333 |
/* Main message loop for the tray window. */ |
/* Main message loop for the tray window. */ |
334 |
LRESULT CALLBACK |
LRESULT CALLBACK |
335 |
winpt_main_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) |
winpt_main_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) |
336 |
{ |
{ |
337 |
static NOTIFYICONDATA NID; |
static NOTIFYICONDATA NID; |
338 |
static int use_hotkey = 0; |
static DWORD cookie; |
339 |
reminder_ctx_s ctx; |
static int use_hotkey = 0; |
340 |
LPARAM param; |
static int manual_shutdown = 0; |
341 |
curr_wnd_ctx currwnd = {0}; |
HWND wnd; |
|
int rc, set_wc = 0, has_data = 0; |
|
|
INITCOMMONCONTROLSEX cce; |
|
342 |
gpgme_error_t err; |
gpgme_error_t err; |
343 |
|
curr_wnd_ctx currwnd = {0}; |
344 |
|
const char *s; |
345 |
|
int rc, set_wc = 0, has_data = 0; |
346 |
|
|
347 |
switch (msg) { |
switch (msg) { |
348 |
case WM_CREATE: |
case WM_CREATE: |
360 |
msg_box (hwnd, _("Could not set current window mode hooks."), |
msg_box (hwnd, _("Could not set current window mode hooks."), |
361 |
_("WinPT Error"), MB_OK); |
_("WinPT Error"), MB_OK); |
362 |
mapi_init (); |
mapi_init (); |
363 |
/* init common controls: date control. */ |
init_common_controls (); |
364 |
cce.dwSize = sizeof (INITCOMMONCONTROLSEX); |
html_help_init (&cookie); |
|
cce.dwICC = ICC_DATE_CLASSES; |
|
|
InitCommonControlsEx (&cce); |
|
365 |
LoadLibrary ("RichEd32.Dll"); |
LoadLibrary ("RichEd32.Dll"); |
366 |
|
manual_shutdown = 0; |
367 |
break; |
break; |
368 |
|
|
369 |
case WM_ENDSESSION: |
case WM_ENDSESSION: |
370 |
case WM_DESTROY: |
case WM_DESTROY: |
371 |
case WM_CLOSE: |
case WM_CLOSE: |
372 |
case WM_QUIT: |
case WM_QUIT: |
|
cryptdisk_cleanup (); |
|
373 |
mapi_deinit (); |
mapi_deinit (); |
374 |
wsock_end (); |
wsock_end (); |
375 |
keycache_release (1); |
keycache_release (1); |
376 |
gnupg_backup_keyrings (); |
gnupg_backup_keyrings (reg_prefs.auto_backup, reg_prefs.backup.mode); |
377 |
free_reg_prefs (); |
free_reg_prefs (); |
378 |
free_gnupg_table (); |
free_gnupg_table (); |
379 |
hotkeys_unregister (hwnd); |
hotkeys_unregister (hwnd); |
|
release_file_lock (&mo_file); |
|
380 |
PTD_delete (); |
PTD_delete (); |
381 |
agent_flush_cache (); |
agent_flush_cache (); |
382 |
|
html_help_deinit (cookie); |
383 |
if (!gpg_clip_istext_avail (&has_data) && has_data) { |
if (!gpg_clip_istext_avail (&has_data) && has_data) { |
384 |
int chk = get_reg_winpt_flag ("WipeClipboard"); |
int chk = get_reg_winpt_flag ("WipeClipboard"); |
385 |
if (chk == -1) |
if (chk == -1 && manual_shutdown) |
386 |
DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_CONFDELCLIP, |
DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_CONFDELCLIP, |
387 |
GetDesktopWindow (), confirm_delclipboard_dlg, |
GetDesktopWindow (), confirm_delclipboard_dlg, |
388 |
0); |
0); |
391 |
wipe_contents = 0; |
wipe_contents = 0; |
392 |
} |
} |
393 |
debug_end (); |
debug_end (); |
|
/*cleanup_tmp_files ();*/ |
|
394 |
Shell_NotifyIcon (NIM_DELETE, &NID); |
Shell_NotifyIcon (NIM_DELETE, &NID); |
395 |
PostQuitMessage (0); |
PostQuitMessage (0); |
396 |
ExitProcess (0); |
ExitProcess (0); |
397 |
return 0; |
break; |
398 |
|
|
399 |
case WM_USER: |
case WM_USER: |
400 |
switch (lparam) { |
switch (lparam) { |
408 |
GetCursorPos (&p); |
GetCursorPos (&p); |
409 |
hm = LoadMenu (glob_hinst, MAKEINTRESOURCE (IDR_WINPT)); |
hm = LoadMenu (glob_hinst, MAKEINTRESOURCE (IDR_WINPT)); |
410 |
popup = GetSubMenu (hm, 0); |
popup = GetSubMenu (hm, 0); |
411 |
#ifndef LANG_DE |
|
412 |
set_menu_text( popup, ID_WINPT_FILE, _("File Manager") ); |
set_menu_text (popup, ID_WINPT_FILE, _("File Manager")); |
413 |
set_menu_text( popup, ID_WINPT_KEY, _("Key Manager") ); |
set_menu_text (popup, ID_WINPT_KEY, _("Key Manager")); |
414 |
set_menu_text( popup, ID_WINPT_CARD, _("Card Manager") ); |
set_menu_text (popup, ID_WINPT_CARD, _("Card Manager")); |
415 |
if (!scard_support) |
if (!scard_support) |
416 |
set_menu_state (popup, ID_WINPT_CARD, MF_DISABLED|MF_GRAYED); |
set_menu_state (popup, ID_WINPT_CARD, MF_DISABLED|MF_GRAYED); |
|
if (!cryptdisk_available ()) { |
|
|
set_menu_state (popup, ID_WINPT_CDISKNEW, MF_DISABLED|MF_GRAYED); |
|
|
set_menu_state (popup, ID_WINPT_CDISKMOUNT, MF_DISABLED|MF_GRAYED); |
|
|
set_menu_state (popup, ID_WINPT_CDISKUNMOUNT, MF_DISABLED|MF_GRAYED); |
|
|
} |
|
|
|
|
417 |
set_menu_text (popup, ID_WINPT_EDIT, _("Edit Clipboard")); |
set_menu_text (popup, ID_WINPT_EDIT, _("Edit Clipboard")); |
418 |
set_menu_text (popup, ID_WINPT_ABOUT, _("About...")); |
set_menu_text (popup, ID_WINPT_ABOUT, _("About...")); |
419 |
set_menu_text (popup, ID_WINPT_QUIT, _("Exit")); |
set_menu_text (popup, ID_WINPT_QUIT, _("Exit")); |
420 |
set_menu_text (popup, ID_WINPT_SYMENC, _("Symmetric")); |
set_menu_text (popup, ID_WINPT_SYMENC, _("Symmetric")); |
421 |
set_menu_text (popup, ID_WINPT_ENCRYPT, _("Encrypt")); |
set_menu_text (popup, ID_WINPT_ENCRYPT, _("Encrypt")); |
422 |
|
set_menu_text (popup, ID_WINPT_SIGN, _("Sign")); |
423 |
set_menu_text (popup, ID_WINPT_SIGNENCRYPT, _("Sign && Encrypt")); |
set_menu_text (popup, ID_WINPT_SIGNENCRYPT, _("Sign && Encrypt")); |
424 |
set_menu_text (popup, ID_WINPT_DECRYPT, _("Decrypt/Verify")); |
set_menu_text (popup, ID_WINPT_DECRYPT, _("Decrypt/Verify")); |
425 |
set_menu_text (popup, ID_WINPT_VERIFY, _("Verify")); |
set_menu_text (popup, ID_WINPT_VERIFY, _("Verify")); |
427 |
set_menu_text (popup, ID_WINPT_CURRWND_SIGNENCRYPT, _("Sign && Encrypt")); |
set_menu_text (popup, ID_WINPT_CURRWND_SIGNENCRYPT, _("Sign && Encrypt")); |
428 |
set_menu_text (popup, ID_WINPT_CURRWND_DECRYPT_VERIFY, _("Decrypt/Verify")); |
set_menu_text (popup, ID_WINPT_CURRWND_DECRYPT_VERIFY, _("Decrypt/Verify")); |
429 |
set_menu_text (popup, ID_WINPT_CURRWND_SIGN, _("Sign")); |
set_menu_text (popup, ID_WINPT_CURRWND_SIGN, _("Sign")); |
430 |
|
if (!secret_key_available ()) { |
431 |
|
set_menu_state (popup, ID_WINPT_SIGN, MF_DISABLED|MF_GRAYED); |
432 |
|
set_menu_state (popup, ID_WINPT_CURRWND_SIGN, MF_DISABLED|MF_GRAYED); |
433 |
|
set_menu_state (popup, ID_WINPT_SIGNENCRYPT, MF_DISABLED|MF_GRAYED); |
434 |
|
set_menu_state (popup, ID_WINPT_CURRWND_SIGNENCRYPT, MF_DISABLED|MF_GRAYED); |
435 |
|
} |
436 |
/* change popup texts */ |
/* change popup texts */ |
437 |
set_menu_text_bypos (popup, 6, _("Clipboard")); |
set_menu_text_bypos (popup, 6, _("Clipboard")); |
438 |
set_menu_text_bypos (popup, 7, _("Current Window")); |
set_menu_text_bypos (popup, 7, _("Current Window")); |
439 |
set_menu_text_bypos (popup, 9, _("Preferences")); |
set_menu_text_bypos (popup, 9, _("Preferences")); |
440 |
|
|
441 |
#endif |
TrackPopupMenu (popup, TPM_RIGHTALIGN, p.x, p.y, 0, hwnd, NULL); |
442 |
TrackPopupMenu( popup, TPM_RIGHTALIGN, p.x, p.y, 0, hwnd, NULL ); |
PostMessage (hwnd, WM_USER, 0, 0); |
443 |
PostMessage( hwnd, WM_USER, 0, 0 ); |
DestroyMenu (popup); |
444 |
DestroyMenu( popup ); |
DestroyMenu (hm); |
|
DestroyMenu( hm ); |
|
445 |
break; |
break; |
446 |
|
|
447 |
case WM_LBUTTONDBLCLK: |
case WM_LBUTTONDBLCLK: |
448 |
SendMessage( hwnd, WM_COMMAND, ID_WINPT_KEY, 0 ); |
gpg_read_only = gpg_check_permissions (0) == 0? 0 : 1; |
449 |
|
SendMessage (hwnd, WM_COMMAND, ID_WINPT_KEY, 0); |
450 |
break; |
break; |
451 |
} |
} |
452 |
break; |
break; |
513 |
case ID_WINPT_SIGN: |
case ID_WINPT_SIGN: |
514 |
case ID_WINPT_SIGNENCRYPT: |
case ID_WINPT_SIGNENCRYPT: |
515 |
case ID_WINPT_DECRYPT_VERIFY: |
case ID_WINPT_DECRYPT_VERIFY: |
516 |
err = gpg_clip_istext_avail( &has_data ); |
err = gpg_clip_istext_avail (&has_data); |
517 |
if( err ) { |
if (err) { |
518 |
msg_box( hwnd, gpgme_strerror( err ),_("Clipboard"), MB_ERR ); |
msg_box (hwnd, gpgme_strerror (err),_("Clipboard"), MB_ERR); |
519 |
break; |
break; |
520 |
} |
} |
521 |
if( !has_data ) { |
if (!has_data) { |
522 |
msg_box( hwnd, winpt_strerror (WPTERR_CLIP_EMPTY),_("Clipboard"), MB_ERR ); |
msg_box (hwnd, winpt_strerror (WPTERR_CLIP_EMPTY), |
523 |
|
_("Clipboard"), MB_ERR); |
524 |
break; |
break; |
525 |
} |
} |
526 |
ctx.msecs = 500; |
clip_gpg_dlg (hwnd, (int)wparam); |
|
window_reminder( &ctx ); |
|
|
clip_gpg_dlg( hwnd, (int)wparam ); |
|
527 |
break; |
break; |
528 |
|
|
529 |
/** Current window operations **/ |
/** Current window operations **/ |
530 |
case ID_WINPT_CURRWND_SYMENC: |
case ID_WINPT_CURRWND_SYMENC: |
531 |
case ID_WINPT_CURRWND_ENCRYPT: |
case ID_WINPT_CURRWND_ENCRYPT: |
540 |
winpt_strerror( WPTERR_CURR_WND ) ); |
winpt_strerror( WPTERR_CURR_WND ) ); |
541 |
break; |
break; |
542 |
} |
} |
543 |
ctx.msecs = 500; |
rc = currwnd_gpg_dlg (hwnd, (UINT)wparam, &set_wc); |
544 |
window_reminder( &ctx ); |
if (!rc && set_wc) |
545 |
rc = currwnd_gpg_dlg( hwnd, (UINT)wparam, &set_wc ); |
set_window_contents (hwnd, &currwnd); |
|
if( !rc && set_wc ) |
|
|
set_window_contents( hwnd, &currwnd ); |
|
546 |
break; |
break; |
547 |
|
|
548 |
/** File handling **/ |
/** File handling **/ |
549 |
case ID_WINPT_FILE: |
case ID_WINPT_FILE: |
550 |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_FILE, |
s = _("File Manager (use drag & drop to add files)"); |
551 |
GetDesktopWindow(), file_manager_dlg_proc, 0, |
wnd = FindWindow (NULL, s); |
552 |
_("File Manager (use drag & drop to add files)"), IDS_WINPT_FILE ); |
if (wnd && IsIconic (wnd)) |
553 |
|
ShowWindow (wnd, SW_RESTORE); |
554 |
|
dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_FILE, |
555 |
|
GetDesktopWindow (), file_manager_dlg_proc, 0, |
556 |
|
s, IDS_WINPT_FILE); |
557 |
break; |
break; |
558 |
|
|
559 |
/** Misc **/ |
/** Misc **/ |
560 |
case ID_WINPT_KEY: |
case ID_WINPT_KEY: |
561 |
param = NULL; |
wnd = FindWindow (NULL, _("Key Manager")); |
562 |
if( cmd ) |
if (wnd && IsIconic (wnd)) |
563 |
param = (LPARAM)cmd; |
ShowWindow (wnd, SW_RESTORE); |
564 |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_KEYMISC, |
if (wnd) |
565 |
GetDesktopWindow(), keymanager_dlg_proc, param, |
SetForegroundWindow (wnd); |
566 |
_("Key Manager"), IDS_WINPT_KEYMISC ); |
dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_KEYMISC, |
567 |
|
GetDesktopWindow(), keymanager_dlg_proc, |
568 |
|
cmd != 0? (LPARAM)cmd : 0, |
569 |
|
_("Key Manager"), IDS_WINPT_KEYMISC); |
570 |
cmd = 0; |
cmd = 0; |
571 |
break; |
break; |
572 |
|
|
573 |
case ID_WINPT_CARD: |
case ID_WINPT_CARD: |
574 |
load_smartcard (); |
load_card_manager (); |
575 |
break; |
break; |
576 |
|
|
577 |
case ID_WINPT_EDIT: |
case ID_WINPT_EDIT: |
593 |
break; |
break; |
594 |
|
|
595 |
case ID_WINPT_GPGPREFS: |
case ID_WINPT_GPGPREFS: |
596 |
dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_GPGPREFS, GetDesktopWindow(), |
rc = dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_GPGPREFS, |
597 |
gpgprefs_dlg_proc, 0, |
GetDesktopWindow(), gpgprefs_dlg_proc, 0, |
598 |
_("GnuPG Preferences"), IDS_WINPT_GPGPREFS); |
_("GnuPG Preferences"), IDS_WINPT_GPGPREFS); |
599 |
|
if (rc == TRUE) |
600 |
|
update_keycache (GetDesktopWindow ()); |
601 |
break; |
break; |
|
|
|
|
case ID_WINPT_CDISKNEW: |
|
|
DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_CDISK_NEW, |
|
|
GetDesktopWindow (), cryptdisk_new_dlg_proc, 0); |
|
|
break; |
|
|
|
|
|
case ID_WINPT_CDISKMOUNT: |
|
|
DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_CDISK_MOUNT, |
|
|
GetDesktopWindow (), cryptdisk_mount_dlg_proc, 0); |
|
|
break; |
|
|
|
|
|
case ID_WINPT_CDISKUNMOUNT: |
|
|
DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_CDISK_UMOUNT, |
|
|
GetDesktopWindow (), cryptdisk_umount_dlg_proc, 0); |
|
|
break; |
|
|
|
|
|
case ID_WINPT_CDISKUMOUNTALL: |
|
|
cryptdisk_unmount (0, 0); |
|
|
break; |
|
602 |
|
|
603 |
case ID_WINPT_QUIT: |
case ID_WINPT_QUIT: |
604 |
|
manual_shutdown = 1; |
605 |
SendMessage (hwnd, WM_DESTROY, 0, 0); |
SendMessage (hwnd, WM_DESTROY, 0, 0); |
606 |
break; |
break; |
607 |
} |
} |