internetFeatures.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef NULLSOFT_WINAMP_INTERNET_FEATURES_HELPER_HEADER
  2. #define NULLSOFT_WINAMP_INTERNET_FEATURES_HELPER_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <wtypes.h>
  7. #include <urlmon.h>
  8. #ifndef FEATURE_TABBED_BROWSING
  9. #define FEATURE_TABBED_BROWSING ((INTERNETFEATURELIST)19)
  10. #endif //FEATURE_TABBED_BROWSING
  11. #ifndef FEATURE_SSLUX
  12. #define FEATURE_SSLUX ((INTERNETFEATURELIST)20)
  13. #endif // FEATURE_SSLUX
  14. #ifndef FEATURE_DISABLE_NAVIGATION_SOUNDS
  15. #define FEATURE_DISABLE_NAVIGATION_SOUNDS ((INTERNETFEATURELIST)21)
  16. #endif // FEATURE_DISABLE_NAVIGATION_SOUNDS
  17. #ifndef FEATURE_DISABLE_LEGACY_COMPRESSION
  18. #define FEATURE_DISABLE_LEGACY_COMPRESSION ((INTERNETFEATURELIST)22)
  19. #endif // FEATURE_DISABLE_LEGACY_COMPRESSION
  20. #ifndef FEATURE_FORCE_ADDR_AND_STATUS
  21. #define FEATURE_FORCE_ADDR_AND_STATUS ((INTERNETFEATURELIST)23)
  22. #endif //FEATURE_FORCE_ADDR_AND_STATUS
  23. #ifndef FEATURE_BLOCK_INPUT_PROMPTS
  24. #define FEATURE_BLOCK_INPUT_PROMPTS ((INTERNETFEATURELIST)27)
  25. #endif //FEATURE_BLOCK_INPUT_PROMPTS
  26. class InternetFeatures
  27. {
  28. public:
  29. InternetFeatures();
  30. ~InternetFeatures();
  31. public:
  32. HRESULT SetEnabled(INTERNETFEATURELIST FeatureEntry, DWORD dwFlags, BOOL fEnable);
  33. HRESULT IsEnabled(INTERNETFEATURELIST FeatureEntry, DWORD dwFlags);
  34. HRESULT SetDWORDFeature(const wchar_t *featureName, BOOL perUser, unsigned long value);
  35. HRESULT GetDWORDFeature(const wchar_t *featureName, BOOL perUser, unsigned long *value);
  36. void DeleteFeature(const wchar_t *featureName, BOOL perUser);
  37. protected:
  38. HRESULT LoadModule();
  39. const wchar_t *GetProcessName();
  40. private:
  41. typedef HRESULT (WINAPI *COINTERNETSETFEATUREENABLED)(INTERNETFEATURELIST /*FeatureEntry*/, DWORD /*dwFlags*/, BOOL /*fEnable*/);
  42. typedef HRESULT (WINAPI *COINTERNETISFEATUREENABLED)(INTERNETFEATURELIST /*FeatureEntry*/, DWORD /*dwFlags*/);
  43. private:
  44. HMODULE module;
  45. HRESULT loadResult;
  46. COINTERNETSETFEATUREENABLED CoInternetSetFeatureEnabled;
  47. COINTERNETISFEATUREENABLED CoInternetIsFeatureEnabled;
  48. wchar_t *processName_;
  49. };
  50. #endif NULLSOFT_WINAMP_INTERNET_FEATURES_HELPER_HEADER