program Project1;uses Forms, Unit1 in 'Unit1.pas' {Form1};{$R *.res}begin if myProc = 1 then begin Application.Initialize; Application.CreateForm(TForm1, Form1); Application.Run; end; end.
是用于软件狗加密么?如果是用下面的代码实现启动检测,启动后再用线程检测吧。program Project1; uses Forms, Unit1 in 'Unit1.pas' {Form1}; {$R *.res} begin if myProc = 1 then begin Application.Initialize; Application.CreateForm(TForm1, Form1); Application.Run; end; end.
问一下,if myProc = 1 then 是怎么得来的,能写点具体的代码吗?在线程方面我是个初学者
//工程文件 program Project1;uses Forms, Unit1 in 'Unit1.pas' {Form1}, Unit2 in 'Unit2.pas'; {TTesthread}var Test: TTestThread;{$R *.res}begin R := 0; Test := TTestThread.Create(False); Test.WaitFor; if R = 1 then begin Application.Initialize; Application.CreateForm(TForm1, Form1); Application.Run; end; end.//线程单元 unit Unit2;interfaceuses Classes;type TTestThread = class(TThread) protected procedure Execute; override; end;implementationprocedure TTestThread.Execute; begin R := 1; //你在这里判断后再给R赋值到底是0还是1。 end;end. 这就是你想要的了. 给你写好代码了. 发帖急需分啊......
抱歉. 上面写太快忘了行代码. 重新发下. //工程文件 program Project1;uses Forms, Windows, Unit1 in 'Unit1.pas' {Form1}, Unit2 in 'Unit2.pas'; {TTesthread}var Test: TTestThread;{$R *.res}begin R := 0; Test := TTestThread.Create(False); Test.WaitFor; if R = 1 then begin Application.Initialize; Application.CreateForm(TForm1, Form1); Application.Run; end; end.//线程单元 unit Unit2;interfaceuses Windows, Classes;type TTestThread = class(TThread) protected procedure Execute; override; end;var R: DWORD;implementationprocedure TTestThread.Execute; begin R := 1; //你在这里判断后再给R赋值到底是0还是1。 end;end.
Forms,
Unit1 in 'Unit1.pas' {Form1};{$R *.res}begin
if myProc = 1 then
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end;
end.
Forms,
Unit1 in 'Unit1.pas' {Form1}; {$R *.res} begin
if myProc = 1 then
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end;
end.
是怎么得来的,能写点具体的代码吗?在线程方面我是个初学者
//工程文件
program Project1;uses
Forms,
Unit1 in 'Unit1.pas' {Form1},
Unit2 in 'Unit2.pas'; {TTesthread}var
Test: TTestThread;{$R *.res}begin
R := 0;
Test := TTestThread.Create(False);
Test.WaitFor;
if R = 1 then
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end;
end.//线程单元
unit Unit2;interfaceuses
Classes;type
TTestThread = class(TThread)
protected
procedure Execute; override;
end;implementationprocedure TTestThread.Execute;
begin
R := 1; //你在这里判断后再给R赋值到底是0还是1。
end;end.
这就是你想要的了. 给你写好代码了. 发帖急需分啊......
关键在与Test.WaitFor;
就是等待线程执行完了才继续执行下面的代码.
//工程文件
program Project1;uses
Forms,
Windows,
Unit1 in 'Unit1.pas' {Form1},
Unit2 in 'Unit2.pas'; {TTesthread}var
Test: TTestThread;{$R *.res}begin
R := 0;
Test := TTestThread.Create(False);
Test.WaitFor;
if R = 1 then
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end;
end.//线程单元
unit Unit2;interfaceuses Windows, Classes;type
TTestThread = class(TThread)
protected
procedure Execute; override;
end;var
R: DWORD;implementationprocedure TTestThread.Execute;
begin
R := 1; //你在这里判断后再给R赋值到底是0还是1。
end;end.