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

Diff of /trunk/Src/wptMainProc.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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

Legend:
Removed from v.24  
changed lines
  Added in v.225

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26