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.

83 lines
2.4 KiB

  1. /****************************************************************************
  2. *
  3. * FILE: PopupMsg.h
  4. *
  5. * CREATED: Chris Pirich (ChrisPi) 1-3-96
  6. *
  7. ****************************************************************************/
  8. #ifndef _POPUPMSG_H_
  9. #define _POPUPMSG_H_
  10. const DWORD PMF_OK = 0x00000001;
  11. const DWORD PMF_CANCEL = 0x00000002;
  12. const DWORD PMF_TIMEOUT = 0x00000004;
  13. const DWORD PMF_AUTH = 0x00000008;
  14. const DWORD PMF_KILLED = 0x00000010;
  15. typedef VOID (CALLBACK* PMCALLBACKPROC)(LPVOID, DWORD);
  16. const int POPUPMSG_MAX_SOUNDNAME = 64;
  17. const int POPUPMSG_TIMEOUT = 20000; // 20 seconds
  18. const int POPUPMSG_RING_INTERVAL = 4000; // 4 seconds
  19. const int POPUPMSG_ICON_HEIGHT = 16;
  20. const int POPUPMSG_ICON_WIDTH = 16;
  21. const int POPUPMSG_RING_TIMER = 1001;
  22. const int POPUPMSG_MAX_LENGTH = 256;
  23. class CPopupMsg
  24. {
  25. private:
  26. static UINT m_uVisiblePixels;
  27. static CSimpleArray<CPopupMsg*>* m_splstPopupMsgs;
  28. BOOL m_fAutoSize;
  29. HICON m_hIcon;
  30. HINSTANCE m_hInstance;
  31. PMCALLBACKPROC m_pCallbackProc;
  32. LPVOID m_pContext;
  33. BOOL m_fRing;
  34. BOOL m_fPlaySound;
  35. TCHAR m_szSound[POPUPMSG_MAX_SOUNDNAME];
  36. UINT m_uTimeout;
  37. int m_nWidth;
  38. int m_nHeight;
  39. int m_nTextWidth;
  40. BOOL GetIdealPosition(LPPOINT ppt, int xCoord, int yCoord);
  41. VOID PlaySound();
  42. public:
  43. HWND m_hwnd;
  44. // Methods:
  45. CPopupMsg(PMCALLBACKPROC pcp, LPVOID pContext=NULL);
  46. ~CPopupMsg();
  47. BOOL Change(LPCTSTR pcszText);
  48. HWND Create( LPCTSTR pcszText,
  49. BOOL fRing=FALSE,
  50. LPCTSTR pcszIconName=NULL,
  51. HINSTANCE hInstance=NULL,
  52. UINT uIDSoundEvent=0,
  53. UINT uTimeout=POPUPMSG_TIMEOUT,
  54. int xPos = -1,
  55. int yPos = -1);
  56. HWND CreateDlg( LPCTSTR pcszText,
  57. BOOL fRing=FALSE,
  58. LPCTSTR pcszIconName=NULL,
  59. HINSTANCE hInstance=NULL,
  60. UINT uIDSoundEvent=0,
  61. UINT uTimeout=POPUPMSG_TIMEOUT,
  62. int xPos = -1,
  63. int yPos = -1);
  64. static VOID ExpandSecureDialog(HWND hDlg,CPopupMsg * ppm);
  65. static VOID ShrinkSecureDialog(HWND hDlg);
  66. static BOOL Init();
  67. static VOID Cleanup();
  68. static LRESULT CALLBACK PMWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
  69. static INT_PTR CALLBACK PMDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
  70. static INT_PTR CALLBACK SecurePMDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
  71. };
  72. #endif // ! _POPUPMSG_H_