Code: Select all
If OpenWindow(1,300,400,400,100,#PB_Window_SystemMenu,"AppThatClosesTheOther")
CreateGadgetList(WindowID())
ButtonGadget(0,10,10,100,25,"Close other")
Repeat
ev=WaitWindowEvent()
If ev=#PB_Event_Gadget
PostMessage_(FindWindow_(0,"AppToBeClosed"),#WM_CLOSE,0,0)
EndIf
Until ev=#PB_Event_CloseWindow
EndIf
Found myself needing something similar today. Is there any way to
force a DOS Window to close automatically? Your routine tries to
close a DOS window but Windows prompts for a user reply to force the
close on the DOS window. Maybe there is a way to force the whole thing?
Terry