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.

84 lines
1.8 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999 - 1999
  6. //
  7. // File: objpick.h
  8. //
  9. //--------------------------------------------------------------------------
  10. // objpick.cpp: implementation of the CGetUser class and the
  11. // CGetComputer class using the object picker
  12. //
  13. //////////////////////////////////////////////////////////////////////
  14. #ifndef OBJPICK_H
  15. #define OBJPICK_H
  16. //
  17. // A list of names (e.g., users, groups, machines, and etc)
  18. //
  19. void FormatName(LPCTSTR pszFullName, LPCTSTR pszDomainName, CString & strDisplay);
  20. class CUserInfo
  21. {
  22. public:
  23. CUserInfo() {};
  24. CUserInfo(LPCTSTR pName, LPCTSTR pFullName)
  25. : m_strName(pName), m_strFullName(pFullName) {};
  26. CUserInfo(CUserInfo & userInfo)
  27. {
  28. if (this != &userInfo)
  29. *this = userInfo;
  30. }
  31. CUserInfo & operator = (const CUserInfo & userInfo)
  32. {
  33. if (this != &userInfo)
  34. {
  35. m_strName = userInfo.m_strName;
  36. m_strFullName = userInfo.m_strFullName;
  37. }
  38. return *this;
  39. }
  40. public:
  41. CString m_strName; // in the form of "domain\username"
  42. CString m_strFullName; // in the form of "firstname lastname"
  43. };
  44. typedef CArray<CUserInfo, CUserInfo&> CUserInfoArray;
  45. class CGetUsers : public CUserInfoArray
  46. {
  47. public:
  48. CGetUsers(BOOL fMultiselect = FALSE);
  49. ~CGetUsers();
  50. BOOL GetUsers(HWND hwndOwner);
  51. protected:
  52. void ProcessSelectedObjects(IDataObject *pdo);
  53. protected:
  54. BOOL m_fMultiselect;
  55. };
  56. class CGetComputer
  57. {
  58. public:
  59. CGetComputer();
  60. ~CGetComputer();
  61. BOOL GetComputer(HWND hwndOwner);
  62. protected:
  63. void ProcessSelectedObjects(IDataObject *pdo);
  64. public:
  65. CString m_strComputerName;
  66. };
  67. #endif // GETUSER_H