Bonjour à toutes et à tous,
Depuis un moment j'essaie d'afficher avec mon code la fenêtre Dos dans un Tpanel en gardant cette structure.
J'avais testé ceci :
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 begin h:=0; ExecuteFile:='Monfichier.bat'; FillChar(SEInfo, SizeOf(SEInfo), 0) ; SEInfo.cbSize := SizeOf(TShellExecuteInfo) ; with SEInfo do begin fMask := SEE_MASK_NOCLOSEPROCESS; Wnd := Application.Handle; lpFile := PChar(ExecuteFile) ; nShow := SW_SHOWNORMAL; end; if ShellExecuteEx(@SEInfo) then begin repeat Application.ProcessMessages; end;
Mais je n'arrive pas à le placer dans mon code
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 try while h=0 do h:=findwindow('ConsoleWindowClass',FileMSDos); // ConsoleWindowClass Windows.SetParent(h,Panel1.handle); SetWindowPos(h,HWND_TOP,-2,-2,panel1.width +0,panel1.height +0,SWP_SHOWWINDOW); form1.ActiveControl := panel1;//Donne le focus
Si quelqu'un a une idée merci d'avance.
Excellent dimanche.
@+,
cincap
Partager