bonjour,

dans mon cas je crée une form a la volée, ainsi qu'un memo a lintérieur, premier probleme : le focus se met avec le "c:\", puis en fait je voudrais incorporé certaine fonction du genre ping ou ipconfig, ou bien plus simple, a chaque fois que l'on appuis sur entrée, il remette automatiquement "c:\" a la ligne.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
unit Unit1;
 
interface
 
uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;
 
type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Déclarations privées }
  public
    { Déclarations publiques }
  end;
 
var
  Form1: TForm1;
  my_form: Tform;
 
implementation
 
{$R *.DFM}
 
procedure TForm1.Button1Click(Sender: TObject);
var
   my_memo: tmemo;
begin
my_form := tform.create(form1);
my_memo := tmemo.create(my_form);
        with my_form do
             begin
                  Height := 300;
                  Width := 500;
                  Position := poScreenCenter;
                  BorderStyle := bsDialog;
                  Caption := 'C:\WINDOWS\system32\cmd.exe';
                  visible := true;
             end;
        with my_memo do
             begin
                  parent := my_form;
                  my_memo.Height := my_form.Height;
                  my_memo.Width := my_form.Width;
                  color := clBlack;
                  font.Color := clWhite;
                  Text := ('Microsoft Windows XP [version 5.1.2600]' + #13#10 + '(C) Copyright 1985-2001 Microsoft Corp.' + #13#10 + #13#10 + 'C:\');
                  SetFocus;
                  visible := true;
             end;
end;
 
end.