The GetWindowText function will copy the text of the specified window's
title bar into a buffer. If the specified handle is a control, the text
or caption of the control is copied to the buffer.
function GetWindowText(hWnd: HWND; lpString: PChar; nMaxCount: Integer): integer;
Quick Copy&Paste:
-----------------
GetWindowText(Handle, lpString, Integer);
GetWindowText( , , );
Commented:
----------
GetWindowText(
hWnd: HWND; //handle of window or control with text
lpString: PChar; //address of buffer for text
nMaxCount: Integer; //maximum number of characters to copy
):integer;
User Contributed Examples:
--------------------------
Example #1:
var
lpString1: pchar;
begin
GetWindowText(Self.Handle, lpString1, 50);
showmessage(lpString1);
end;
Example 2:
Example 3:
User Contributed Comments:
--------------------------
Comment #1...
In Example #1 lpString1 is a pchar (like a string) parameter
that the procedure receives after sending the API message.
Once you send the GetWindowText message, the lpstring1 then
retrieves what it needs and you have access to it.
Comment #2...
See also: Windows API Reference Guide for Pascal
|