Comment utiliser GetWindowText()

simac - Modifié par simac le 16/03/2014 à 20:55
BruNews Messages postés 21040 Date d'inscription jeudi 23 janvier 2003 Statut Modérateur Dernière intervention 21 août 2019 - 18 mars 2014 à 10:27
Excusez-moi, j'avais mal formulé ma demande:

J'aimerais savoir où placer ça dans le programme.
int lEditbox = GetWindowTextLength(bouton6)+1;
LPSTR sEditbox = (LPSTR)malloc(lEditbox);
if (sEditbox)
{
GetWindowText(bouton6,sEditbox,lEditbox);
//Ici j'affiche le contenu de l'editbox
MessageBox(hwnd,sEditbox,"Contenu de l'editbox",0);
free(sEditbox);
}
else
{
MessageBox(hwnd,"L'allocation de mémoire a échoué ...","Erreur",0);
//Traitements supplémentaires ICI
}


Quelqu'un pourrait-il m'aider ?
Merci.

1 réponse

BruNews Messages postés 21040 Date d'inscription jeudi 23 janvier 2003 Statut Modérateur Dernière intervention 21 août 2019
18 mars 2014 à 10:27
Si "bouton6" est bien HWND, je ne vois aucun probleme ici.

ciao...
0
Rejoignez-nous