hStarting := CreateEvent(nil, False, False, PChar(SCnDebugStartEventName));
if 31 < WinExec(PAnsiChar(ViewerExe + AnsiString(IntToStr(GetCurrentProcessId))),
SW_SHOW) then // 成功创建,等待
begin
if hStarting <> 0 then
begin
WaitForSingleObject(hStarting, CnDebugStartingEventTime);
CloseHandle(hStarting);
end;
end;