GetWindowTextLength function Null safety user32

int GetWindowTextLength(
  1. int hWnd

Retrieves the length, in characters, of the specified window's title bar text (if the window has a title bar). If the specified window is a control, the function retrieves the length of the text within the control. However, GetWindowTextLength cannot retrieve the length of the text of an edit control in another application.

int GetWindowTextLengthW(
  HWND hWnd


int GetWindowTextLength(int hWnd) {
  final _GetWindowTextLength = _user32.lookupFunction<
      Int32 Function(IntPtr hWnd),
      int Function(int hWnd)>('GetWindowTextLengthW');
  return _GetWindowTextLength(hWnd);