From: Robin Dunn Date: Fri, 22 Feb 2008 20:37:43 +0000 (+0000) Subject: Add MacHideApp X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/975bcfda0d8e4a2e60bbfdd1ee9b1061e9221b4d Add MacHideApp git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52009 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/mac/carbon/app.h b/include/wx/mac/carbon/app.h index e44056bd9b..5a4fc4b923 100644 --- a/include/wx/mac/carbon/app.h +++ b/include/wx/mac/carbon/app.h @@ -124,6 +124,9 @@ public: // in response of a reopen-application apple event virtual void MacReopenApp() ; + // Hide the application windows the same as the system hide command would do it. + void MacHideApp(); + DECLARE_EVENT_TABLE() }; diff --git a/src/mac/carbon/app.cpp b/src/mac/carbon/app.cpp index 62c6ee4992..749119f1bf 100644 --- a/src/mac/carbon/app.cpp +++ b/src/mac/carbon/app.cpp @@ -1635,3 +1635,14 @@ void wxApp::MacCreateKeyEvent( wxKeyEvent& event, wxWindow* focus , long keymess event.SetTimestamp(when); event.SetEventObject(focus); } + + +void wxApp::MacHideApp() +{ + wxMacCarbonEvent event( kEventClassCommand , kEventCommandProcess ); + HICommand command; + memset( &command, 0 , sizeof(command) ); + command.commandID = kHICommandHide ; + event.SetParameter(kEventParamDirectObject, command ); + SendEventToApplication( event ); +}