>Who know how to use this functuion .
>My window is VB(“FORM1”).
Assuming you mean how to use the GetWindowText API function, here's one quick and dirty way to get the text of a window. This works for controls, too. Check
http://premium.microsoft.com/msdn/library/sdkdoc/winui/windows_5gms.htm for info on this function.
Of course, the easiest way to get a VB form title within a VB program is using the Caption property.
Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" _
(ByVal hwnd As Long, _
ByVal lpString As String, _
ByVal cch As Long) _
As Long
function GetWindowCaption(lHandle as long) as string
Dim lLength As long
Dim sTitle As String
sTitle = Space(256)
lLength = GetWindowText(lHandle, sTitle, 255)
GetWindowCaption = Left$(sTitle, lLength)
end function