Source code of Windows XP (NT5)
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.

116 lines
2.8 KiB

  1. // BrowseDialog.h : header file
  2. //
  3. //Icon indexes
  4. #define HMM_ICON_SERVER 0
  5. #define HMM_ICON_GLOBE 1
  6. #define HMM_ICON_OTHER 2
  7. #define HMM_ICON_NETWORK 3
  8. //Constant Strings
  9. #define HMM_STR_MWN "Microsoft Windows Network"
  10. #define HMM_STR_MN "Microsoft Network"
  11. #define HMM_STR_ENTIRE_NWORK "Entire Network"
  12. #define HMM_LEN_ENTIRE_NWORK 14
  13. class CNetResourceList
  14. {
  15. public:
  16. DWORD dwScope;
  17. DWORD dwType;
  18. DWORD dwDisplayType;
  19. DWORD dwUsage;
  20. char* lpLocalName;
  21. char* lpRemoteName;
  22. char* lpComment;
  23. char* lpProvider;
  24. BOOL fIsNULL;
  25. BOOL fUseGlobe;
  26. CNetResourceList* pNext;
  27. CNetResourceList(NETRESOURCE & nr, BOOL fNull = FALSE);
  28. ~CNetResourceList();
  29. };
  30. /////////////////////////////////////////////////////////////////////////////
  31. // CBrowseDialog dialog
  32. class CBrowseDialog : public CDialog
  33. {
  34. // Construction
  35. public:
  36. CBrowseDialog(CWnd* pParent = NULL); // standard constructor
  37. ~CBrowseDialog(); //destructor
  38. void EnumerateServers(LPNETRESOURCE lpnr, BOOL fUseGlobe = FALSE);
  39. void CleanUpListCtrl();
  40. char* GetServerName() {return lpServerName;}
  41. void Clone(NETRESOURCE &nrClone, DWORD nrScope, DWORD nrType, DWORD nrDisplayType, DWORD nrUsage,
  42. LPSTR lpLocalName, LPSTR lpRemoteName, LPSTR lpComment, LPSTR lpProvider);
  43. int GetSelectedIndex(DWORD &dwDisplayType);
  44. void OnDblclkList2(int index);
  45. // Dialog Data
  46. //{{AFX_DATA(CBrowseDialog)
  47. enum { IDD = IDD_DIALOG_BROWSE };
  48. CButton m_cancelButton;
  49. CButton m_okButton;
  50. CListCtrl m_list;
  51. //}}AFX_DATA
  52. CImageList m_imageList;
  53. HICON hIcon;
  54. int count;
  55. NETRESOURCE dummy;
  56. CNetResourceList* pPrevList;
  57. CNetResourceList* pCurrentSelectionList;
  58. CNetResourceList* pCurrentItem;
  59. CBitmapButton m_backBitmapButton;
  60. CBitmapButton m_listBitmapButton;
  61. CBitmapButton m_detailBitmapButton;
  62. LONG oldStyle; //original list control style
  63. char lpServerName [MAX_SERVER_NAME_LENGTH + 1];
  64. int iSelectedItem;//index of item selected in listbox
  65. // Overrides
  66. // ClassWizard generated virtual function overrides
  67. //{{AFX_VIRTUAL(CBrowseDialog)
  68. protected:
  69. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  70. virtual void OnOK();
  71. virtual void OnNcDestroy ();
  72. //}}AFX_VIRTUAL
  73. // Implementation
  74. protected:
  75. BOOL fIsWin95; //flag to indicate if workstation is Windows 95
  76. // Generated message map functions
  77. //{{AFX_MSG(CBrowseDialog)
  78. virtual BOOL OnInitDialog();
  79. afx_msg void OnDblclkList1(NMHDR* pNMHDR, LRESULT* pResult);
  80. afx_msg void OnBackbutton();
  81. afx_msg void OnListbutton();
  82. afx_msg void OnDetailbutton();
  83. afx_msg void OnItemchangedList3(NMHDR* pNMHDR, LRESULT* pResult);
  84. afx_msg void OnKeyDown(NMHDR* pNMHDR, LRESULT* pResult);
  85. afx_msg BOOL OnNeedText(UINT id, NMHDR* pNMHDR, LRESULT* pResult);
  86. //}}AFX_MSG
  87. DECLARE_MESSAGE_MAP()
  88. // afx_msg void OnSetfocusList2(NMHDR* pNMHDR, LRESULT* pResult);
  89. };