TRACEPOINT();
decrypt_key_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam){  /* Fixme: We should not use a static here but keep it in an array     index by DLG. */  static struct dialog_context_s *context;   struct decrypt_key_s *dec;  size_t n;  if (msg == WM_INITDIALOG)    {      context = (struct dialog_context_s *)lparam;      context->hide_state = 1;      dec = context->dec;      TRACEPOINT();      if (dec && context->use_as_cb)         {          dec->opts = 0;          dec->pass = NULL;          set_key_hint (dec, dlg, IDC_DEC_KEYLIST);          EnableWindow (GetDlgItem (dlg, IDC_DEC_KEYLIST), FALSE);	}      if (dec && dec->last_was_bad)        SetDlgItemText (dlg, IDC_DEC_HINT,                         (dec && dec->last_was_bad)?                        _("Invalid passphrase; please try again..."):"");      TRACEPOINT();      if (dec && !context->use_as_cb)        context->keyarray = load_secbox (dlg, IDC_DEC_KEYLIST);      TRACEPOINT();      CheckDlgButton (dlg, IDC_DEC_HIDE, BST_CHECKED);      center_window (dlg, NULL);      if (dec && dec->hide_pwd)         {          ShowWindow (GetDlgItem (dlg, IDC_DEC_HIDE), SW_HIDE);          ShowWindow (GetDlgItem (dlg, IDC_DEC_PASS), SW_HIDE);          ShowWindow (GetDlgItem (dlg, IDC_DEC_PASSINF), SW_HIDE);	}      else        SetFocus (GetDlgItem (dlg, IDC_DEC_PASS));      SetForegroundWindow (dlg);      return FALSE;    }  if (!context)    return FALSE;  dec = context->dec;  switch (msg)     {    case WM_DESTROY:      context->hide_state = 1;      break;    case WM_SYSCOMMAND:      if (wparam == SC_CLOSE)        EndDialog (dlg, TRUE);      break;    case WM_COMMAND:      switch (HIWORD (wparam))         {	case BN_CLICKED:          if ((int)LOWORD (wparam) == IDC_DEC_HIDE)            {              HWND hwnd;              context->hide_state ^= 1;              hwnd = GetDlgItem (dlg, IDC_DEC_PASS);              SendMessage (hwnd, EM_SETPASSWORDCHAR,                           context->hide_state? '*' : 0, 0);              SetFocus (hwnd);	    }          break;	}      switch (LOWORD (wparam))         {	case IDOK:          n = SendDlgItemMessage (dlg, IDC_DEC_PASS, WM_GETTEXTLENGTH, 0, 0);          if (n && dec)             {              dec->pass = xmalloc (n + 2);              GetDlgItemText (dlg, IDC_DEC_PASS, dec->pass, n+1);	    }          if (dec && !context->use_as_cb)             {              int idx, pos;              idx = SendDlgItemMessage (dlg, IDC_DEC_KEYLIST,                                        CB_GETCURSEL, 0, 0);              pos = SendDlgItemMessage (dlg, IDC_DEC_KEYLIST,                                        CB_GETITEMDATA, idx, 0);              if (pos >= 0 && pos < count_keys (context->keyarray))                {                  dec->signer = context->keyarray[pos];                  gpgme_key_ref (dec->signer);                }	    }          EndDialog (dlg, TRUE);          break;          	case IDCANCEL:          if (dec && context->use_as_cb && (dec->flags & 0x01))             {              const char *warn = _("If you cancel this dialog, the message"                                   " will be sent without signing.\n\n"                                   "Do you really want to cancel?");              n = MessageBox (dlg, warn, "Secret Key Dialog",                              MB_ICONWARNING|MB_YESNO);              if (n == IDNO)                return FALSE;	    }          if (dec)            {              dec->opts = OPT_FLAG_CANCEL;              dec->pass = NULL;            }          EndDialog (dlg, FALSE);          break;	}      break; /*WM_COMMAND*/    }  return FALSE;}