Forum > PDAs and Smartphones

How i use CreateProcess ?

(1/2) > >>

leandrojcbh:
Hello!

I try to use in Lazarus:

uses

shellapi, process, windows;


(CreateProcess(pwidechar('\program files\test\hello.exe'), Nil, Nil, Nil,
  False, CREATE_NEW_CONSOLE, Nil, Nil, StartupInfo, ProcessInformation));

Error:

unit1.pas(40,71) Error: Identifier not found "ProcessInformation" !

Help!

marcov:
processinformation afaik is a variable that you must declare. See MSDN

leandrojcbh:
But How?

I want do execute a .exe file!
Can you help!

I´m lost!

leandrojcbh:
This is my prog:


unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, Forms, Controls, Dialogs, Menus,
  StdCtrls, Buttons, ExtCtrls, ComCtrls, DbCtrls, shellapi, process,
  windows, winceproc, winceint;

type

  { TForm1 }

  TForm1 = class(TForm)
    Button1: TButton;
    Edit1: TEdit;
    procedure Button1Click(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.lfm}

{ TForm1 }

procedure TForm1.Button1Click(Sender: TObject);
var
  ProcessInformation:tProcessInformation;

begin

  CreateProcess(pwidechar('volume.exe'), Nil, Nil, Nil,
  False, CREATE_NEW_CONSOLE, Nil, Nil, StartupInfo, ProcessInformation);
end;

end.


What is wrong?

leandrojcbh:
I get it!

Thanks!!!

Navigation

[0] Message Index

[#] Next page

Go to full version