Convert string to char*

Awaking Messages postés 18 Date d'inscription jeudi 19 août 2004 Statut Membre Dernière intervention 23 mai 2005 - 28 mars 2005 à 17:18
Awaking Messages postés 18 Date d'inscription jeudi 19 août 2004 Statut Membre Dernière intervention 23 mai 2005 - 28 mars 2005 à 19:16
J'ai fais un programme pour lister et effectuer des opérations sur les
fenêtre. Voici le code pour afficher une fenetre (si elle est cachée).
(j'utilise borland c++)



void __fastcall TForm1::Button2Click(TObject *Sender)

{

HANDLE hdl;

if (ListBox1->ItemIndex >= 0 )

{

hdl = FindWindow(ListBox1->Items[ListBox1->ItemIndex], NULL);

ShowWindow(hdl, SW_SHOW);

}

else

MessageBox(Form1->Handle,"Veuillez sélectionner une fenêtre.","Erreur", MB_OK | MB_ICONERROR);



}



il me dit impossible de convertir string to char* a cette ligne



hdl = FindWindow(ListBox1->Items[ListBox1->ItemIndex], NULL);



Aidez moi !
A voir également:

5 réponses

vecchio56 Messages postés 6535 Date d'inscription lundi 16 décembre 2002 Statut Membre Dernière intervention 22 août 2010 14
28 mars 2005 à 18:08
essaie la méthode c_str()
0
Rejoignez-nous