Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getwindowstext API
Message
De
23/11/1998 11:21:12
Jody Cairns
OAO Technology Solutions
Moncton, Nouveau-Brunswick, Canada
 
 
À
23/11/1998 03:52:02
Information générale
Forum:
Visual Basic
Catégorie:
Fonctions API de Windows
Divers
Thread ID:
00160417
Message ID:
00160510
Vues:
28
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform