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
1.5 KiB

  1. #ifndef _INETNOT_H
  2. #define _INETNOT_H
  3. //+-------------------------------------------------------------------------
  4. // Wininet currently only support sending notifications of changes to the
  5. // cache to one window. This class creates one top-level window per process
  6. // for receiving and re-broadcasting these notifications. When the
  7. // process shuts down, we look for another window to take over these
  8. // messages.
  9. //
  10. // This is an imperfect solution. It would have been much easier if the
  11. // wininet guys could have been convinced to call SHChangeNotify instead.
  12. // However, they are planning to enhace this later. (stevepro))
  13. //--------------------------------------------------------------------------
  14. class CWinInetNotify
  15. {
  16. public:
  17. CWinInetNotify();
  18. ~CWinInetNotify();
  19. void Enable(BOOL fEnable = TRUE);
  20. static void GlobalEnable();
  21. static void GlobalDisable();
  22. protected:
  23. void _EnterMutex();
  24. void _LeaveMutex();
  25. static void _HookInetNotifications(HWND hwnd);
  26. static void _OnNotify(DWORD_PTR dwFlags);
  27. static LRESULT CALLBACK _WndProc(HWND hwnd, UINT uMessage, WPARAM wParam, LPARAM lParam);
  28. static BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam);
  29. enum
  30. {
  31. CWM_WININETNOTIFY = WM_USER + 410
  32. };
  33. HANDLE _hMutex;
  34. BOOL _fEnabled;
  35. static HWND s_hwnd;
  36. static ULONG s_ulEnabled;
  37. static CWinInetNotify* s_pWinInetNotify;
  38. };
  39. #define CWinInetNotify_szWindowClass TEXT("Inet Notify_Hidden")
  40. #endif //_INETNOT_H