A r t i c l e s
Navigation

Note: This site is
a bit older, personal views
may have changed.

M a i n P a g e

D i r e c t o r y

DWAP GetText Example


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

About
This site is about programming and other things.
_ _ _