# Intercepting Command-Q

**URL:** <https://forum.juce.com/t/intercepting-command-q/8026>\
**Category:** MacOSX and iOS\
**Created:** [January 23, 2012, 5:44pm UTC](https://forum.juce.com/t/intercepting-command-q/8026 "2012-01-23T17:44:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MusicMan3001](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@MusicMan3001](https://forum.juce.com/u/MusicMan3001)\
**Post date:** [January 23, 2012, 5:44pm UTC](https://forum.juce.com/t/intercepting-command-q/8026/1 "2012-01-23T17:44:11Z")

</div>

Hi folks, when I press Command-Q in the Juce app I’m writing, it seems to call AppClass::shutdown directly, and there’s no way to abort shutting down at that point. What I’d like to do is pop up a dialog asking the user if they are sure that they want to quit. If not, they should be able to go back to using the app.

I should note that on Windows, pressing Alt-F4 seems to call my DocumentWindow’s closeButtonPressed method, which allows me to handle the situation I described above. Just wondering how to do so on Mac.

Thanks.

---

<div class="post-metadata">

**Author:** ![matt](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/matt/32/18340_2.png) [@matt](https://forum.juce.com/u/matt)\
**Post date:** [January 23, 2012, 10:27pm UTC](https://forum.juce.com/t/intercepting-command-q/8026/2 "2012-01-23T22:27:37Z")

</div>

Try hooking JUCEApplication::systemRequestedQuit.

Matt

---

<div class="post-metadata">

**Author:** ![MusicMan3001](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@MusicMan3001](https://forum.juce.com/u/MusicMan3001)\
**Post date:** [January 23, 2012, 10:34pm UTC](https://forum.juce.com/t/intercepting-command-q/8026/3 "2012-01-23T22:34:31Z")

</div>

Oh yeah. Duh. Didn’t see that. Thanks.
