1 |
/* wptCardDlg.cpp - Smart Card support |
/* wptCardDlg.cpp - Smart Card support |
2 |
* Copyright (C) 2003-2007 Timo Schulz |
* Copyright (C) 2003-2007, 2009 Timo Schulz |
3 |
* Copyright (C) 2005 g10 Code GmbH |
* Copyright (C) 2005 g10 Code GmbH |
4 |
* |
* |
5 |
* This file is part of WinPT. |
* This file is part of WinPT. |
55 |
static pin_cb_ctx_s pincb; |
static pin_cb_ctx_s pincb; |
56 |
|
|
57 |
/* Attribute table. */ |
/* Attribute table. */ |
58 |
struct { |
struct attr_tab_s { |
59 |
int ctlid; |
int ctlid; |
60 |
const char *err; |
const char *err; |
61 |
} attr_tab[] = { |
}; |
62 |
|
static struct attr_tab_s attr_tab[] = { |
63 |
{IDC_CEDIT_AID, ""}, |
{IDC_CEDIT_AID, ""}, |
64 |
{IDC_CEDIT_VENDOR, "No Vendor"}, |
{IDC_CEDIT_VENDOR, "No Vendor"}, |
65 |
{IDC_CEDIT_VERSION,"No Version"}, |
{IDC_CEDIT_VERSION,"No Version"}, |
577 |
return FALSE; |
return FALSE; |
578 |
|
|
579 |
case WM_COMMAND: |
case WM_COMMAND: |
580 |
if (HIWORD (wparam) == BN_CLICKED && |
if ((HIWORD (wparam) == BN_CLICKED) && |
581 |
(LOWORD (wparam) == IDC_CKEYGEN_BACKUP) || |
(LOWORD (wparam) == IDC_CKEYGEN_BACKUP || |
582 |
LOWORD (wparam) == IDC_CKEYGEN_NEVER) { |
LOWORD (wparam) == IDC_CKEYGEN_NEVER)) { |
583 |
EnableWindow (GetDlgItem (dlg, IDC_CKEYGEN_VALID), |
EnableWindow (GetDlgItem (dlg, IDC_CKEYGEN_VALID), |
584 |
IsDlgButtonChecked (dlg, IDC_CKEYGEN_NEVER)? 0: 1); |
IsDlgButtonChecked (dlg, IDC_CKEYGEN_NEVER)? 0: 1); |
585 |
EnableWindow (GetDlgItem (dlg, IDC_CKEYGEN_PASS), |
EnableWindow (GetDlgItem (dlg, IDC_CKEYGEN_PASS), |
621 |
n = item_get_text_length (dlg, IDC_CKEYGEN_COMMENT); |
n = item_get_text_length (dlg, IDC_CKEYGEN_COMMENT); |
622 |
if (n > 0) |
if (n > 0) |
623 |
GetDlgItemText (dlg, IDC_CKEYGEN_COMMENT, comment, sizeof (comment)-1); |
GetDlgItemText (dlg, IDC_CKEYGEN_COMMENT, comment, sizeof (comment)-1); |
624 |
if (is_8bit_string (name) || n > 0 && is_8bit_string (comment)) { |
if (is_8bit_string (name) || (n > 0 && is_8bit_string (comment))) { |
625 |
msg_box (dlg, _("Please use plain ASCII charset for the fields."), |
msg_box (dlg, _("Please use plain ASCII charset for the fields."), |
626 |
_("Card Edit"), MB_INFO); |
_("Card Edit"), MB_INFO); |
627 |
return TRUE; |
return TRUE; |