home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1994 February / psl_9403.zip / psl_9403 / DOS / UT_SYSTM / CENVI2.ZIP / WINTOOLS.LIB < prev    next >
Text File  |  1993-11-16  |  20KB  |  538 lines

  1. // WinTools.lib - Functions for setting the state of of PM windows.  This
  2. //                file may be #included into other Cmm source files, or
  3. //                you can cut and paste in the parts that you need.
  4. //
  5. //                Note: Most of these routines require either a window
  6. //                handle or a window title.  You can use either, but
  7. //                using a Window handle is a little quicker.  Many of these
  8. //                utilities require that you include PMdll.lib.
  9. //
  10. //
  11. //***** GetWindowHandle(): Get the handle for this window
  12. // SYNTAX: int GetWindowHandle(int WindowHandle)
  13. //         int GetWindowHandle(string WindowTitle)
  14. // WHERE: WindowHandle: Integer identifier for this window
  15. //        WindowTitle: Partial text title of the window (case-insensitive)
  16. // RETURN: Returns Window handle for a Windows whose partial title is
  17. //         WindowTitle. Comparison is case-insensitive.  If WindowTitle
  18. //         is not found then returns 0 (NULL).
  19. // NOTE: If WindowHandle is input, then this returns WindowHandle if
  20. //       WindowHandle is valid, else returns 0.  WindowTitle is a partial
  21. //       and case-insensitive match and so "write" would match the
  22. //       window titled "Write - THESIS.WRI".
  23. //
  24. //
  25. //***** GetFocusChild(): Get the handle for child that last had focus
  26. // SYNTAX: int GetWindowHandle(int WindowHandle)
  27. //         int GetWindowHandle(string WindowTitle)
  28. // WHERE: WindowHandle: Integer identifier for this window
  29. //        WindowTitle: Partial text title of the window (case-insensitive)
  30. // RETURN: Returns Window handle for a child of this window that now has
  31. //         focus or most recently had focus before this window was
  32. //         made inactive.  NULL if not focus child.
  33. // NOTE: If WindowHandle is input, then this returns WindowHandle if
  34. //       WindowHandle is valid, else returns 0.  WindowTitle is a partial
  35. //       and case-insensitive match and so "write" would match the
  36. //       window titled "Write - THESIS.WRI".
  37. //
  38. //
  39. //***** GetWindowTitle(): Get full Window Title
  40. // SYNTAX: string GetWindowTitle(int WindowHandle)
  41. //         string GetWindowTitle(string WindowTitle)
  42. // WHERE: WindowHandle: Integer identifier for this window
  43. //        WindowTitle: Partial text title of the window (case-insensitive)
  44. // RETURN: Returns Full title for this window, or NULL if window not
  45. //         found or title not found
  46. //
  47. //
  48. //***** SetWindowTitle(): Set title for window
  49. // SYNTAX: bool SetWindowTitle(int WindowHandle,string NewTitle)
  50. //         bool SetWindowTitle(string WindowTitle,string NewTitle)
  51. // WHERE: WindowHandle: Integer identifier for this window
  52. //        WindowTitle: Partial text title of the window (case-insensitive)
  53. //        NewTitle: New full title for this window
  54. // RETURN: TRUE if successful, else FALSE if WindowSpec is invalid.
  55. //
  56. //
  57. //***** IsWindow(): Is this a valid window title or handle
  58. // SYNTAX: bool IsWindow(int WindowHandle)
  59. //         bool IsWindow(string WindowTitle)
  60. // WHERE: WindowHandle: Integer identifier for this window
  61. //        WindowTitle: Partial text title of the window (case-insensitive)
  62. // RETURN: Returns non-zero if this window exists, else returns zero (FALSE)
  63. //
  64. //
  65. //***** IsMinimized(): Is window minimized (Iconic)
  66. // SYNTAX: bool IsMinimized(int WindowHandle)
  67. //         bool IsMinimized(string WindowTitle)
  68. // WHERE: WindowHandle: Integer identifier for this window
  69. //        WindowTitle: Partial text title of the window (case-insensitive)
  70. // RETURN: non-zero if Window is minimized (iconic) else zero (FALSE)
  71. //         if not minimized or if WindowSpec is invalid
  72. //
  73. //
  74. //***** IsMaximized(): Is window maximized
  75. // SYNTAX: bool IsMinimized(int WindowHandle)
  76. //         bool IsMinimized(string WindowTitle)
  77. // WHERE: WindowHandle: Integer identifier for this window
  78. //        WindowTitle: Partial text title of the window (case-insensitive)
  79. // RETURN: non-zero if Window is maximized else zero (FALSE) if not
  80. //         maximized or if WindowSpec is invalid
  81. //
  82. //
  83. //***** IsVisible(): Is window visible
  84. // SYNTAX: bool IsVisible(int WindowHandle)
  85. //         bool IsVisible(string WindowTitle)
  86. // WHERE: WindowHandle: Integer identifier for this window
  87. //        WindowTitle: Partial text title of the window (case-insensitive)
  88. // RETURN: non-zero if Window is visible else zero (FALSE) if not
  89. //         visible or if WindowSpec is invalid. Visible means that
  90. //         the window exists on the screen even if it is covered by
  91. //         other windows
  92. //
  93. //
  94. //***** IsEnabled(): Is window enabled for input
  95. // SYNTAX: bool IsEnabled(int WindowHandle)
  96. //         bool IsEnabled(string WindowTitle)
  97. // WHERE: WindowHandle: Integer identifier for this window
  98. //        WindowTitle: Partial text title of the window (case-insensitive)
  99. // RETURN: non-zero if Window is enabled for mouse and keyboard input,
  100. //         else zero (FALSE) if not enabled or if WindowSpec is invalid
  101. //
  102. //
  103. //***** GetWindowRect(): Get current window coordinates
  104. // SYNTAX: bool GetWindowRect(int WindowHandle,struct Rectangle)
  105. //         bool GetWindowRect(string WindowTitle,struct Rectangle)
  106. // WHERE: WindowHandle: Integer identifier for this window
  107. //        WindowTitle: Partial text title of the window (case-insensitive)
  108. //        Rectangle: receive structure of current window with following members
  109. //             .left - coordinate for left edge of window
  110. //             .right - coordinate for right edge of window
  111. //             .top - coordinate for top edge of window
  112. //             .bottom - coordinate for bottom edge of window
  113. // RETURN: TRUE if WindowSpec is valid, else FALSE.
  114. // MODIFY: Modifies Rectangle structure to current coordinates
  115. //
  116. //
  117. //***** SetWindowRect(): Set current window coordinates
  118. // SYNTAX: bool SetWindowRect(int WindowHandle,struct Rectangle)
  119. //         bool SetWindowRect(string WindowTitle,struct Rectangle)
  120. // WHERE: WindowHandle: Integer identifier for this window
  121. //        WindowTitle: Partial text title of the window (case-insensitive)
  122. //        Rectangle: new structurw of window with the same member elements as
  123. //                   defined above in GetWindowRect()
  124. // RETURN: TRUE if WindowSpec is valid, else FALSE.
  125. //
  126. //
  127. //***** GetScreenSize(): Get width and height of the windows screen
  128. // SYNTAX: void GetScreenSize(int Width,int Height);
  129. // WHERE: Width: receive screen width
  130. //        Height: receive screen height
  131. // MODIFY: Sets Width and Height to dimensions of screen
  132. //
  133. //
  134. //***** GetSize(): Get current width and height of window
  135. // SYNTAX: bool GetSize(int WindowHandle,int Width,int Height)
  136. //         bool GetSize(string WindowTitle,int Width,int Height)
  137. // WHERE: WindowHandle: Integer identifier for this window
  138. //        WindowTitle: Partial text title of the window (case-insensitive)
  139. //        Width: receive current window width
  140. //        Height: receive current window height
  141. // RETURN: TRUE if WindowSpec is valid, else FALSE.
  142. // MODIFY: Sets Width and Height to current dimensions of window
  143. //
  144. //
  145. //***** SetSize(): Get current width and height of window
  146. // SYNTAX: bool GetSize(int WindowHandle,int Width,int Height)
  147. //         bool GetSize(string WindowTitle,int Width,int Height)
  148. // WHERE: WindowHandle: Integer identifier for this window
  149. //        WindowTitle: Partial text title of the window (case-insensitive)
  150. //        Width: new window width
  151. //        Height: new window height
  152. // RETURN: TRUE if WindowSpec is valid, else FALSE.
  153. //
  154. //
  155. //***** GetPosition(): Get current column and row of window
  156. // SYNTAX: bool GetPosition(int WindowHandle,int LeftCol,int BottomRow)
  157. //         bool GetPosition(string WindowTitle,int LeftCol,int BottomRow)
  158. // WHERE: WindowHandle: Integer identifier for this window
  159. //        WindowTitle: Partial text title of the window (case-insensitive)
  160. //        LeftCol: receive current column coordinate of lower-left corner of window
  161. //        Height: receive current row coordinate of lower-left corner of window
  162. // RETURN: TRUE if WindowSpec is valid, else FALSE.
  163. // MODIFY: Sets LeftCol and Bott