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.

126 lines
3.3 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: S H U T I L . H
  7. //
  8. // Contents: Various shell utilities to be used by the connections folder
  9. //
  10. // Notes:
  11. //
  12. // Author: jeffspr 21 Oct 1997
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #ifndef _SHUTIL_H_
  17. #define _SHUTIL_H_
  18. #include <ndispnp.h>
  19. #include <ntddndis.h>
  20. #include <ncshell.h>
  21. HRESULT HrDupeShellStringLength(
  22. PCWSTR pszInput,
  23. ULONG cchInput,
  24. PWSTR * ppszOutput);
  25. inline
  26. HRESULT HrDupeShellString(
  27. PCWSTR pszInput,
  28. PWSTR * ppszOutput)
  29. {
  30. return HrDupeShellStringLength(pszInput, wcslen(pszInput), ppszOutput);
  31. }
  32. HRESULT HrGetConnectionPidlWithRefresh(const GUID& guidId,
  33. PCONFOLDPIDL& ppidlCon);
  34. //---[ Various refresh functions ]--------------------------------------------
  35. // Notify the shell that an object is going away, and remove it from our list
  36. //
  37. HRESULT HrDeleteFromCclAndNotifyShell(
  38. const PCONFOLDPIDLFOLDER& pidlFolder,
  39. const PCONFOLDPIDL& pidlConnection,
  40. const CONFOLDENTRY& ccfe);
  41. VOID ForceRefresh(HWND hwnd);
  42. // Update the folder, but don't flush the items. Update them as needed.
  43. // pidlFolder is optional -- if not passed in, we'll generate it.
  44. //
  45. HRESULT HrForceRefreshNoFlush(const PCONFOLDPIDLFOLDER& pidlFolder);
  46. // Update the connection data based on the pidl. Notify the shell as
  47. // appropriate
  48. //
  49. HRESULT HrOnNotifyUpdateConnection(
  50. const PCONFOLDPIDLFOLDER& pidlFolder,
  51. const GUID * pguid,
  52. NETCON_MEDIATYPE ncm,
  53. NETCON_SUBMEDIATYPE ncsm,
  54. NETCON_STATUS ncs,
  55. DWORD dwCharacteristics,
  56. PCWSTR pszwName,
  57. PCWSTR pszwDeviceName,
  58. PCWSTR pszwPhoneNumberOrHostAddress);
  59. // Update the connection status, including sending the correct shell
  60. // notifications for icon updates and such.
  61. //
  62. HRESULT HrOnNotifyUpdateStatus(
  63. const PCONFOLDPIDLFOLDER& pidlFolder,
  64. const PCONFOLDPIDL& pidlCached,
  65. NETCON_STATUS ncsNew);
  66. // update the shell/connection list with the new connection status
  67. //
  68. HRESULT HrUpdateConnectionStatus(
  69. const PCONFOLDPIDL& pcfp,
  70. NETCON_STATUS ncs,
  71. const PCONFOLDPIDLFOLDER& pidlFolder,
  72. BOOL fUseCharacter,
  73. DWORD dwCharacter);
  74. //---[ Menu merging functions ]-----------------------------------------------
  75. VOID MergeMenu(
  76. HINSTANCE hinst,
  77. UINT idMainMerge,
  78. UINT idPopupMerge,
  79. LPQCMINFO pqcm);
  80. INT IMergePopupMenus(
  81. HMENU hmMain,
  82. HMENU hmMerge,
  83. int idCmdFirst,
  84. int idCmdLast);
  85. HRESULT HrGetMenuFromID(
  86. HMENU hmenuMain,
  87. UINT uID,
  88. HMENU * phmenu);
  89. HRESULT HrLoadPopupMenu(
  90. HINSTANCE hinst,
  91. UINT id,
  92. HMENU * phmenu);
  93. HRESULT HrShellView_GetSelectedObjects(
  94. HWND hwnd,
  95. PCONFOLDPIDLVEC& apidlSelection);
  96. HRESULT HrRenameConnectionInternal(
  97. const PCONFOLDPIDL& pidlCon,
  98. const PCONFOLDPIDLFOLDER& pidlFolder,
  99. LPCWSTR pszNewName,
  100. BOOL fRaiseError,
  101. HWND hwndOwner,
  102. PCONFOLDPIDL& ppidlOut);
  103. #endif // _SHUTIL_H_