Fórum Sera que é Possível Executar .exe dentro de um Form ? #238850
21/06/2004
0
Alves
Curtir tópico
+ 0Posts
21/06/2004
Lucas Silva
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls
;
type
TForm1 = class(TForm)
Button1: TButton;
Lista: TListBox;
Button2: TButton;
Edit1: TEdit;
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure LIstApp;
const
MAX_WINDOW = 16364;
var
I : Integer;
Caption: Array[0..255]Of Char;
//Lista : TStringList;
begin
//Lista:=TStringList.Create;
//Lista.Sorted:=True;
For I:=1 To MAX_WINDOW Do
Begin
If((GetWindowText(I,Caption,255)<>0)And (GetWindowLong(I,GWL_EXSTYLE)<>0)And
(GetWindowLong(I,GWL_HWNDPARENT)=0)And (GetWindowLong(I,GWL_HINSTANCE)<>0))Then
If(IsWindowVisible(I))Then
form1.Lista.Items.Add(inttostr(i) + ´ ´ + caption);
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
lista.Clear;
listapp;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
windows.SetParent(strtoint(edit1.text),form1.handle);
end;
end.
Gostei + 0
21/06/2004
Motta
This function is provided for compatibility with earlier versions of Windows. For Win32-based applications, use the CreateProcess function.
The CreateProcess function creates a new process and its primary thread. The new process executes the specified executable file.
Gostei + 0
22/06/2004
Alves
Valeu, Lucas Alves Silva e Motta
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)