Cherche une api pour connaitre le caption d'un contrôle

cs_nafee Messages postés 5 Date d'inscription lundi 2 août 2004 Statut Membre Dernière intervention 11 février 2006 - 9 nov. 2005 à 16:58
cs_DARKSIDIOUS Messages postés 15814 Date d'inscription jeudi 8 août 2002 Statut Membre Dernière intervention 4 mars 2013 - 9 nov. 2005 à 17:13
Besoin d'aide pour savoir comment n api pour connu caption d'un contrôlemerçi

3 réponses

cs_Jack Messages postés 14006 Date d'inscription samedi 29 décembre 2001 Statut Modérateur Dernière intervention 28 août 2015 79
9 nov. 2005 à 17:08
Salut
"caption d'un controle" ?
Si c'est le caption d'un Label : Label.Caption
Si c'est le caption d'une forme interne au projet : laForme.Caption
Si c'est le caption d'un objet externe au projet dont tu connais le handle : (extrait de "API-Guide" dispo sur http://www.allapi.net )

Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long


Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long


Private Sub Form_Activate()


'KPD-Team 1998


'URL: http://www.allapi.net/


'E-Mail: KPDTeam@Allapi.net


Dim MyStr As String


'Create a buffer


MyStr = String(100, Chr$(0))


'Get the windowtext


GetWindowText Me.hwnd, MyStr, 100


'strip the rest of buffer


MyStr = Left$(MyStr, InStr(MyStr, Chr$(0)) - 1)


'Triple the window's text


MyStr = MyStr + MyStr + MyStr


'Set the new window text


SetWindowText Me.hwnd, MyStr


End Sub



Vala
Jack, MVP VB
NB : Je ne répondrai pas aux messages privés

Le savoir est la seule matière qui s'accroit quand on la partage. (Socrate)
0
Renfield Messages postés 17287 Date d'inscription mercredi 2 janvier 2002 Statut Modérateur Dernière intervention 27 septembre 2021 74
9 nov. 2005 à 17:08
Pourquoi as-tu besoin d'une API ?
De quel type de contrôle s'agit-il ?
0
cs_DARKSIDIOUS Messages postés 15814 Date d'inscription jeudi 8 août 2002 Statut Membre Dernière intervention 4 mars 2013 130
9 nov. 2005 à 17:13
toi aller voir api viewer à moi et chercher fonction GetWindowText.



Fonction devoir aider toi.

_____________________________________________________________________
DarK Sidious

Un API Viewer (pour le VB, VB.NET, C, C# et Delphi) tout en français : www.ProgOtoP.com/popapi/
0
Rejoignez-nous