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.

87 lines
2.6 KiB

  1. /****************************** Module Header ******************************\
  2. * Module Name: metrics.c
  3. *
  4. * Copyright (c) 1985 - 1999, Microsoft Corporation
  5. *
  6. * History:
  7. \***************************************************************************/
  8. #include "precomp.h"
  9. #pragma hdrstop
  10. /***************************************************************************\
  11. * MenuRecalc
  12. *
  13. * Loops through all menus and resets size and item info stuff. That's
  14. * because it is invalid when the menu font changes.
  15. *
  16. * History:
  17. \***************************************************************************/
  18. void MenuRecalc(void)
  19. {
  20. PMENU lpMenu;
  21. UINT iItem;
  22. PHE pheT;
  23. DWORD i;
  24. /*
  25. * for (ppi = gppiFirst; ppi; ppi = ppi->ppiNext)
  26. * {
  27. * for (pMenu = ppi->lpMenus; TESTFAR(lpMenu); lpMenu = lpMenu->lpMenuNext)
  28. * {
  29. *
  30. * That was the Chicao way of walking the objects. In NT, we
  31. * walk the handle table.
  32. */
  33. for (pheT = gSharedInfo.aheList, i = 0; i <= giheLast; i++, pheT++) {
  34. if (pheT->bType == TYPE_MENU) {
  35. /*
  36. * Get a pointer to the menu.
  37. */
  38. lpMenu = (PMENU)pheT->phead;
  39. /*
  40. * Set menu size to 0 so it recalculates later when we go to
  41. * draw it again.
  42. */
  43. lpMenu->cxMenu = 0;
  44. lpMenu->cyMenu = 0;
  45. /*
  46. * Reset mnemonic underline info
  47. */
  48. for (iItem = 0; iItem < lpMenu->cItems; iItem++) {
  49. lpMenu->rgItems[iItem].ulX = UNDERLINE_RECALC;
  50. lpMenu->rgItems[iItem].ulWidth = 0;
  51. lpMenu->rgItems[iItem].cxBmp = MNIS_MEASUREBMP;
  52. }
  53. }
  54. }
  55. }
  56. /***************************************************************************\
  57. * xxxRecreateSmallIcons()
  58. *
  59. * Recreates the class and/or window small icon when the caption height
  60. * changes. This needs to be done in context so that LR_COPYFROMRESOURCE
  61. * can work right.
  62. *
  63. * History:
  64. * 22-Jun-95 BradG Ported from Win95
  65. \***************************************************************************/
  66. VOID xxxRecreateSmallIcons(PWND pwnd)
  67. {
  68. BOOL fSmQueryDrag;
  69. CheckLock(pwnd);
  70. if (DestroyClassSmIcon(pwnd->pcls))
  71. xxxCreateClassSmIcon(pwnd->pcls);
  72. fSmQueryDrag = (TestWF(pwnd, WFSMQUERYDRAGICON) != 0);
  73. if (DestroyWindowSmIcon(pwnd) && !fSmQueryDrag)
  74. xxxCreateWindowSmIcon(pwnd, (HICON)_GetProp(pwnd, MAKEINTATOM(gpsi->atomIconProp), PROPF_INTERNAL), TRUE);
  75. }