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.

137 lines
5.2 KiB

  1. /* Defines for WinOldAppHackoMatic flags which win386 oldapp can send to us.
  2. * These are kept in user's global variable winOldAppHackoMaticFlags
  3. */
  4. /*
  5. * WOAHACK_CHECKALTKEYSTATE
  6. *
  7. * This is sent from WinOldAp to USER when the user has just pressed
  8. * Alt+Space. When the user does that, keyboard focus shifts from
  9. * the DOS box to Windows. This is particularly weird because the
  10. * focus is changing while the user has a key down. The message is
  11. * sent to USER to let it know that the Alt key may be in a funky
  12. * state right now.
  13. *
  14. * The value of this must be a power of two because it is used
  15. * in the winOldAppHackoMaticFlags variable as a bitmask.
  16. *
  17. * WOAHACK_IGNOREALTKEYDOWN
  18. *
  19. * This is used internally by USER to keep track of the Alt key
  20. * state, triggered by the WOAHACK_CHECKALTKEYSTATE message.
  21. *
  22. * The value of this must be a power of two because it is used
  23. * in the winOldAppHackoMaticFlags variable as a bitmask.
  24. *
  25. * WOAHACK_DISABLEREPAINTSCREEN
  26. *
  27. * This is sent from WinOldAp to USER when the user has initiated
  28. * an Alt+Tab sequence from a fullscreen VM. This causes USER to
  29. * defer the RepaintScreen that will be sent by the display driver.
  30. * This speeds up Alt+Tab'ing. When the Alt+Tab is complete,
  31. * if the user selected another fullscreen DOS box, USER will ignore
  32. * the RepaintScreen altogether, since it's about to lose the
  33. * display focus anyway. In all other cases, the RepaintScreen will
  34. * be performed once the Alt+Tab is complete.
  35. *
  36. * WOAHACK_LOSINGDISPLAYFOCUS
  37. * WOAHACK_GAININGDISPLAYFOCUS
  38. *
  39. * These messages are sent from WinOldAp to USER when the display
  40. * focus is changing. The WOAHACK_LOSINGDISPLAYFOCUS message is
  41. * sent *before* Windows is about to lose focus, and the
  42. * WOAHACK_GAININGDISPLAYFOCUS is sent *after* Windows has regained
  43. * the display focus.
  44. *
  45. * WinOldAp sends these messages whenever it is about to set the
  46. * VM focus. It doesn't check if the message is a repeat of a
  47. * previous message. (So, for example, USER may receive three
  48. * copies of WOAHACK_GAININGDISPLAYFOCUS.) USER maintains an
  49. * internal variable to keep track of whether each receipt of the
  50. * message is a change in the focus or just a redundant notification.
  51. *
  52. * USER uses these messages to turn off the timer that is normally
  53. * used to trigger the mouse drawing code in the display driver
  54. * while Windows does not have the display focus, and to turn the
  55. * timer back on once Windows gets the display back.
  56. *
  57. * This is needed to make sure the display driver is otherwise
  58. * quiet when the int 2F is dispatched from the VDD to notify the
  59. * display driver that the focus has changed. Not doing this
  60. * opens the possibility of re-entrancy in the display driver.
  61. *
  62. * WOAHACK_IMAWINOLDAPSORTOFGUY
  63. *
  64. * WinOldAp needs to call this API once with this flag set so that
  65. * USER can mark winoldap's queue as being winoldap. USER needs
  66. * to know that a particular queue is winoldap for several reasons
  67. * having to do with task switching and priorities.
  68. */
  69. #define WOAHACK_CHECKALTKEYSTATE 1
  70. #define WOAHACK_IGNOREALTKEYDOWN 2
  71. #define WOAHACK_DISABLEREPAINTSCREEN 3
  72. #define WOAHACK_LOSINGDISPLAYFOCUS 4
  73. #define WOAHACK_GAININGDISPLAYFOCUS 5
  74. #define WOAHACK_IAMAWINOLDAPSORTOFGUY 6
  75. /* ------ After this point comes information that can be publicized ------- */
  76. /* WinOldApp related flags and Macros */
  77. /*
  78. * These property bits are stored in the flWinOldAp property of
  79. * WinOldAp's main window. They are provided so that USER and other
  80. * applications can query the state of the DOS box.
  81. *
  82. * These properties are read-only. Changing them will cause Windows
  83. * to get confused.
  84. *
  85. * woapropIsWinOldAp
  86. *
  87. * This bit is always set.
  88. *
  89. * woapropFullscreen
  90. *
  91. * Set if this a fullscreen DOS box rather than a windowed DOS box.
  92. * Note that this bit is set even if WinOldAp does not have focus.
  93. * (E.g., when iconic.) Its purpose is to indicate what the state
  94. * of the DOS box would be *if* it were to be activated.
  95. *
  96. * woapropActive
  97. *
  98. * Set if WinOldAp is active. Note that one cannot merely
  99. * check IsIconic(hwnd) because fullscreen DOS boxes are always
  100. * iconic.
  101. *
  102. * None of the other bits are used, although names for some of them
  103. * have been chosen. This does not represent any commitment to use
  104. * them for the purpose the name suggests.
  105. *
  106. * Other properties we may think of adding...
  107. *
  108. * hvm
  109. *
  110. * This extended property contains the 32-bit VM handle.
  111. *
  112. * hprop
  113. *
  114. * This property contains the property handle being used
  115. * by the DOS box. (For utilities which want to be able
  116. * to modify the properties of a running DOS box, perhaps.)
  117. *
  118. */
  119. #define WINOLDAP_PROP_NAME "flWinOldAp"
  120. extern ATOM atmWinOldAp;
  121. #define WinOldApFlag(hwnd, flag) ((UINT)GetPropEx(hwnd, MAKEINTATOM(atmWinOldAp)) & woaprop##flag)
  122. #define woapropIsWinOldAp 1
  123. #define woapropFullscreen 2
  124. #define woapropActive 4
  125. #define woapropIdle 8
  126. #define woapropClosable 64
  127. #define IsWinOldApHwnd(hwnd) WinOldApFlag(hwnd, IsWinOldAp)
  128. #define IsFullscreen(hwnd) WinOldApFlag(hwnd, Fullscreen)