/[winpt]/trunk/Src/wptMainProc.cpp
ViewVC logotype

Annotation of /trunk/Src/wptMainProc.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 48 - (hide annotations)
Mon Oct 31 21:14:11 2005 UTC (19 years, 4 months ago) by werner
File size: 19991 byte(s)
More changes.  Compiles again but there are at least gettext issues with
w32-gettext.c.  I can't get a gpg-error build with ENABLE_NLS.

1 werner 36 /* wptMainProc.cpp - Main window procedure
2     * Copyright (C) 2000-2005 Timo Schulz
3     *
4     * This file is part of WinPT.
5     *
6     * WinPT is free software; you can redistribute it and/or modify
7     * it under the terms of the GNU General Public License as published by
8     * the Free Software Foundation; either version 2 of the License, or
9     * (at your option) any later version.
10     *
11     * WinPT is distributed in the hope that it will be useful,
12     * but WITHOUT ANY WARRANTY; without even the implied warranty of
13     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14     * GNU General Public License for more details.
15     *
16     * You should have received a copy of the GNU General Public License
17     * along with WinPT; if not, write to the Free Software Foundation,
18     * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19     */
20    
21     #ifdef HAVE_CONFIG_H
22     #include <config.h>
23     #endif
24    
25     #include <windows.h>
26     #include <commctrl.h>
27     #include <io.h>
28    
29 werner 47 #include "resource.h"
30 werner 36 #include "wptTypes.h"
31     #include "wptGPG.h"
32     #include "wptW32API.h"
33     #include "wptVersion.h"
34     #include "wptCommonCtl.h"
35     #include "wptContext.h" /* for passphrase_s */
36     #include "wptDlgs.h"
37     #include "wptErrors.h"
38     #include "wptNLS.h"
39     #include "wptHotkey.h"
40     #include "wptRegistry.h"
41     #include "wptKeyserver.h"
42     #include "wptAgent.h"
43     #include "wptKeyManager.h"
44     #include "wptCard.h"
45     #include "wptCryptdisk.h"
46     #include "wptCardEdit.h"
47 werner 48 #include "wptCrypto.h"
48 werner 36
49     extern HWND activ_hwnd;
50     static int cmd = 0;
51     static int wipe_contents = 0;
52    
53    
54     /* Dialog box procedure to display all insecure all ElGamal keys. */
55     BOOL CALLBACK
56     elgamal_warn_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)
57     {
58     gpg_keycache_t pc;
59     gpgme_key_t key;
60     char tmp[128+64+1];
61    
62     switch( msg ) {
63     case WM_INITDIALOG:
64     pc = keycache_get_ctx (1);
65     while (!gpg_keycache_next_key (pc, 0, &key)) {
66     if (key->subkeys->pubkey_algo == GPGME_PK_ELG) {
67     _snprintf (tmp, sizeof (tmp)-1, "(0x%s) %s",
68     key->subkeys->keyid+8, key->uids->uid);
69     SendDlgItemMessage (dlg, IDC_ELGWARN_LIST, LB_ADDSTRING,
70     0, (LPARAM)(const char *) tmp);
71     }
72     }
73     gpg_keycache_rewind (pc);
74     center_window (dlg, NULL);
75     SetForegroundWindow (dlg);
76     break;
77    
78     case WM_COMMAND:
79     switch (LOWORD (wparam)) {
80     case IDOK:
81     EndDialog (dlg, TRUE);
82     break;
83     }
84     break;
85     }
86     return FALSE;
87 twoaday 32 }
88 werner 36
89    
90     /* @unused
91     static int
92     cleanup_tmp_files (void)
93     {
94     struct _finddata_t dat;
95     char tmp[384];
96     long hd;
97    
98     if (GetTempPath (sizeof (tmp)-1, tmp) == FALSE ||
99     SetCurrentDirectory (tmp) == FALSE) {
100     winpt_errmsg ("GetTempPath", 0);
101     return WPTERR_GENERAL;
102     }
103     hd = _findfirst ("gpgmeOUT*", &dat);
104     if (hd == -1)
105     return 0;
106     do {
107     secure_unlink (dat.name, WIPE_MODE_SIMPLE);
108     } while (_findnext (hd, &dat) == 0);
109     _findclose (hd);
110     return 0;
111     }
112     */
113    
114    
115     /* Dialog box procedure to confirm to delete the clipboard contents. */
116     static BOOL CALLBACK
117     confirm_delclipboard_dlg (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)
118     {
119     switch (msg) {
120     case WM_INITDIALOG:
121     SetWindowText (dlg, _("Delete Clipboard Contents"));
122     center_window (dlg, NULL);
123     SetForegroundWindow (dlg);
124     break;
125    
126     case WM_COMMAND:
127     switch (LOWORD (wparam)) {
128     case IDYES:
129     wipe_contents = 1;
130     if (IsDlgButtonChecked (dlg, IDC_CONFDELCLIP_BRAIN))
131     set_reg_winpt_flag ("WipeClipboard", 1);
132     EndDialog (dlg, TRUE);
133     break;
134    
135     case IDNO:
136     wipe_contents = 0;
137     if (IsDlgButtonChecked (dlg, IDC_CONFDELCLIP_BRAIN))
138     set_reg_winpt_flag ("WipeClipboard", 0);
139     EndDialog (dlg, FALSE);
140     break;
141     }
142     break;
143     }
144     return FALSE;
145     }
146    
147    
148     static gpgme_error_t
149     currwnd_gpg_dlg (HWND hwnd, UINT id, int *ret_set)
150     {
151     gpgme_error_t err;
152     int type;
153    
154     if (ret_set)
155     *ret_set = 1;
156     switch (id) {
157     case ID_WINPT_CURRWND_SYMENC:
158     gpg_encrypt_symmetric ();
159     break;
160    
161     case ID_WINPT_CURRWND_ENCRYPT:
162     dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_ENCRYPT, hwnd,
163     clip_encrypt_dlg_proc, NULL,
164     _("Encryption"), IDS_WINPT_ENCRYPT );
165     break;
166    
167     case ID_WINPT_CURRWND_SIGNENCRYPT:
168     dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_SIGNENC, hwnd,
169     clip_signenc_dlg_proc, NULL,
170     _("Sign & Encrypt"), IDS_WINPT_SIGNENC );
171     break;
172    
173     case ID_WINPT_CURRWND_SIGN:
174     dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_SIGN, hwnd,
175     clip_sign_dlg_proc, NULL,
176     _("Signing"), IDS_WINPT_SIGN );
177     break;
178    
179     case ID_WINPT_CURRWND_DECRYPT_VERIFY:
180     err = gpg_clip_get_pgptype (&type);
181     if (err) {
182     msg_box (hwnd, gpgme_strerror (err), _("Clipboard"), MB_ERR);
183     break;
184     }
185     if( (type & PGP_MESSAGE) && !(type & PGP_CLEARSIG) ) {
186     /* It makes only sense to insert the data in the window if it's
187     really a ciphertext. Verfied data doesn't need this. */
188     err = clip_decrypt_dlg (hwnd);
189     if (!err && reg_prefs.use_viewer) {
190     dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_CLIPEDIT,
191     GetDesktopWindow(), clip_edit_dlg_proc, NULL,
192     _("Clipboard Editor"), IDS_WINPT_CLIPEDIT);
193     if (ret_set)
194     *ret_set = 0;
195     }
196     }
197     else if ((type & PGP_PUBKEY) && !(type & PGP_CLEARSIG))
198     km_clip_import (GetDesktopWindow ());
199     else {
200     dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_VERIFY, hwnd,
201     clip_verify_dlg_proc, NULL,
202     _("Verify"), IDS_WINPT_VERIFY );
203     err = gpg_error (GPG_ERR_EOF); /* make sure window is ot updated. */
204     }
205     break;
206     }
207    
208     return err;
209     }
210    
211    
212     static void
213     clip_gpg_dlg (HWND hwnd, UINT id)
214     {
215     gpgme_error_t err;
216     int type;
217     size_t size = 0;
218    
219     if( (id == ID_WINPT_SIGN || id == ID_WINPT_SIGNENCRYPT)
220     && gnupg_access_keyring (0) ) {
221     msg_box( hwnd, _("Could not access secret keyring."), _("Sign"), MB_ERR );
222     return;
223     }
224    
225     switch( id ) {
226     case ID_WINPT_SYMENC:
227     gpg_encrypt_symmetric();
228     break;
229    
230     case ID_WINPT_ENCRYPT:
231     dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_ENCRYPT, hwnd,
232     clip_encrypt_dlg_proc, NULL,
233     _("Encryption"), IDS_WINPT_ENCRYPT );
234     break;
235    
236     case ID_WINPT_SIGN:
237     dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_SIGN, hwnd,
238     clip_sign_dlg_proc, NULL,
239     _("Signing"), IDS_WINPT_SIGN );
240     break;
241    
242     case ID_WINPT_SIGNENCRYPT:
243     dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_SIGNENC, hwnd,
244     clip_signenc_dlg_proc, NULL,
245     _("Sign & Encrypt"), IDS_WINPT_SIGNENC );
246     break;
247    
248     case ID_WINPT_DECRYPT_VERIFY:
249     err = gpg_clip_get_pgptype (&type);
250     if (err) {
251     msg_box( hwnd, gpgme_strerror( err ), _("Clipboard"), MB_ERR );
252     break;
253     }
254     if( (type & PGP_MESSAGE) && !(type & PGP_CLEARSIG) ) {
255     err = clip_decrypt_dlg (hwnd);
256     if (!err && reg_prefs.use_viewer) {
257     dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_CLIPEDIT,
258     GetDesktopWindow(), clip_edit_dlg_proc, NULL,
259     _("Clipboard Editor"), IDS_WINPT_CLIPEDIT );
260     }
261     }
262     else if( (type & PGP_SIG) && !(type & PGP_CLEARSIG) ) {
263     text_input_s input;
264     gpgme_data_t sig;
265    
266     memset( &input, 0, sizeof (input) );
267     err = gpg_data_new_from_clipboard (&sig, 0);
268     if( err ) {
269     msg_box( hwnd, gpgme_strerror( err ),_("Verify"), MB_ERR );
270     return;
271     }
272     input.type = 0;
273     dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_TEXT, hwnd,
274     text_input_dlg_proc, (LPARAM)&input,
275     _("Text Input"), IDS_WINPT_TEXT );
276    
277     gpg_data_release_and_set_clipboard( sig, 0 );
278     if( input.length ) {
279     dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_VERIFY, hwnd,
280     clip_verify_dlg_proc, (LPARAM)&input,
281     _("Verify"), IDS_WINPT_VERIFY );
282     input.length = 0;
283     free_if_alloc( input.data );
284     }
285     }
286     else if (type & PGP_CLEARSIG) {
287     dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_VERIFY, hwnd,
288     clip_verify_dlg_proc, NULL,
289     _("Verify"), IDS_WINPT_VERIFY );
290     }
291     else if ((type & PGP_PUBKEY) || (type & PGP_SECKEY))
292     km_clip_import (GetDesktopWindow ());
293     else
294     msg_box (hwnd, _("Unknown OpenPGP type."), _("Clipboard"), MB_ERR);
295     }
296     } /* clip_gpg_dlg */
297    
298    
299     /* Load the Card Manager with the current card. */
300     static void
301     load_smartcard (void)
302     {
303     gpg_card_t card;
304    
305     card = gpg_card_load ();
306     if (card) {
307     dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_CARD_EDIT,
308     GetDesktopWindow (), card_edit_dlg_proc,
309     (LPARAM)card,
310     _("Card Edit"), IDS_WINPT_CARD_EDIT);
311     gpg_card_release (card);
312     card = NULL;
313     }
314     }
315    
316    
317     /* Add the winpt symbol to the task bar. */
318     static void
319     add_taskbar_icon (HWND hwnd, NOTIFYICONDATA *nid)
320     {
321     nid->cbSize = sizeof (NOTIFYICONDATA);
322     nid->uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP;
323     nid->uCallbackMessage = WM_USER;
324     nid->hWnd = hwnd;
325     nid->hIcon = LoadIcon (glob_hinst, MAKEINTRESOURCE (IDI_WINPT));
326     strcpy (nid->szTip, "Windows Privacy Tray v"PGM_VERSION);
327     Shell_NotifyIcon (NIM_ADD, nid);
328     DestroyIcon (nid->hIcon);
329     }
330    
331    
332     /* Main message loop for the tray window. */
333     LRESULT CALLBACK
334     winpt_main_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
335     {
336     static NOTIFYICONDATA NID;
337     static int use_hotkey = 0;
338     reminder_ctx_s ctx;
339     LPARAM param;
340     curr_wnd_ctx currwnd = {0};
341     size_t size = 0;
342     int rc, set_wc = 0, has_data = 0;
343     INITCOMMONCONTROLSEX cce;
344     gpgme_error_t err;
345    
346     switch (msg) {
347     case WM_CREATE:
348     add_taskbar_icon (hwnd, &NID);
349     rc = wsock_init ();
350     if (rc)
351     msg_box (NULL, winpt_strerror (rc), "Winsock2 DLL", MB_ERR);
352     if (!reg_prefs.no_hotkeys) {
353     rc = hotkeys_register (hwnd);
354     if (rc)
355     msg_box (hwnd, hotkeys_strerror (), winpt_strerror (rc), MB_ERR);
356     }
357     rc = PTD_initialize ();
358     if (!rc)
359     msg_box (hwnd, _("Could not set current window mode hooks."),
360     _("WinPT Error"), MB_OK);
361     mapi_init ();
362     /* init common controls: date control. */
363     cce.dwSize = sizeof (INITCOMMONCONTROLSEX);
364     cce.dwICC = ICC_DATE_CLASSES;
365     InitCommonControlsEx (&cce);
366     LoadLibrary ("RichEd32.Dll");
367     break;
368    
369     case WM_ENDSESSION:
370     case WM_DESTROY:
371     case WM_CLOSE:
372     case WM_QUIT:
373     cryptdisk_cleanup ();
374     mapi_deinit ();
375     wsock_end ();
376     keycache_release (1);
377     gnupg_backup_keyrings ();
378     free_reg_prefs ();
379     free_gnupg_table ();
380     hotkeys_unregister (hwnd);
381     release_file_lock (&mo_file);
382     PTD_delete ();
383     agent_flush_cache ();
384     if (!gpg_clip_istext_avail (&has_data) && has_data) {
385     int chk = get_reg_winpt_flag ("WipeClipboard");
386     if (chk == -1)
387     DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_CONFDELCLIP,
388     GetDesktopWindow (), confirm_delclipboard_dlg,
389     NULL);
390     if (wipe_contents || chk)
391     set_clip_text (NULL, " ", 1);
392     wipe_contents = 0;
393     }
394     debug_end ();
395     /*cleanup_tmp_files ();*/
396     Shell_NotifyIcon (NIM_DELETE, &NID);
397     PostQuitMessage (0);
398     ExitProcess (0);
399     return 0;
400    
401     case WM_USER:
402     switch (lparam) {
403     case WM_RBUTTONUP:
404     HMENU hm, popup;
405     POINT p;
406    
407     gpg_read_only = gpg_check_permissions (0) == 0? 0 : 1;
408    
409     SetForegroundWindow (hwnd);
410     GetCursorPos (&p);
411     hm = LoadMenu (glob_hinst, MAKEINTRESOURCE (IDR_WINPT));
412     popup = GetSubMenu (hm, 0);
413     #ifndef LANG_DE
414     set_menu_text( popup, ID_WINPT_FILE, _("File Manager") );
415     set_menu_text( popup, ID_WINPT_KEY, _("Key Manager") );
416     set_menu_text( popup, ID_WINPT_CARD, _("Card Manager") );
417     if (!scard_support)
418     set_menu_state (popup, ID_WINPT_CARD, MF_DISABLED|MF_GRAYED);
419     if (!cryptdisk_available ()) {
420     set_menu_state (popup, ID_WINPT_CDISKNEW, MF_DISABLED|MF_GRAYED);
421     set_menu_state (popup, ID_WINPT_CDISKMOUNT, MF_DISABLED|MF_GRAYED);
422     set_menu_state (popup, ID_WINPT_CDISKUNMOUNT, MF_DISABLED|MF_GRAYED);
423     }
424    
425     set_menu_text (popup, ID_WINPT_EDIT, _("Edit Clipboard"));
426     set_menu_text (popup, ID_WINPT_ABOUT, _("About..."));
427     set_menu_text (popup, ID_WINPT_QUIT, _("Exit"));
428     set_menu_text (popup, ID_WINPT_SYMENC, _("Symmetric"));
429     set_menu_text (popup, ID_WINPT_ENCRYPT, _("Encrypt"));
430     set_menu_text (popup, ID_WINPT_SIGNENCRYPT, _("Sign && Encrypt"));
431     set_menu_text (popup, ID_WINPT_DECRYPT, _("Decrypt/Verify"));
432     set_menu_text (popup, ID_WINPT_VERIFY, _("Verify"));
433     set_menu_text (popup, ID_WINPT_CURRWND_ENCRYPT, _("Encrypt"));
434     set_menu_text (popup, ID_WINPT_CURRWND_SIGNENCRYPT, _("Sign && Encrypt"));
435     set_menu_text (popup, ID_WINPT_CURRWND_DECRYPT_VERIFY, _("Decrypt/Verify"));
436     set_menu_text (popup, ID_WINPT_CURRWND_SIGN, _("Sign"));
437     /* change popup texts */
438     set_menu_text_bypos (popup, 6, _("Clipboard"));
439     set_menu_text_bypos (popup, 7, _("Current Window"));
440     set_menu_text_bypos (popup, 9, _("Preferences"));
441    
442     #endif
443     TrackPopupMenu( popup, TPM_RIGHTALIGN, p.x, p.y, 0, hwnd, NULL );
444     PostMessage( hwnd, WM_USER, 0, 0 );
445     DestroyMenu( popup );
446     DestroyMenu( hm );
447     break;
448    
449     case WM_LBUTTONDBLCLK:
450     SendMessage( hwnd, WM_COMMAND, ID_WINPT_KEY, 0 );
451     break;
452     }
453     break;
454    
455     case WM_HOTKEY:
456     cmd = 0;
457     switch( wparam ) {
458     case WPT_CLIP_ENCRYPT_ID:
459     SendMessage( hwnd, WM_COMMAND, ID_WINPT_ENCRYPT, 0 );
460     break;
461    
462     case WPT_CLIP_DECRYPT_VERIFY_ID:
463     SendMessage( hwnd, WM_COMMAND, ID_WINPT_DECRYPT_VERIFY, 0 );
464     break;
465    
466     case WPT_CLIP_SIGN_ID:
467     SendMessage( hwnd, WM_COMMAND, ID_WINPT_SIGN, 0 );
468     break;
469    
470     case WPT_CLIP_SIGN_ENCRYPT_ID:
471     SendMessage( hwnd, WM_COMMAND, ID_WINPT_SIGNENCRYPT, 0 );
472     break;
473    
474     case WPT_CURRWND_ENCRYPT_ID:
475     use_hotkey = 1;
476     SendMessage( hwnd, WM_COMMAND, ID_WINPT_CURRWND_ENCRYPT, 0 );
477     break;
478    
479     case WPT_CURRWND_SIGN_ID:
480     use_hotkey = 1;
481     SendMessage( hwnd, WM_COMMAND, ID_WINPT_CURRWND_SIGN, 0 );
482     break;
483    
484     case WPT_CURRWND_SIGN_ENCRYPT_ID:
485     use_hotkey = 1;
486     SendMessage( hwnd, WM_COMMAND, ID_WINPT_CURRWND_SIGNENCRYPT, 0 );
487     break;
488    
489     case WPT_CURRWND_DECRYPT_VERIFY_ID:
490     use_hotkey = 1;
491     SendMessage( hwnd, WM_COMMAND, ID_WINPT_CURRWND_DECRYPT_VERIFY, 0 );
492     break;
493    
494     case WPT_AGENT_FORGET_ID:
495     rc = msg_box( hwnd, _("Remove all passphrases from cache?"),
496     _("WinPT"), MB_YESNO|MB_ICONQUESTION );
497     if( rc == IDYES )
498     agent_flush_cache();
499     break;
500     }
501     break;
502    
503     case WM_COMMAND:
504     if( gnupg_access_keyring( 1 ) ) {
505     if( log_box( "WinPT", MB_ERR|MB_YESNO,
506     _("Could not access public keyring, exit WinPT?") ) == IDYES )
507     SendMessage( hwnd, WM_DESTROY, 0, 0 );
508     break;
509     }
510     switch( wparam ) {
511     /** Clipboard operations **/
512     case ID_WINPT_SYMENC:
513     case ID_WINPT_ENCRYPT:
514     case ID_WINPT_SIGN:
515     case ID_WINPT_SIGNENCRYPT:
516     case ID_WINPT_DECRYPT_VERIFY:
517     err = gpg_clip_istext_avail( &has_data );
518     if( err ) {
519     msg_box( hwnd, gpgme_strerror( err ),_("Clipboard"), MB_ERR );
520     break;
521     }
522     if( !has_data ) {
523     msg_box( hwnd, winpt_strerror (WPTERR_CLIP_EMPTY),_("Clipboard"), MB_ERR );
524     break;
525     }
526     ctx.msecs = 500;
527     window_reminder( &ctx );
528     clip_gpg_dlg( hwnd, (int)wparam );
529     break;
530    
531     /** Current window operations **/
532     case ID_WINPT_CURRWND_SYMENC:
533     case ID_WINPT_CURRWND_ENCRYPT:
534     case ID_WINPT_CURRWND_SIGNENCRYPT:
535     case ID_WINPT_CURRWND_DECRYPT_VERIFY:
536     case ID_WINPT_CURRWND_SIGN:
537     rc = get_window_contents( hwnd, &currwnd, &use_hotkey );
538     if( rc ) {
539     log_box( _("WinPT Error"), MB_ERR,
540     _("Make sure that the window contains text.\n"
541     "%s."),
542     winpt_strerror( WPTERR_CURR_WND ) );
543     break;
544     }
545     ctx.msecs = 500;
546     window_reminder( &ctx );
547     rc = currwnd_gpg_dlg( hwnd, (UINT)wparam, &set_wc );
548     if( !rc && set_wc )
549     set_window_contents( hwnd, &currwnd );
550     break;
551    
552     /** File handling **/
553     case ID_WINPT_FILE:
554     dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_FILE,
555     GetDesktopWindow(), file_manager_dlg_proc, NULL,
556     _("File Manager (use drag & drop to add files)"), IDS_WINPT_FILE );
557     break;
558    
559     /** Misc **/
560     case ID_WINPT_KEY:
561     param = NULL;
562     if( cmd )
563     param = (LPARAM)cmd;
564     dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_KEYMISC,
565     GetDesktopWindow(), keymanager_dlg_proc, param,
566     _("Key Manager"), IDS_WINPT_KEYMISC );
567     cmd = 0;
568     break;
569    
570     case ID_WINPT_CARD:
571     load_smartcard ();
572     break;
573    
574     case ID_WINPT_EDIT:
575     dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_CLIPEDIT,
576     GetDesktopWindow(), clip_edit_dlg_proc, NULL,
577     _("Clipboard Editor"), IDS_WINPT_CLIPEDIT );
578     break;
579    
580     case ID_WINPT_ABOUT:
581     dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_ABOUT, GetDesktopWindow(),
582     about_winpt_dlg_proc, NULL,
583     _("About WinPT"), IDS_WINPT_ABOUT );
584     break;
585    
586     case ID_WINPT_PREFS:
587     dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_PREFS, GetDesktopWindow(),
588     prefs_dlg_proc, NULL,
589     _("WinPT Preferences"), IDS_WINPT_PREFS );
590     break;
591    
592     case ID_WINPT_GPGPREFS:
593     dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_GPGPREFS, GetDesktopWindow(),
594     gpgprefs_dlg_proc, NULL,
595     _("GnuPG Preferences"), IDS_WINPT_GPGPREFS);
596     break;
597    
598     case ID_WINPT_CDISKNEW:
599     DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_CDISK_NEW,
600     GetDesktopWindow (), cryptdisk_new_dlg_proc, NULL);
601     break;
602    
603     case ID_WINPT_CDISKMOUNT:
604     DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_CDISK_MOUNT,
605     GetDesktopWindow (), cryptdisk_mount_dlg_proc, NULL);
606     break;
607    
608     case ID_WINPT_CDISKUNMOUNT:
609     DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_CDISK_UMOUNT,
610     GetDesktopWindow (), cryptdisk_umount_dlg_proc, NULL);
611     break;
612    
613     case ID_WINPT_CDISKUMOUNTALL:
614     cryptdisk_unmount (0, 0);
615     break;
616    
617     case ID_WINPT_QUIT:
618     SendMessage (hwnd, WM_DESTROY, 0, 0);
619     break;
620     }
621     break;
622     }
623    
624     return DefWindowProc (hwnd, msg, wparam, lparam);
625     }

Properties

Name Value
svn:eol-style native

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26