Click or drag to resize
Xcalibur Systems LLC Logo

WindowHelperGetWindowText Method

Copies the text of the specified window's title bar (if it has one) into a buffer. If the specified window is a control, the text of the control is copied. However, GetWindowText cannot retrieve the text of a control in another application.

GetWindowText function


Namespace: Xcalibur.NativeMethods.V2.Windows
Assembly: Xcalibur.NativeMethods.V2 (in Xcalibur.NativeMethods.V2.dll) Version: 1.0.1.0
Syntax
[DllImportAttribute("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static int GetWindowText(
	IntPtr windowHandle,
	StringBuilder buffer,
	int maxCharCount
)

Parameters

windowHandle  IntPtr
A handle to the window or control containing the text.
buffer  StringBuilder
The buffer that will receive the text. If the string is as long or longer than the buffer, the string is truncated and terminated with a null character.
maxCharCount  Int32
The maximum number of characters to copy to the buffer, including the null character. If the text exceeds this limit, it is truncated.

Return Value

Int32
See Also