Add MacHideApp

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52009 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2008-02-22 20:37:43 +00:00
parent 6fba6c78a4
commit 975bcfda0d
2 changed files with 14 additions and 0 deletions

View File

@@ -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()
};

View File

@@ -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<HICommand>(kEventParamDirectObject, command );
SendEventToApplication( event );
}