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.

70 lines
2.2 KiB

  1. /****************************** Module Header ******************************\
  2. * Module Name: help.c
  3. *
  4. * Copyright (c) 1985 - 1999, Microsoft Corporation
  5. *
  6. * This module contains the various rectangle manipulation APIs.
  7. *
  8. * History:
  9. * 23-May-95 BradG Created for Kernel mode
  10. \***************************************************************************/
  11. BOOL FIsParentDude(PWND pwnd)
  12. {
  13. return(TestWF(pwnd, WEFCONTROLPARENT) || TestWF(pwnd, WFDIALOGWINDOW) ||
  14. ((TestWF(pwnd, BFTYPEMASK) == BS_GROUPBOX) &&
  15. IS_BUTTON(pwnd)));
  16. }
  17. /***************************************************************************\
  18. * GetContextHelpId()
  19. * Given a pwnd, this returns the Help Context Id for that window;
  20. * Note: If a window does not have a Context Id of its own, then it inherits
  21. * the ContextId of it's parent, if it is a child window; else, from its owner,
  22. * it is a owned popup.
  23. \***************************************************************************/
  24. DWORD GetContextHelpId(
  25. PWND pwnd)
  26. {
  27. DWORD dwContextId;
  28. while (!(dwContextId = (DWORD)(ULONG_PTR)_GetProp(pwnd,
  29. MAKEINTATOM(gpsi->atomContextHelpIdProp), PROPF_INTERNAL))) {
  30. pwnd = (TestwndChild(pwnd) ?
  31. REBASEPWND(pwnd, spwndParent) :
  32. REBASEPWND(pwnd, spwndOwner));
  33. if (!pwnd || (GETFNID(pwnd) == FNID_DESKTOP))
  34. break;
  35. }
  36. return dwContextId;
  37. }
  38. /*
  39. * Dialog Child enumeration proc
  40. *
  41. * Enumerates children of a dialog looking for the child under the mouse.
  42. *
  43. */
  44. BOOL CALLBACK EnumPwndDlgChildProc(PWND pwnd, LPARAM lParam)
  45. {
  46. PDLGENUMDATA pDlgEnumData = (PDLGENUMDATA)lParam;
  47. if (pwnd != pDlgEnumData->pwndDialog && IsVisible(pwnd) &&
  48. PtInRect(KPRECT_TO_PRECT(&pwnd->rcWindow), pDlgEnumData->ptCurHelp)) {
  49. /*
  50. * If it's a group box, keep enumerating. This takes care of
  51. * the case where we have a disabled control in a group box.
  52. * We'll find the group box first, and keep enumerating until we
  53. * hit the disabled control.
  54. */
  55. pDlgEnumData->pwndControl = pwnd;
  56. return (FIsParentDude(pwnd));
  57. }
  58. return TRUE;
  59. }