This documentation was styled with a demo skin from the Premium Pack 4 add-on for Help & Manual. The contents of the skin are encrypted and not configurable. You can only publish HM projects with this skin. You cannot edit it or change it.
This version is copyright and may only be used for local testing purposes. It may not be distributed.
Please purchase the full version of the Premium Pack to get the configurable skins and remove this notice. The package will also include the Toolbox configuration utility for Premium Pack skins.
Description
Try to find a window with the specified window title.
Different find methods are handled.
Syntax
hWnd = Win_FindByTitle(WindowTitle [, FindMethod])
Returns
Number: handle to the window if found
Parameters
Name |
Type |
Optional |
Meaning |
WindowTitle |
String |
No |
Title (full or partial) text inside window title |
FindMethod |
Number |
Yes |
Method to use for searching. Possible values re the following: %WIN_FindTitleEqual %WIN_FindTitleStart %WIN_FindTitleEnd %WIN_FindTitleContain
|
Remarks
WindowTitle can contain the following starting or ending string: "...". This string will be used has preferred method.
For example:
if WindowTitle starts with "..." followed by some text function will find a window whose title ends with the text following "...".
if WindowTitle ends with "..." followed by some text function will find a window whose title starts with the text preceding "...".
if WindowTitle starts and ends with "..." with some text in between, function will find a window whose title contains the text specified between starting and ending "...".
Use of "..." have higher priority than FindMethod. For example, if WindowTitle contains "Calc..." and FindMethod is %WIN_FindTitleEnd, a "Start With" method will in any case used.
Restrictions
See also
Examples
Uses "UI"
Dim hWnd As Long
hWnd = Win_FindByTitle("Calc...") '---Will try to find a window whose title starts with "Calc"
hWnd = Win_FindByTitle("Calc", %WIN_FindTitleStart) '---Exactly the same as above