Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

131 lines
3.6 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1999
  6. //
  7. // File: ScInsDlg.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #if !defined(AFX_SCINSDLG_H__D7E6F001_DDE8_11D1_803B_0000F87A49E0__INCLUDED_)
  11. #define AFX_SCINSDLG_H__D7E6F001_DDE8_11D1_803B_0000F87A49E0__INCLUDED_
  12. #if _MSC_VER >= 1000
  13. #pragma once
  14. #endif // _MSC_VER >= 1000
  15. // ScInsDlg.h : header file
  16. //
  17. /////////////////////////////////////////////////////////////////////////////
  18. //
  19. // Includes
  20. //
  21. //#include "statthrd.h"
  22. #include "ScUIDlg.h" // includes winscard.h
  23. #include "statmon.h"
  24. #include "ScInsBar.h"
  25. /////////////////////////////////////////////////////////////////////////////
  26. // CScInsertDlg dialog
  27. class CScInsertDlg : public CDialog
  28. {
  29. // Construction
  30. public:
  31. CScInsertDlg(CWnd* pParent = NULL);
  32. ~CScInsertDlg();
  33. // Dialog Data
  34. //{{AFX_DATA(CScInsertDlg)
  35. enum { IDD = IDD_SCARDDLG1 };
  36. CButton m_btnDetails;
  37. CListCtrl m_lstReaders;
  38. //}}AFX_DATA
  39. // Overrides
  40. // ClassWizard generated virtual function overrides
  41. //{{AFX_VIRTUAL(CScInsertDlg)
  42. public:
  43. virtual BOOL DestroyWindow();
  44. protected:
  45. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  46. //}}AFX_VIRTUAL
  47. // Implementation
  48. public:
  49. LONG Initialize(LPOPENCARDNAMEA_EX pOCNA, DWORD dwNumOKCards, LPCSTR mszOKCards);
  50. LONG Initialize(LPOPENCARDNAMEW_EX pOCNW, DWORD dwNumOKCards, LPCWSTR mszOKCards);
  51. void SetSelection(CSCardReaderState* pRdrSt);
  52. protected:
  53. // UI routines
  54. void DisplayError(UINT uiErrorMsg=IDS_UNKNOWN_ERROR);
  55. // data routines
  56. bool IsSelectionOK()
  57. {
  58. return (((NULL==m_pSelectedReader)?false:m_pSelectedReader->fOK) != 0);
  59. }
  60. bool MatchesSelection(CSCardReaderState* pRdrSt)
  61. {
  62. return (pRdrSt == m_pSelectedReader);
  63. }
  64. protected:
  65. // UI
  66. HICON m_hIcon; // Handle to the ICON
  67. BOOL m_fDetailsShown;
  68. int m_yMargin, m_SmallHeight, m_BigHeight;
  69. CString m_strTitle;
  70. CString m_strPrompt;
  71. CWnd* m_ParentHwnd;
  72. CScInsertBar* m_pSubDlg; // a CDialog-derived object
  73. void MoveButton(UINT nID, int newBottom);
  74. void ToggleSubDialog();
  75. void EnableOK(BOOL fEnabled=TRUE);
  76. // Data
  77. public:
  78. LONG m_lLastError; // Last error
  79. protected:
  80. LPOPENCARDNAMEA_EX m_pOCNA;
  81. LPOPENCARDNAMEW_EX m_pOCNW;
  82. CTextMultistring m_mstrAllCards;
  83. CScStatusMonitor m_monitor; // see statmon.h
  84. CSCardReaderStateArray m_aReaderState; // "
  85. CSCardReaderState* m_pSelectedReader;
  86. CCriticalSection* m_pCritSec;
  87. // Generated message map functions
  88. //{{AFX_MSG(CScInsertDlg)
  89. afx_msg LONG OnReaderStatusChange(UINT uint, LONG lParam);
  90. afx_msg void OnDetails();
  91. virtual BOOL OnInitDialog();
  92. virtual void OnOK();
  93. afx_msg BOOL OnHelpInfo(LPHELPINFO lpHelpInfo);
  94. afx_msg void OnContextMenu(CWnd* pWnd, CPoint pt);
  95. // afx_msg LRESULT OnCommandHelp(WPARAM, LPARAM lParam);
  96. //}}AFX_MSG
  97. DECLARE_MESSAGE_MAP()
  98. // helper function
  99. BOOL SameCard(CSCardReaderState* p1, CSCardReaderState* p2);
  100. void ShowHelp(HWND hWnd, UINT nCommand);
  101. };
  102. //{{AFX_INSERT_LOCATION}}
  103. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  104. #endif // !defined(AFX_SCINSDLG_H__D7E6F001_DDE8_11D1_803B_0000F87A49E0__INCLUDED_)