close standalone with window-close button (X)

kitetaka's icon

Hi, maybe a newbie question:

By default, standalone built by Max quits with File menu or Ctrl+Q (on windows)
Is there a way to enable the red X button on right hand corner and close the application with it? now it's grayed out.

Thanks!

Ben Bracken's icon

If I understand what you want to do, you have to do a few things.

First, you need to enable the window close button. This is done with a window message to thispatcher with a loadbang.

Max Patch
Copy patch and select New From Clipboard in Max.

You then need to tell Max that when the patcher is closed, you want close the app. You can do this with a closebang that triggers a message to Max:

StvDee's icon

Hi to all

I don't know if the method Ben proposes is a good one or has a bug. I tried this on Max 5.0.7, WinXP Professional 32-bit, and I had a problem. Ok, if you try to build a simple .exe application it will close just fine; however the application still runs if you check the Windows Task Manager under the Processes tab. So unless this has a workaround, I believe it can cause far more problems than to solve.

All the best,

Stav.

Ben Bracken's icon

Hi Stav,

I can't repro here. Please update to 5.1.4: https://cycling74.com/downloads

-Ben

Roman Thilenius's icon

[closebang]

|

";max
quit"

knagle's icon

Sorry to reignite an old topic. I've just been trying Ben's method on a standalone built from Max 5.1.9 and it works fine on a Windows 7 machine. However, on Windows XP, even though the application seems to close I get a Windows error message saying "MaxMSP has encountered a problem and needs to close. We are sorry for the inconvenience". It does not continue to run in the background if I check the task manager however.