Source code of Windows XP (NT5)
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.

63 lines
2.2 KiB

  1. //============================================================================
  2. // Copyright(c) 1996, Microsoft Corporation
  3. //
  4. // File: bpopup.h
  5. //
  6. // History:
  7. // Abolade Gbadegesin Mar-2-1996 Created.
  8. //
  9. // This file contains public declarations for the Bubble-Popup window class.
  10. // A bubble-popup provides functionality similar to that of a tooltip,
  11. // in that it displays text for a brief period and then hides itself.
  12. // This class differs in that it uses DrawText for its output, thus allowing
  13. // multi-line text formatted using tabs. Further, the user is required
  14. // to tell the bubble-popup when to show itself.
  15. //
  16. // To create a bubble-popup, call BubblePopup_Create().
  17. // This returns an HWND (to be later destroyed using DestroyWindow()).
  18. // The text of the bubble-popup can be set and retrieved using WM_SETTEXT
  19. // and WM_GETTEXT (and hence the macros {Get,Set}WindowText().
  20. //
  21. // Set the period for which a popup is active by calling BubblePopup_SetTimeout
  22. // and activate the popup by calling BubblePopup_Activate.
  23. // While a popup is activated, changes to its text are reflected immediately.
  24. // If BubblePopup_Activate is called while the popup is already active,
  25. // the countdown (till the window is hidden) is started again.
  26. //============================================================================
  27. #ifndef _BPOPUP_H_
  28. #define _BPOPUP_H_
  29. // Window class name for bubble-popups
  30. #define WC_BUBBLEPOPUP TEXT("BubblePopup")
  31. // Messages accepted by bubble-popups
  32. #define BPM_FIRST (WM_USER + 1)
  33. #define BPM_ACTIVATE (BPM_FIRST + 0)
  34. #define BPM_DEACTIVATE (BPM_FIRST + 1)
  35. #define BPM_SETTIMEOUT (BPM_FIRST + 2)
  36. BOOL
  37. BubblePopup_Init(
  38. IN HINSTANCE hinstance
  39. );
  40. #define BubblePopup_Create(hinstance) \
  41. CreateWindow( \
  42. WC_BUBBLEPOPUP, NULL, 0, 0, 0, 0, 0, NULL, 0, (hinstance), NULL \
  43. )
  44. #define BubblePopup_Activate(hwnd) \
  45. (VOID)SendMessage((HWND)hwnd, BPM_ACTIVATE, 0, 0)
  46. #define BubblePopup_Deactivate(hwnd) \
  47. (VOID)SendMessage((HWND)hwnd, BPM_DEACTIVATE, 0, 0)
  48. #define BubblePopup_SetTimeout(hwnd, uiTimeout) \
  49. (VOID)SendMessage((HWND)hwnd, BPM_SETTIMEOUT, 0,(LPARAM)(UINT)uiTimeout)
  50. #endif