Code: Select all
EnableExplicit
Define prog = RunProgram("test.exe", "", "", #PB_Program_Open)
Define error
Define errorMsg.s = Space(255)
If IsProgram(prog)
Define progHandle = OpenProcess_(#PROCESS_ALL_ACCESS, #False, ProgramID(prog))
Define error = GetLastError_()
FormatMessage_(#FORMAT_MESSAGE_FROM_SYSTEM, #Null, error, 0, @errorMsg, 255, #Null)
SetWindowText_(progHandle, "testing")
ShowWindow_(progHandle, #SW_HIDE)
EndIf
CloseProgram(prog)Code: Select all
OpenWindow(0, 100, 100, 640, 480, "", #PB_Window_SystemMenu | #PB_Window_TitleBar | #PB_Window_MinimizeGadget)
Global quit
Repeat
event = WaitWindowEvent()
If event = #PB_Event_CloseWindow
quit = #True
EndIf
Until quit
