> On Aug 21, 2006, at 3:39 PM, Brian Heibert wrote:
>
> > Is it possible to take this caption of text
> > me.Caption = "Say It..."
> > and figure out how many characters the caption takes up?
>

The Caption is in a window, so use window handle with API :

Declare Function GetWindowTextLengthA  Lib "user32"  (ByVal hHnd As Long) As
Long

This returns the number of characters in the Window.

Likewise, API to return the String Contents from the Window::

Declare Function GetWindowTextA  Lib "user32"  (ByVal hWnd As Long, ByVal
lpString As String, ByVal cch As Long) As Long

Where: lpString is pointer to the String and cch is the Length of the
string.
You would of course initialize the string referenced by lpString to at least
the number of characters returned by GetWindowTextLengthA.

  Gregg  Morrison



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to