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

Annotation of /trunk/Src/wptMainProc.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 68 - (hide annotations)
Sat Nov 5 12:00:55 2005 UTC (19 years, 3 months ago) by twoaday
File size: 19919 byte(s)
More minor changes to avoid GCC warnings.


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 twoaday 68 gpgme_error_t err = gpg_error (GPG_ERR_NO_ERROR);
152 werner 36 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 twoaday 68 clip_encrypt_dlg_proc, 0,
164 werner 36 _("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 twoaday 68 clip_signenc_dlg_proc, 0,
170 werner 36 _("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 twoaday 68 clip_sign_dlg_proc, 0,
176 werner 36 _("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 twoaday 68 GetDesktopWindow(), clip_edit_dlg_proc, 0,
192 werner 36 _("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 twoaday 68 clip_verify_dlg_proc, 0,
202 werner 36 _("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    
218     if( (id == ID_WINPT_SIGN || id == ID_WINPT_SIGNENCRYPT)
219     && gnupg_access_keyring (0) ) {
220     msg_box( hwnd, _("Could not access secret keyring."), _("Sign"), MB_ERR );
221     return;
222     }
223    
224     switch( id ) {
225     case ID_WINPT_SYMENC:
226     gpg_encrypt_symmetric();
227     break;
228    
229     case ID_WINPT_ENCRYPT:
230     dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_ENCRYPT, hwnd,
231 twoaday 68 clip_encrypt_dlg_proc, 0,
232 werner 36 _("Encryption"), IDS_WINPT_ENCRYPT );
233     break;
234    
235     case ID_WINPT_SIGN:
236     dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_SIGN, hwnd,
237 twoaday 68 clip_sign_dlg_proc, 0,
238 werner 36 _("Signing"), IDS_WINPT_SIGN );
239     break;
240    
241     case ID_WINPT_SIGNENCRYPT:
242     dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_SIGNENC, hwnd,
243 twoaday 68 clip_signenc_dlg_proc, 0,
244 werner 36 _("Sign & Encrypt"), IDS_WINPT_SIGNENC );
245     break;
246    
247     case ID_WINPT_DECRYPT_VERIFY:
248     err = gpg_clip_get_pgptype (&type);
249     if (err) {
250     msg_box( hwnd, gpgme_strerror( err ), _("Clipboard"), MB_ERR );
251     break;
252     }
253     if( (type & PGP_MESSAGE) && !(type & PGP_CLEARSIG) ) {
254     err = clip_decrypt_dlg (hwnd);
255     if (!err && reg_prefs.use_viewer) {
256     dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_CLIPEDIT,
257 twoaday 68 GetDesktopWindow(), clip_edit_dlg_proc, 0,
258 werner 36 _("Clipboard Editor"), IDS_WINPT_CLIPEDIT );
259     }
260     }
261     else if( (type & PGP_SIG) && !(type & PGP_CLEARSIG) ) {
262     text_input_s input;
263     gpgme_data_t sig;
264    
265     memset( &input, 0, sizeof (input) );
266     err = gpg_data_new_from_clipboard (&sig, 0);
267     if( err ) {
268     msg_box( hwnd, gpgme_strerror( err ),_("Verify"), MB_ERR );
269     return;
270     }
271     input.type = 0;
272     dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_TEXT, hwnd,
273     text_input_dlg_proc, (LPARAM)&input,
274     _("Text Input"), IDS_WINPT_TEXT );
275    
276     gpg_data_release_and_set_clipboard( sig, 0 );
277     if( input.length ) {
278     dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_VERIFY, hwnd,
279     clip_verify_dlg_proc, (LPARAM)&input,
280     _("Verify"), IDS_WINPT_VERIFY );
281     input.length = 0;
282     free_if_alloc( input.data );
283     }
284     }
285     else if (type & PGP_CLEARSIG) {
286     dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_VERIFY, hwnd,
287 twoaday 68 clip_verify_dlg_proc, 0,
288 werner 36 _("Verify"), IDS_WINPT_VERIFY );
289     }
290     else if ((type & PGP_PUBKEY) || (type & PGP_SECKEY))
291     km_clip_import (GetDesktopWindow ());
292     else
293     msg_box (hwnd, _("Unknown OpenPGP type."), _("Clipboard"), MB_ERR);
294     }
295     } /* clip_gpg_dlg */
296    
297    
298     /* Load the Card Manager with the current card. */
299     static void
300     load_smartcard (void)
301     {
302     gpg_card_t card;
303    
304     card = gpg_card_load ();
305     if (card) {
306     dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_CARD_EDIT,
307     GetDesktopWindow (), card_edit_dlg_proc,
308     (LPARAM)card,
309     _("Card Edit"), IDS_WINPT_CARD_EDIT);
310     gpg_card_release (card);
311     card = NULL;
312     }
313     }
314    
315    
316     /* Add the winpt symbol to the task bar. */
317     static void
318     add_taskbar_icon (HWND hwnd, NOTIFYICONDATA *nid)
319     {
320     nid->cbSize = sizeof (NOTIFYICONDATA);
321     nid->uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP;
322     nid->uCallbackMessage = WM_USER;
323     nid->hWnd = hwnd;
324     nid->hIcon = LoadIcon (glob_hinst, MAKEINTRESOURCE (IDI_WINPT));
325     strcpy (nid->szTip, "Windows Privacy Tray v"PGM_VERSION);
326     Shell_NotifyIcon (NIM_ADD, nid);
327     DestroyIcon (nid->hIcon);
328     }
329    
330    
331     /* Main message loop for the tray window. */
332     LRESULT CALLBACK
333     winpt_main_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
334     {
335     static NOTIFYICONDATA NID;
336     static int use_hotkey = 0;
337     reminder_ctx_s ctx;
338     LPARAM param;
339     curr_wnd_ctx currwnd = {0};
340     int rc, set_wc = 0, has_data = 0;
341     INITCOMMONCONTROLSEX cce;
342     gpgme_error_t err;
343    
344     switch (msg) {
345     case WM_CREATE:
346     add_taskbar_icon (hwnd, &NID);
347     rc = wsock_init ();
348     if (rc)
349     msg_box (NULL, winpt_strerror (rc), "Winsock2 DLL", MB_ERR);
350     if (!reg_prefs.no_hotkeys) {
351     rc = hotkeys_register (hwnd);
352     if (rc)
353     msg_box (hwnd, hotkeys_strerror (), winpt_strerror (rc), MB_ERR);
354     }
355     rc = PTD_initialize ();
356     if (!rc)
357     msg_box (hwnd, _("Could not set current window mode hooks."),
358     _("WinPT Error"), MB_OK);
359     mapi_init ();
360     /* init common controls: date control. */
361     cce.dwSize = sizeof (INITCOMMONCONTROLSEX);
362     cce.dwICC = ICC_DATE_CLASSES;
363     InitCommonControlsEx (&cce);
364     LoadLibrary ("RichEd32.Dll");
365     break;
366    
367     case WM_ENDSESSION:
368     case WM_DESTROY:
369     case WM_CLOSE:
370     case WM_QUIT:
371     cryptdisk_cleanup ();
372     mapi_deinit ();
373     wsock_end ();
374     keycache_release (1);
375     gnupg_backup_keyrings ();
376     free_reg_prefs ();
377     free_gnupg_table ();
378     hotkeys_unregister (hwnd);
379     release_file_lock (&mo_file);
380     PTD_delete ();
381     agent_flush_cache ();
382     if (!gpg_clip_istext_avail (&has_data) && has_data) {
383     int chk = get_reg_winpt_flag ("WipeClipboard");
384     if (chk == -1)
385     DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_CONFDELCLIP,
386     GetDesktopWindow (), confirm_delclipboard_dlg,
387 twoaday 68 0);
388 werner 36 if (wipe_contents || chk)
389     set_clip_text (NULL, " ", 1);
390     wipe_contents = 0;
391     }
392     debug_end ();
393     /*cleanup_tmp_files ();*/
394     Shell_NotifyIcon (NIM_DELETE, &NID);
395     PostQuitMessage (0);
396     ExitProcess (0);
397     return 0;
398    
399     case WM_USER:
400     switch (lparam) {
401     case WM_RBUTTONUP:
402     HMENU hm, popup;
403     POINT p;
404    
405     gpg_read_only = gpg_check_permissions (0) == 0? 0 : 1;
406    
407     SetForegroundWindow (hwnd);
408     GetCursorPos (&p);
409     hm = LoadMenu (glob_hinst, MAKEINTRESOURCE (IDR_WINPT));
410     popup = GetSubMenu (hm, 0);
411     #ifndef LANG_DE
412     set_menu_text( popup, ID_WINPT_FILE, _("File Manager") );
413     set_menu_text( popup, ID_WINPT_KEY, _("Key Manager") );
414     set_menu_text( popup, ID_WINPT_CARD, _("Card Manager") );
415     if (!scard_support)
416     set_menu_state (popup, ID_WINPT_CARD, MF_DISABLED|MF_GRAYED);
417     if (!cryptdisk_available ()) {
418     set_menu_state (popup, ID_WINPT_CDISKNEW, MF_DISABLED|MF_GRAYED);
419     set_menu_state (popup, ID_WINPT_CDISKMOUNT, MF_DISABLED|MF_GRAYED);
420     set_menu_state (popup, ID_WINPT_CDISKUNMOUNT, MF_DISABLED|MF_GRAYED);
421     }
422    
423     set_menu_text (popup, ID_WINPT_EDIT, _("Edit Clipboard"));
424     set_menu_text (popup, ID_WINPT_ABOUT, _("About..."));
425     set_menu_text (popup, ID_WINPT_QUIT, _("Exit"));
426     set_menu_text (popup, ID_WINPT_SYMENC, _("Symmetric"));
427     set_menu_text (popup, ID_WINPT_ENCRYPT, _("Encrypt"));
428     set_menu_text (popup, ID_WINPT_SIGNENCRYPT, _("Sign && Encrypt"));
429     set_menu_text (popup, ID_WINPT_DECRYPT, _("Decrypt/Verify"));
430     set_menu_text (popup, ID_WINPT_VERIFY, _("Verify"));
431     set_menu_text (popup, ID_WINPT_CURRWND_ENCRYPT, _("Encrypt"));
432     set_menu_text (popup, ID_WINPT_CURRWND_SIGNENCRYPT, _("Sign && Encrypt"));
433     set_menu_text (popup, ID_WINPT_CURRWND_DECRYPT_VERIFY, _("Decrypt/Verify"));
434     set_menu_text (popup, ID_WINPT_CURRWND_SIGN, _("Sign"));
435     /* change popup texts */
436     set_menu_text_bypos (popup, 6, _("Clipboard"));
437     set_menu_text_bypos (popup, 7, _("Current Window"));
438     set_menu_text_bypos (popup, 9, _("Preferences"));
439    
440     #endif
441     TrackPopupMenu( popup, TPM_RIGHTALIGN, p.x, p.y, 0, hwnd, NULL );
442     PostMessage( hwnd, WM_USER, 0, 0 );
443     DestroyMenu( popup );
444     DestroyMenu( hm );
445     break;
446    
447     case WM_LBUTTONDBLCLK:
448     SendMessage( hwnd, WM_COMMAND, ID_WINPT_KEY, 0 );
449     break;
450     }
451     break;
452    
453     case WM_HOTKEY:
454     cmd = 0;
455     switch( wparam ) {
456     case WPT_CLIP_ENCRYPT_ID:
457     SendMessage( hwnd, WM_COMMAND, ID_WINPT_ENCRYPT, 0 );
458     break;
459    
460     case WPT_CLIP_DECRYPT_VERIFY_ID:
461     SendMessage( hwnd, WM_COMMAND, ID_WINPT_DECRYPT_VERIFY, 0 );
462     break;
463    
464     case WPT_CLIP_SIGN_ID:
465     SendMessage( hwnd, WM_COMMAND, ID_WINPT_SIGN, 0 );
466     break;
467    
468     case WPT_CLIP_SIGN_ENCRYPT_ID:
469     SendMessage( hwnd, WM_COMMAND, ID_WINPT_SIGNENCRYPT, 0 );
470     break;
471    
472     case WPT_CURRWND_ENCRYPT_ID:
473     use_hotkey = 1;
474     SendMessage( hwnd, WM_COMMAND, ID_WINPT_CURRWND_ENCRYPT, 0 );
475     break;
476    
477     case WPT_CURRWND_SIGN_ID:
478     use_hotkey = 1;
479     SendMessage( hwnd, WM_COMMAND, ID_WINPT_CURRWND_SIGN, 0 );
480     break;
481    
482     case WPT_CURRWND_SIGN_ENCRYPT_ID:
483     use_hotkey = 1;
484     SendMessage( hwnd, WM_COMMAND, ID_WINPT_CURRWND_SIGNENCRYPT, 0 );
485     break;
486    
487     case WPT_CURRWND_DECRYPT_VERIFY_ID:
488     use_hotkey = 1;
489     SendMessage( hwnd, WM_COMMAND, ID_WINPT_CURRWND_DECRYPT_VERIFY, 0 );
490     break;
491    
492     case WPT_AGENT_FORGET_ID:
493     rc = msg_box( hwnd, _("Remove all passphrases from cache?"),
494     _("WinPT"), MB_YESNO|MB_ICONQUESTION );
495     if( rc == IDYES )
496     agent_flush_cache();
497     break;
498     }
499     break;
500    
501     case WM_COMMAND:
502     if( gnupg_access_keyring( 1 ) ) {
503     if( log_box( "WinPT", MB_ERR|MB_YESNO,
504     _("Could not access public keyring, exit WinPT?") ) == IDYES )
505     SendMessage( hwnd, WM_DESTROY, 0, 0 );
506     break;
507     }
508     switch( wparam ) {
509     /** Clipboard operations **/
510     case ID_WINPT_SYMENC:
511     case ID_WINPT_ENCRYPT:
512     case ID_WINPT_SIGN:
513     case ID_WINPT_SIGNENCRYPT:
514     case ID_WINPT_DECRYPT_VERIFY:
515     err = gpg_clip_istext_avail( &has_data );
516     if( err ) {
517     msg_box( hwnd, gpgme_strerror( err ),_("Clipboard"), MB_ERR );
518     break;
519     }
520     if( !has_data ) {
521     msg_box( hwnd, winpt_strerror (WPTERR_CLIP_EMPTY),_("Clipboard"), MB_ERR );
522     break;
523     }
524     ctx.msecs = 500;
525     window_reminder( &ctx );
526     clip_gpg_dlg( hwnd, (int)wparam );
527     break;
528    
529     /** Current window operations **/
530     case ID_WINPT_CURRWND_SYMENC:
531     case ID_WINPT_CURRWND_ENCRYPT:
532     case ID_WINPT_CURRWND_SIGNENCRYPT:
533     case ID_WINPT_CURRWND_DECRYPT_VERIFY:
534     case ID_WINPT_CURRWND_SIGN:
535     rc = get_window_contents( hwnd, &currwnd, &use_hotkey );
536     if( rc ) {
537     log_box( _("WinPT Error"), MB_ERR,
538     _("Make sure that the window contains text.\n"
539     "%s."),
540     winpt_strerror( WPTERR_CURR_WND ) );
541     break;
542     }
543     ctx.msecs = 500;
544     window_reminder( &ctx );
545     rc = currwnd_gpg_dlg( hwnd, (UINT)wparam, &set_wc );
546     if( !rc && set_wc )
547     set_window_contents( hwnd, &currwnd );
548     break;
549    
550     /** File handling **/
551     case ID_WINPT_FILE:
552     dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_FILE,
553 twoaday 68 GetDesktopWindow(), file_manager_dlg_proc, 0,
554 werner 36 _("File Manager (use drag & drop to add files)"), IDS_WINPT_FILE );
555     break;
556    
557     /** Misc **/
558     case ID_WINPT_KEY:
559     param = NULL;
560     if( cmd )
561     param = (LPARAM)cmd;
562     dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_KEYMISC,
563     GetDesktopWindow(), keymanager_dlg_proc, param,
564     _("Key Manager"), IDS_WINPT_KEYMISC );
565     cmd = 0;
566     break;
567    
568     case ID_WINPT_CARD:
569     load_smartcard ();
570     break;
571    
572     case ID_WINPT_EDIT:
573     dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_CLIPEDIT,
574 twoaday 68 GetDesktopWindow(), clip_edit_dlg_proc, 0,
575 werner 36 _("Clipboard Editor"), IDS_WINPT_CLIPEDIT );
576     break;
577    
578     case ID_WINPT_ABOUT:
579     dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_ABOUT, GetDesktopWindow(),
580 twoaday 68 about_winpt_dlg_proc, 0,
581 werner 36 _("About WinPT"), IDS_WINPT_ABOUT );
582     break;
583    
584     case ID_WINPT_PREFS:
585     dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_PREFS, GetDesktopWindow(),
586 twoaday 68 prefs_dlg_proc, 0,
587 werner 36 _("WinPT Preferences"), IDS_WINPT_PREFS );
588     break;
589    
590     case ID_WINPT_GPGPREFS:
591     dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_GPGPREFS, GetDesktopWindow(),
592 twoaday 68 gpgprefs_dlg_proc, 0,
593 werner 36 _("GnuPG Preferences"), IDS_WINPT_GPGPREFS);
594     break;
595    
596     case ID_WINPT_CDISKNEW:
597     DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_CDISK_NEW,
598 twoaday 68 GetDesktopWindow (), cryptdisk_new_dlg_proc, 0);
599 werner 36 break;
600    
601     case ID_WINPT_CDISKMOUNT:
602     DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_CDISK_MOUNT,
603 twoaday 68 GetDesktopWindow (), cryptdisk_mount_dlg_proc, 0);
604 werner 36 break;
605    
606     case ID_WINPT_CDISKUNMOUNT:
607     DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_CDISK_UMOUNT,
608 twoaday 68 GetDesktopWindow (), cryptdisk_umount_dlg_proc, 0);
609 werner 36 break;
610    
611     case ID_WINPT_CDISKUMOUNTALL:
612     cryptdisk_unmount (0, 0);
613     break;
614    
615     case ID_WINPT_QUIT:
616     SendMessage (hwnd, WM_DESTROY, 0, 0);
617     break;
618     }
619     break;
620     }
621    
622     return DefWindowProc (hwnd, msg, wparam, lparam);
623     }

Properties

Name Value
svn:eol-style native

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26