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.

50 lines
2.4 KiB

  1. //=============================================================================
  2. // This file describes helpful functions used throughout MSConfig.
  3. //=============================================================================
  4. #pragma once
  5. #include "resource.h"
  6. #include "pagebase.h"
  7. extern BOOL FileExists(const CString & strFile);
  8. //-------------------------------------------------------------------------
  9. // Display a message to the user, either using a resource ID or a string.
  10. //-------------------------------------------------------------------------
  11. extern void Message(LPCTSTR szMessage, HWND hwndParent = NULL);
  12. extern void Message(UINT uiMessage, HWND hwndParent = NULL);
  13. //-------------------------------------------------------------------------
  14. // Get a registry key for MSConfig use (tab pages can write values under
  15. // this key). The caller is responsible for closing the key.
  16. //
  17. // If the key doesn't exist, then an attempt is made to create it.
  18. //-------------------------------------------------------------------------
  19. extern HKEY GetRegKey(LPCTSTR szSubKey = NULL);
  20. //-------------------------------------------------------------------------
  21. // Backup the specified file to the MSConfig directory. The
  22. // strAddedExtension will be appended to the file. If fOverwrite is FALSE
  23. // then an existing file won't be replaced.
  24. //-------------------------------------------------------------------------
  25. extern HRESULT BackupFile(LPCTSTR szFilename, const CString & strAddedExtension = _T(""), BOOL fOverwrite = TRUE);
  26. //-------------------------------------------------------------------------
  27. // Restore the specified file from the MSConfig directory. The
  28. // strAddedExtension will be used in searching for the file in the backup
  29. // directory. If fOverwrite is FALSE then an existing file won't
  30. // be replaced.
  31. //-------------------------------------------------------------------------
  32. extern HRESULT RestoreFile(LPCTSTR szFilename, const CString & strAddedExtension = _T(""), BOOL fOverwrite = FALSE);
  33. //-------------------------------------------------------------------------
  34. // Get the name of the backup file (generated from an extension and the
  35. // base name of the file to be backed up).
  36. //-------------------------------------------------------------------------
  37. extern const CString GetBackupName(LPCTSTR szFilename, const CString & strAddedExtension = _T(""));