 							if (InStr(strTemp, "TESConstructionSet.exe"))
 							temp := proc.ProcessId
 						}
+					fTemp++
+
+						if (fTemp == 10)
+						break
+					}
+				WinWaitActive, , TES Construction Set, 6
+
+					if (!temp || errorlevel)
+					{
+					PrgLnch.DoWOw64Revert(disableRedirect, oldRedirectionValue)
+					ReplaceSystemCursor()
+					return "CSE cancelled"
 					}
 				PrgPIDtmp := temp 
-				WinWaitActive, , TES Construction Set, 10
 				sleep 300
 				}
 				else

GuiControl, PrgLnchOpt:, RnPrgLnch, &Test Run Prg


borderToggle := DcmpExecutable(selPrgChoice, PrgChoicePaths, PrgLnkInf, PrgResolveShortcut, 1)

StoreFetchPrgRes(selPrgChoice, PrgLnkInf, targMonitorNum)
SetResDefaults(targMonitorNum, 1)
CheckModesFunc(defPrgStrng, PresetPropHwnd, targMonitorNum, iDevNumArray, ResIndexList, allModes)

TogglePrgOptCtrls(txtPrgChoice, ResShortcut, iDevNum, iDevNumArray, targMonitorNum, borderToggle, selPrgChoice, PrgChgResOnSwitch, PrgChoicePaths, PrgLnkInf, PrgRnMinMax, PrgRnPriority, PrgLnchHide, 1)

GuiControl, PrgLnchOpt: ChooseString, iDevNum, %targMonitorNum%



	GuiControl, PrgLnchOpt:, PrgMinMax, % PrgRnMinMax[selPrgChoice]
	GuiControl, PrgLnchOpt: Enable, PrgPriority
	GuiControl, PrgLnchOpt:, PrgPriority, % PrgLnchOpt.GetPrgRnPriority(selPrgChoice)
	GuiControl, PrgLnchOpt: Text, Bordless, Ext. Borderless
		if (PrgLnchOpt.borderToggle)
		{ 
		GuiControl, PrgLnchOpt: Enable, Bordless
		GuiControl, PrgLnchOpt:, Bordless, % PrgLnchOpt.GetPrgBordless(selPrgChoice)
		}
