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.

50 lines
1.5 KiB

  1. // StartupLinks.h: interface for the CManageShellLinks class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_STARTUPLINKS_H__9F81721C_405C_4A8C_BE66_E5A6D1CDF1D5__INCLUDED_)
  5. #define AFX_STARTUPLINKS_H__9F81721C_405C_4A8C_BE66_E5A6D1CDF1D5__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #define STARTUP_FOLDER TEXT("Startup")
  10. #define STARTMENU_FOLDER TEXT("Start Menu")
  11. #define DESKTOP_FOLDER TEXT("Desktop")
  12. #include <shlobj.h> // for IShellLink defines and prototypes
  13. #include <oleguid.h> // for IID_IPersistFile
  14. #include "w95trace.h"
  15. #ifdef __cplusplus
  16. class CManageShellLinks
  17. {
  18. public:
  19. CManageShellLinks(LPCTSTR pszDestFolder);
  20. virtual ~CManageShellLinks();
  21. HRESULT CreateLink(LPCTSTR pszLink, LPCTSTR pszLinkFile
  22. , LPCTSTR pszStartIn, LPCTSTR pszDesc, LPCTSTR pszArgs);
  23. HRESULT RemoveLink(LPCTSTR pszLink);
  24. BOOL LinkExists(LPCTSTR pszLink);
  25. private:
  26. LPTSTR CreateLinkPath(LPCTSTR pszLink);
  27. BOOL GetUsersFolderPath(LPTSTR pszFolderPath, unsigned long *pulSize);
  28. long GetFolderPath(LPTSTR pszFolderPath, unsigned long *pulSize);
  29. IShellLink *m_pIShLink; // IShellLink interface pointer
  30. LPTSTR m_pszShellFolder; // The specific shell folder
  31. };
  32. #endif
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36. // LinkExists - helper function called from C returns TRUE if pszLink exists
  37. BOOL LinkExists(LPCTSTR pszLink);
  38. #ifdef __cplusplus
  39. }
  40. #endif
  41. #endif // !defined(AFX_STARTUPLINKS_H__9F81721C_405C_4A8C_BE66_E5A6D1CDF1D5__INCLUDED_)