Run_Process = System.Diagnostics.Process.Start("PBrush", Filename) If Run_Process.WaitForInputIdle() AndAlso Not Run_Process?.HasExited AndAlso MsgBox("閉じる?", MsgBoxStyle.Question Or MsgBoxStyle.YesNo Or MsgBoxStyle.SystemModal) _ = MsgBoxResult.Yes Then Run_Process.CloseMainWindow() End If Run_Process.Close()