1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
void __fastcall TForm1::FormClick(TObject *Sender)
{
char buf[300];
HWND Handle;
HWND Handle1;
HWND Handle2;
HWND Handle3;
// on recupere le Handle sous la souris
Handle = WindowFromPoint(Mouse->CursorPos);
// on change le titre
SetWindowText(Handle,"Titre Form");
// on recupere le titre
GetWindowText(Handle,buf,300);
// on affiche le titre
Label1->Caption = buf;
Handle1 = GetWindow(Handle ,GW_CHILD);
SetWindowText(Handle1,"Texte TEdit");
GetWindowText(Handle1,buf,300);
Label2->Caption = buf;
Handle2 = GetWindow(Handle1 ,GW_HWNDNEXT);
SetWindowText(Handle2,"Caption Button");
GetWindowText(Handle2,buf,300);
Label3->Caption = buf;
Handle3 = GetWindow(Handle2 ,GW_HWNDNEXT);
SetWindowText(Handle3,"Texte Memo");
GetWindowText(Handle3,buf,300);
Label4->Caption = buf;
}
//--------------------------------------------------------------------------- |
Partager