GweBypassCoredllThunk_t::GetWindowTextW_I

This method copies the text of the title bar of the specified window — if it has one — into a buffer. If the specified window is a control, the text of the control is copied.

static INT WINAPI GetWindowTextW_I(
  HWND hwndThis,
  LPTSTR psz,
  int cchMax
);

Parameters

  • hwndThis
    [in] Handle to the window or control containing the text.
  • psz
    [out] Long pointer to the buffer that will receive the text.
  • cchMax
    [in] Integer that specifies the maximum number of characters to copy to the buffer, including the NULL character. If the text exceeds this limit, it is truncated.

Return Values

The length, in characters, of the copied string, not including the terminating null character, indicates success. Zero indicates that the window has no title bar or text, if the title bar is empty, or if the window or control handle is invalid. To get extended error information, call GetLastError.

This function cannot retrieve the text of an edit control in another application.

Remarks

This method is an internal version of the GetWindowText function.

If the target window is owned by the current process, GweBypassCoredllThunk_t::GetWindowTextW_I causes a WM_GETTEXT message to be sent to the specified window or control. If the target window is owned by another process and has a title bar, GweBypassCoredllThunk_t::GetWindowTextW_I retrieves the text of the title bar. If the window does not have a title bar, the return value is a null string.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: GweBypassCoredllThunk.hpp.

See Also

GetWindowText | GweBypassCoredllThunk_t::GetWindowTextLengthW_I | GweBypassCoredllThunk_t::SetWindowTextW_I | WM_GETTEXT

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.