?? unit1.pas
字號:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TfrmMain = class(TForm)
btnSuspend: TButton;
btnResume: TButton;
procedure btnSuspendClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure btnResumeClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmMain: TfrmMain;
lpProcessInformation: TProcessInformation;
bCreateProcess: boolean;
implementation
{$R *.dfm}
procedure TfrmMain.btnSuspendClick(Sender: TObject);
begin
if bCreateProcess then
begin
SuspendThread(lpProcessInformation.hThread);
end;
end;
procedure TfrmMain.FormCreate(Sender: TObject);
var
lpStartupInfo: TStartupInfo;
begin
FillChar(lpStartupInfo, Sizeof(TStartupInfo), #0);
lpStartupInfo.cb := Sizeof(TStartupInfo);
lpStartupInfo.dwFlags := STARTF_USESHOWWINDOW;
lpStartupInfo.wShowWindow := SW_NORMAL;
bCreateProcess := CreateProcess('C:\winnt\Notepad.exe',nil, nil, nil,
True, NORMAL_PRIORITY_CLASS, nil, nil,
lpStartupInfo, lpProcessInformation);
if bCreateProcess then
begin
ShowMessage('啟動成功');
end;
end;
procedure TfrmMain.btnResumeClick(Sender: TObject);
begin
if bCreateProcess then
begin
ResumeThread(lpProcessInformation.hThread);
end;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -