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.

46 lines
893 B

  1. #pragma once
  2. #include <objbase.h>
  3. #include <Windows.h>
  4. #include <stdio.h>
  5. #include <tchar.h>
  6. #include <mq.h>
  7. #include <strsafe.h>
  8. #ifndef __MSMQMON
  9. #define __MSMQMON
  10. class MSMQMon
  11. {
  12. public:
  13. //constructors
  14. MSMQMon( TCHAR *szQueueToMonitor);
  15. MSMQMon();
  16. //de-structors
  17. ~MSMQMon(void);
  18. void DisplayCurrentQueue( TCHAR *szUserRetVal );
  19. void SetMessageWaitTime( DWORD dwNewWaitTime );
  20. HRESULT ConnectToQueue( void );
  21. HRESULT ConnectToQueue( DWORD constAccessType );
  22. HRESULT CloseOpenQueue( void );
  23. DWORD CountMessagesInQueue( int *count );
  24. BOOL SendQueueMessage( void );
  25. private:
  26. TCHAR szQueueName[256]; //name of the queue to monitor
  27. QUEUEHANDLE hOpenQueue; //handle to the open queue
  28. DWORD dwQueueAccessType;
  29. DWORD dwMsgWaitTime; //Amount of time to wait for a message to enter the queue (ms)
  30. };
  31. #endif