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.

65 lines
2.7 KiB

  1. // --------------------------------------------------------------------------
  2. // Module Name: MessageBroadcast.h
  3. //
  4. // Copyright (c) 2000, Microsoft Corporation
  5. //
  6. // Class to manager sending or posting messages to windows to tell them that
  7. // things have changed.
  8. //
  9. // History: 2000-11-11 vtan created (split from services.cpp)
  10. // --------------------------------------------------------------------------
  11. #ifndef _MessageBroadcast_
  12. #define _MessageBroadcast_
  13. // --------------------------------------------------------------------------
  14. #include "SimpStr.h"
  15. // --------------------------------------------------------------------------
  16. enum MSG_TYPE
  17. {
  18. MT_SIMPLE,
  19. MT_ALLTHREADS, // send at least one msg to each thread/window in system
  20. MT_FILTERED, // by processid, HWND, exclude
  21. };
  22. // --------------------------------------------------------------------------
  23. class CThemeFile; // forward
  24. // --------------------------------------------------------------------------
  25. // CMessageBroadcast
  26. //
  27. // Purpose: Class used internally to assist with message sending which
  28. // must be done on the client side on behalf of the server.
  29. //
  30. // History: 2000-11-09 vtan created
  31. // --------------------------------------------------------------------------
  32. class CMessageBroadcast
  33. {
  34. public:
  35. CMessageBroadcast (BOOL fAllDesktops=TRUE);
  36. ~CMessageBroadcast (void);
  37. void PostSimpleMsg(UINT msg, WPARAM wParam, LPARAM lParam);
  38. void PostAllThreadsMsg(UINT msg, WPARAM wParam, LPARAM lParam);
  39. void PostFilteredMsg(UINT msg, WPARAM wParam, LPARAM lParam,
  40. HWND hwndTarget, BOOL fProcess, BOOL fExclude);
  41. private:
  42. static BOOL CALLBACK DesktopCallBack(LPTSTR lpszDesktop, LPARAM lParam);
  43. static BOOL CALLBACK TopWindowCallBack(HWND hwnd, LPARAM lParam);
  44. static BOOL CALLBACK ChildWindowCallBack(HWND hwnd, LPARAM lParam);
  45. void Worker(HWND hwnd);
  46. void EnumRequestedWindows();
  47. private:
  48. MSG _msg;
  49. HWND _hwnd;
  50. DWORD _dwProcessID;
  51. BOOL _fExclude;
  52. MSG_TYPE _eMsgType;
  53. BOOL _fAllDesktops;
  54. CSimpleArray<DWORD> _ThreadsProcessed;
  55. };
  56. #endif /* _MessageBroadcast_ */