]> git.saurik.com Git - wxWidgets.git/blob - interface/app.h
added convenient wxON_BLOCK_EXIT_THISn() macros wrapping wxON_BLOCK_EXIT_OBJn(*this)
[wxWidgets.git] / interface / app.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: app.h
3 // Purpose: interface of wxApp
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9
10 /**
11 @class wxAppConsole
12 @wxheader{app.h}
13
14 This class is essential for writing console-only or hybrid apps without
15 having to define wxUSE_GUI=0.
16
17 @todo MORE INFO
18
19 @library{wxbase}
20 @category{appmanagement}
21
22 @see @ref overview_app
23 */
24 class wxAppConsole : public wxEvtHandler
25 {
26 protected:
27 /**
28 Creates the wxAppTraits object when GetTraits() needs it for the first time.
29
30 @see wxAppTraits
31 */
32 virtual wxAppTraits* CreateTraits();
33
34 public:
35
36 /**
37 Constructor.
38 */
39 wxAppConsole();
40
41 /**
42 Destructor.
43 */
44 virtual ~wxAppConsole();
45
46 /**
47 Dispatches the next event in the windowing system event queue.
48 Blocks until an event appears if there are none currently
49 (use Pending() if this is not wanted).
50
51 This can be used for programming event loops, e.g.
52
53 @code
54 while (app.Pending())
55 Dispatch();
56 @endcode
57
58 @return @false if the event loop should stop and @true otherwise.
59
60 @see Pending()
61 */
62 virtual bool Dispatch();
63
64 /**
65 Call this to explicitly exit the main message (event) loop.
66 You should normally exit the main loop (and the application) by deleting
67 the top window.
68 */
69 virtual void ExitMainLoop();
70
71 /**
72 This function is called before processing any event and allows the application
73 to preempt the processing of some events.
74
75 If this method returns -1 the event is processed normally, otherwise either
76 @true or @false should be returned and the event processing stops immediately
77 considering that the event had been already processed (for the former return
78 value) or that it is not going to be processed at all (for the latter one).
79 */
80 virtual int FilterEvent(wxEvent& event);
81
82 /**
83 Returns the user-readable application name.
84
85 The difference between this string and the one returned by GetAppName() is that
86 this one is meant to be shown to the user and so should be used for the window
87 titles, page headers and so on while the other one should be only used internally,
88 e.g. for the file names or configuration file keys.
89 By default, returns the same string as GetAppName().
90
91 @wxsince{2.9.0}
92 */
93 wxString GetAppDisplayName() const;
94
95 /**
96 Returns the application name.
97
98 @remarks wxWidgets sets this to a reasonable default before calling
99 OnInit(), but the application can reset it at will.
100
101 @see GetAppDisplayName()
102 */
103 wxString GetAppName() const;
104
105 /**
106 Gets the class name of the application. The class name may be used in a
107 platform specific manner to refer to the application.
108
109 @see SetClassName()
110 */
111 wxString GetClassName() const;
112
113 /**
114 Returns the one and only global application object.
115 Usually ::wxTheApp is usead instead.
116
117 @see SetInstance()
118 */
119 static wxAppConsole* GetInstance();
120
121 /**
122 Returns a pointer to the wxAppTraits object for the application.
123 If you want to customize the wxAppTraits object, you must override the
124 CreateTraits() function.
125 */
126 wxAppTraits* GetTraits();
127
128 /**
129 Returns the user-readable vendor name. The difference between this string
130 and the one returned by GetVendorName() is that this one is meant to be shown
131 to the user and so should be used for the window titles, page headers and so on
132 while the other one should be only used internally, e.g. for the file names or
133 configuration file keys.
134
135 By default, returns the same string as GetVendorName().
136
137 @wxsince{2.9.0}
138 */
139 const wxString& GetVendorDisplayName() const;
140
141 /**
142 Returns the application's vendor name.
143 */
144 const wxString& GetVendorName() const;
145
146 /**
147 This function simply invokes the given method @a func of the specified
148 event handler @a handler with the @a event as parameter. It exists solely
149 to allow to catch the C++ exceptions which could be thrown by all event
150 handlers in the application in one place: if you want to do this, override
151 this function in your wxApp-derived class and add try/catch clause(s) to it.
152 */
153 virtual void HandleEvent(wxEvtHandler* handler,
154 wxEventFunction func,
155 wxEvent& event) const;
156
157 /**
158 Returns @true if the main event loop is currently running, i.e. if the
159 application is inside OnRun().
160
161 This can be useful to test whether events can be dispatched. For example,
162 if this function returns @false, non-blocking sockets cannot be used because
163 the events from them would never be processed.
164 */
165 static bool IsMainLoopRunning();
166
167 /**
168 Mac specific. Called in response of an "open-application" Apple event.
169 Override this to create a new document in your app.
170 */
171 virtual void MacNewFile();
172
173 /**
174 Mac specific. Called in response of an "open-document" Apple event.
175
176 You need to override this method in order to open a document file after the
177 user double clicked on it or if the document file was dropped on either the
178 running application or the application icon in Finder.
179 */
180 virtual void MacOpenFile(const wxString& fileName);
181
182 /**
183 Mac specific. Called in response of a "get-url" Apple event.
184 */
185 virtual void MacOpenURL(const wxString& url);
186
187 /**
188 Mac specific. Called in response of a "print-document" Apple event.
189 */
190 virtual void MacPrintFile(const wxString& fileName);
191
192 /**
193 Mac specific. Called in response of a "reopen-application" Apple event.
194 */
195 virtual void MacReopenApp();
196
197 /**
198 Called by wxWidgets on creation of the application. Override this if you wish
199 to provide your own (environment-dependent) main loop.
200
201 @returns Returns 0 under X, and the wParam of the WM_QUIT message under
202 Windows.
203 */
204 virtual int MainLoop();
205
206 /**
207 This function is called when an assert failure occurs, i.e. the condition
208 specified in wxASSERT() macro evaluated to @false.
209
210 It is only called in debug mode (when @c __WXDEBUG__ is defined) as
211 asserts are not left in the release code at all.
212 The base class version shows the default assert failure dialog box proposing to
213 the user to stop the program, continue or ignore all subsequent asserts.
214
215 @param file
216 the name of the source file where the assert occurred
217 @param line
218 the line number in this file where the assert occurred
219 @param func
220 the name of the function where the assert occurred, may be
221 empty if the compiler doesn't support C99 __FUNCTION__
222 @param cond
223 the condition of the failed assert in text form
224 @param msg
225 the message specified as argument to wxASSERT_MSG or wxFAIL_MSG, will
226 be @NULL if just wxASSERT or wxFAIL was used
227 */
228 virtual void OnAssertFailure(const wxChar *file,
229 int line,
230 const wxChar *func,
231 const wxChar *cond,
232 const wxChar *msg);
233
234 /**
235 Called when command line parsing fails (i.e. an incorrect command line option
236 was specified by the user). The default behaviour is to show the program usage
237 text and abort the program.
238
239 Return @true to continue normal execution or @false to return
240 @false from OnInit() thus terminating the program.
241
242 @see OnInitCmdLine()
243 */
244 virtual bool OnCmdLineError(wxCmdLineParser& parser);
245
246 /**
247 Called when the help option (@c --help) was specified on the command line.
248 The default behaviour is to show the program usage text and abort the program.
249
250 Return @true to continue normal execution or @false to return
251 @false from OnInit() thus terminating the program.
252
253 @see OnInitCmdLine()
254 */
255 virtual bool OnCmdLineHelp(wxCmdLineParser& parser);
256
257 /**
258 Called after the command line had been successfully parsed. You may override
259 this method to test for the values of the various parameters which could be
260 set from the command line.
261
262 Don't forget to call the base class version unless you want to suppress
263 processing of the standard command line options.
264 Return @true to continue normal execution or @false to return @false from
265 OnInit() thus terminating the program.
266
267 @see OnInitCmdLine()
268 */
269 virtual bool OnCmdLineParsed(wxCmdLineParser& parser);
270
271 /**
272 This function is called if an unhandled exception occurs inside the main
273 application event loop. It can return @true to ignore the exception and to
274 continue running the loop or @false to exit the loop and terminate the
275 program. In the latter case it can also use C++ @c throw keyword to
276 rethrow the current exception.
277
278 The default behaviour of this function is the latter in all ports except under
279 Windows where a dialog is shown to the user which allows him to choose between
280 the different options. You may override this function in your class to do
281 something more appropriate.
282
283 Finally note that if the exception is rethrown from here, it can be caught in
284 OnUnhandledException().
285 */
286 virtual bool OnExceptionInMainLoop();
287
288 /**
289 Override this member function for any processing which needs to be
290 done as the application is about to exit. OnExit is called after
291 destroying all application windows and controls, but before
292 wxWidgets cleanup. Note that it is not called at all if
293 OnInit() failed.
294
295 The return value of this function is currently ignored, return the same
296 value as returned by the base class method if you override it.
297 */
298 virtual int OnExit();
299
300 /**
301 This function may be called if something fatal happens: an unhandled
302 exception under Win32 or a a fatal signal under Unix, for example. However,
303 this will not happen by default: you have to explicitly call
304 wxHandleFatalExceptions() to enable this.
305
306 Generally speaking, this function should only show a message to the user and
307 return. You may attempt to save unsaved data but this is not guaranteed to
308 work and, in fact, probably won't.
309
310 @see wxHandleFatalExceptions()
311 */
312 virtual void OnFatalException();
313
314 /**
315 This must be provided by the application, and will usually create the
316 application's main window, optionally calling SetTopWindow().
317
318 You may use OnExit() to clean up anything initialized here, provided
319 that the function returns @true.
320
321 Notice that if you want to to use the command line processing provided by
322 wxWidgets you have to call the base class version in the derived class
323 OnInit().
324
325 Return @true to continue processing, @false to exit the application
326 immediately.
327 */
328 virtual bool OnInit();
329
330 /**
331 Called from OnInit() and may be used to initialize the parser with the
332 command line options for this application. The base class versions adds
333 support for a few standard options only.
334 */
335 virtual void OnInitCmdLine(wxCmdLineParser& parser);
336
337 /**
338 This virtual function is where the execution of a program written in wxWidgets
339 starts. The default implementation just enters the main loop and starts
340 handling the events until it terminates, either because ExitMainLoop() has
341 been explicitly called or because the last frame has been deleted and
342 GetExitOnFrameDelete() flag is @true (this is the default).
343
344 The return value of this function becomes the exit code of the program, so it
345 should return 0 in case of successful termination.
346 */
347 virtual int OnRun();
348
349 /**
350 This function is called when an unhandled C++ exception occurs inside
351 OnRun() (the exceptions which occur during the program startup and shutdown
352 might not be caught at all). Notice that by now the main event loop has been
353 terminated and the program will exit, if you want to prevent this from happening
354 (i.e. continue running after catching an exception) you need to override
355 OnExceptionInMainLoop().
356
357 The default implementation shows information about the exception in debug build
358 but does nothing in the release build.
359 */
360 virtual void OnUnhandledException();
361
362 /**
363 Returns @true if unprocessed events are in the window system event queue.
364
365 @see Dispatch()
366 */
367 virtual bool Pending();
368
369 /**
370 Set the application name to be used in the user-visible places such as window
371 titles. See GetAppDisplayName() for more about the differences between the
372 display name and name.
373 */
374 void SetAppDisplayName(const wxString& name);
375
376 /**
377 Sets the name of the application. This name should be used for file names,
378 configuration file entries and other internal strings. For the user-visible
379 strings, such as the window titles, the application display name set by
380 SetAppDisplayName() is used instead.
381
382 By default the application name is set to the name of its executable file.
383
384 @see GetAppName()
385 */
386 void SetAppName(const wxString& name);
387
388 /**
389 Sets the class name of the application. This may be used in a platform specific
390 manner to refer to the application.
391
392 @see GetClassName()
393 */
394 void SetClassName(const wxString& name);
395
396 /**
397 Allows external code to modify global ::wxTheApp, but you should really
398 know what you're doing if you call it.
399
400 @param app
401 Replacement for the global application object.
402
403 @see GetInstance()
404 */
405 static void SetInstance(wxAppConsole* app);
406
407 /**
408 Set the vendor name to be used in the user-visible places.
409 See GetVendorDisplayName() for more about the differences between the
410 display name and name.
411 */
412 void SetVendorDisplayName(const wxString& name);
413
414 /**
415 Sets the name of application's vendor. The name will be used
416 in registry access. A default name is set by wxWidgets.
417
418 @see GetVendorName()
419 */
420 void SetVendorName(const wxString& name);
421
422 /**
423 Yields control to pending messages in the windowing system.
424
425 This can be useful, for example, when a time-consuming process writes to a
426 text window. Without an occasional yield, the text window will not be updated
427 properly, and on systems with cooperative multitasking, such as Windows 3.1
428 other processes will not respond.
429
430 Caution should be exercised, however, since yielding may allow the
431 user to perform actions which are not compatible with the current task.
432 Disabling menu items or whole menus during processing can avoid unwanted
433 reentrance of code: see ::wxSafeYield for a better function.
434
435 Note that Yield() will not flush the message logs. This is intentional as
436 calling Yield() is usually done to quickly update the screen and popping up
437 a message box dialog may be undesirable. If you do wish to flush the log
438 messages immediately (otherwise it will be done during the next idle loop
439 iteration), call wxLog::FlushActive.
440
441 Calling Yield() recursively is normally an error and an assert failure is
442 raised in debug build if such situation is detected. However if the
443 @a onlyIfNeeded parameter is @true, the method will just silently
444 return @false instead.
445 */
446 virtual bool Yield(bool onlyIfNeeded = false);
447
448 /**
449 Number of command line arguments (after environment-specific processing).
450 */
451 int argc;
452
453 /**
454 Command line arguments (after environment-specific processing).
455
456 Under Windows and Linux/Unix, you should parse the command line
457 arguments and check for files to be opened when starting your
458 application. Under OS X, you need to override MacOpenFile()
459 since command line arguments are used differently there.
460
461 You may use the wxCmdLineParser to parse command line arguments.
462 */
463 wxChar** argv;
464 };
465
466
467
468
469 /**
470 @class wxApp
471 @wxheader{app.h}
472
473 The wxApp class represents the application itself. It is used to:
474
475 @li set and get application-wide properties;
476 @li implement the windowing system message or event loop;
477 @li initiate application processing via wxApp::OnInit;
478 @li allow default processing of events not handled by other
479 objects in the application.
480
481 You should use the macro IMPLEMENT_APP(appClass) in your application
482 implementation file to tell wxWidgets how to create an instance of your
483 application class.
484
485 Use DECLARE_APP(appClass) in a header file if you want the wxGetApp function
486 (which returns a reference to your application object) to be visible to other
487 files.
488
489 @library{wxbase}
490 @category{appmanagement}
491
492 @see @ref overview_app
493 */
494 class wxApp : public wxAppConsole
495 {
496 public:
497 /**
498 Constructor. Called implicitly with a definition of a wxApp object.
499 */
500 wxApp();
501
502 /**
503 Destructor. Will be called implicitly on program exit if the wxApp
504 object is created on the stack.
505 */
506 virtual ~wxApp();
507
508 /**
509 Returns @true if the application will exit when the top-level frame is deleted.
510
511 @see SetExitOnFrameDelete()
512 */
513 bool GetExitOnFrameDelete() const;
514
515 /**
516 Returns @true if the application will use the best visual on systems that support
517 different visuals, @false otherwise.
518
519 @see SetUseBestVisual()
520 */
521 bool GetUseBestVisual() const;
522
523 /**
524 Returns a pointer to the top window.
525
526 @remarks If the top window hasn't been set using SetTopWindow(),
527 this function will find the first top-level window
528 (frame or dialog) and return that.
529
530 @see SetTopWindow()
531 */
532 virtual wxWindow* GetTopWindow() const;
533
534 /**
535 Returns @true if the application is active, i.e. if one of its windows is
536 currently in the foreground.
537
538 If this function returns @false and you need to attract users attention to
539 the application, you may use wxTopLevelWindow::RequestUserAttention to do it.
540 */
541 virtual bool IsActive() const;
542
543 /**
544 Windows-only function for processing a message. This function is called
545 from the main message loop, checking for windows that may wish to process it.
546
547 The function returns @true if the message was processed, @false otherwise.
548 If you use wxWidgets with another class library with its own message loop,
549 you should make sure that this function is called to allow wxWidgets to
550 receive messages. For example, to allow co-existence with the Microsoft
551 Foundation Classes, override the PreTranslateMessage function:
552
553 @code
554 // Provide wxWidgets message loop compatibility
555 BOOL CTheApp::PreTranslateMessage(MSG *msg)
556 {
557 if (wxTheApp && wxTheApp->ProcessMessage((WXMSW *)msg))
558 return true;
559 else
560 return CWinApp::PreTranslateMessage(msg);
561 }
562 @endcode
563 */
564 bool ProcessMessage(WXMSG* msg);
565
566 /**
567 Sends idle events to a window and its children.
568 Please note that this function is internal to wxWidgets and shouldn't be used
569 by user code.
570
571 @remarks These functions poll the top-level windows, and their children,
572 for idle event processing. If @true is returned, more OnIdle
573 processing is requested by one or more window.
574
575 @see wxIdleEvent
576 */
577 virtual bool SendIdleEvents(wxWindow* win, wxIdleEvent& event);
578
579 /**
580 Allows the programmer to specify whether the application will exit when the
581 top-level frame is deleted.
582
583 @param flag
584 If @true (the default), the application will exit when the top-level frame
585 is deleted. If @false, the application will continue to run.
586
587 @see GetExitOnFrameDelete(), @ref overview_app_shutdown
588 */
589 void SetExitOnFrameDelete(bool flag);
590
591 /**
592 Allows external code to modify global ::wxTheApp, but you should really
593 know what you're doing if you call it.
594
595 @param app
596 Replacement for the global application object.
597
598 @see GetInstance()
599 */
600 static void SetInstance(wxAppConsole* app);
601
602 /**
603 Allows runtime switching of the UI environment theme.
604
605 Currently implemented for wxGTK2-only.
606 Return @true if theme was successfully changed.
607
608 @param theme
609 The name of the new theme or an absolute path to a gtkrc-theme-file
610 */
611 virtual bool SetNativeTheme(const wxString& theme);
612
613 /**
614 Sets the 'top' window. You can call this from within OnInit() to let wxWidgets
615 know which is the main window. You don't have to set the top window;
616 it is only a convenience so that (for example) certain dialogs without parents
617 can use a specific window as the top window. If no top window is specified by the
618 application, wxWidgets just uses the first frame or dialog in its top-level window
619 list, when it needs to use the top window.
620
621 @param window
622 The new top window.
623
624 @see GetTopWindow(), OnInit()
625 */
626 void SetTopWindow(wxWindow* window);
627
628 /**
629 Allows the programmer to specify whether the application will use the best
630 visual on systems that support several visual on the same display. This is typically
631 the case under Solaris and IRIX, where the default visual is only 8-bit whereas
632 certain applications are supposed to run in TrueColour mode.
633
634 Note that this function has to be called in the constructor of the wxApp
635 instance and won't have any effect when called later on.
636 This function currently only has effect under GTK.
637
638 @param flag
639 If @true, the app will use the best visual.
640 @param forceTrueColour
641 If @true then the application will try to force using a TrueColour
642 visual and abort the app if none is found.
643 */
644 void SetUseBestVisual(bool flag, bool forceTrueColour = false);
645 };
646
647
648
649 // ============================================================================
650 // Global functions/macros
651 // ============================================================================
652
653
654 /** @ingroup group_funcmacro_rtti */
655 //@{
656
657 /**
658 This is used in headers to create a forward declaration of the wxGetApp()
659 function implemented by IMPLEMENT_APP().
660
661 It creates the declaration @a className wxGetApp(void).
662
663 @header{wx/app.h}
664
665 Example:
666
667 @code
668 DECLARE_APP(MyApp)
669 @endcode
670 */
671 #define DECLARE_APP( className )
672
673 /**
674 This is used in the application class implementation file to make the
675 application class known to wxWidgets for dynamic construction.
676
677 @header{wx/app.h}
678
679 Example:
680
681 @code
682 IMPLEMENT_APP(MyApp)
683 @endcode
684
685 @see DECLARE_APP().
686 */
687 #define IMPLEMENT_APP( className )
688
689 //@}
690
691
692
693 /**
694 The global pointer to the singleton wxApp object.
695
696 @see wxApp::GetInstance()
697 */
698 wxApp *wxTheApp;
699
700
701
702 /** @ingroup group_funcmacro_appinitterm */
703 //@{
704
705 /**
706 This function doesn't exist in wxWidgets but it is created by using the
707 IMPLEMENT_APP() macro.
708
709 Thus, before using it anywhere but in the same module where this macro is
710 used, you must make it available using DECLARE_APP().
711
712 The advantage of using this function compared to directly using the global
713 ::wxTheApp pointer is that the latter is of type wxApp* and so wouldn't
714 allow you to access the functions specific to your application class but
715 not present in wxApp while wxGetApp() returns the object of the right type.
716
717 @header{wx/app.h}
718 */
719 wxAppDerivedClass& wxGetApp();
720
721 /**
722 If @a doIt is @true, the fatal exceptions (also known as general protection
723 faults under Windows or segmentation violations in the Unix world) will be
724 caught and passed to wxApp::OnFatalException.
725
726 By default, i.e. before this function is called, they will be handled in
727 the normal way which usually just means that the application will be
728 terminated. Calling wxHandleFatalExceptions() with @a doIt equal to @false
729 will restore this default behaviour.
730
731 Notice that this function is only available if @c wxUSE_ON_FATAL_EXCEPTION
732 is 1 and under Windows platform this requires a compiler with support for
733 SEH (structured exception handling) which currently means only Microsoft
734 Visual C++ or a recent Borland C++ version.
735
736 @header{wx/app.h}
737 */
738 bool wxHandleFatalExceptions(bool doIt = true);
739
740 /**
741 This function is used in wxBase only and only if you don't create
742 wxApp object at all. In this case you must call it from your
743 @c main() function before calling any other wxWidgets functions.
744
745 If the function returns @false the initialization could not be performed,
746 in this case the library cannot be used and wxUninitialize() shouldn't be
747 called neither.
748
749 This function may be called several times but wxUninitialize() must be
750 called for each successful call to this function.
751
752 @header{wx/app.h}
753 */
754 bool wxInitialize();
755
756 /**
757 This function is for use in console (wxBase) programs only. It must be called
758 once for each previous successful call to wxInitialize().
759
760 @header{wx/app.h}
761 */
762 void wxUninitialize();
763
764 /**
765 This function wakes up the (internal and platform dependent) idle system,
766 i.e. it will force the system to send an idle event even if the system
767 currently @e is idle and thus would not send any idle event until after
768 some other event would get sent. This is also useful for sending events
769 between two threads and is used by the corresponding functions
770 wxPostEvent() and wxEvtHandler::AddPendingEvent().
771
772 @header{wx/app.h}
773 */
774 void wxWakeUpIdle();
775
776 /**
777 Calls wxApp::Yield.
778
779 @deprecated
780 This function is kept only for backwards compatibility. Please use
781 the wxApp::Yield method instead in any new code.
782
783 @header{wx/app.h}
784 */
785 bool wxYield();
786
787 /**
788 This function is similar to wxYield, except that it disables the user input to
789 all program windows before calling wxYield and re-enables it again
790 afterwards. If @a win is not @NULL, this window will remain enabled,
791 allowing the implementation of some limited user interaction.
792 Returns the result of the call to ::wxYield.
793
794 @header{wx/app.h}
795 */
796 bool wxSafeYield(wxWindow* win = NULL, bool onlyIfNeeded = false);
797
798 /**
799 This function initializes wxWidgets in a platform-dependent way. Use this if you
800 are not using the default wxWidgets entry code (e.g. main or WinMain).
801
802 For example, you can initialize wxWidgets from an Microsoft Foundation Classes
803 (MFC) application using this function.
804
805 @note This overload of wxEntry is available under all platforms.
806
807 @see wxEntryStart()
808
809 @header{wx/app.h}
810 */
811 int wxEntry(int& argc, wxChar** argv);
812
813 /**
814 See wxEntry(int&,wxChar**) for more info about this function.
815
816 Notice that under Windows CE platform, and only there, the type of @a pCmdLine
817 is @c wchar_t *, otherwise it is @c char *, even in Unicode build.
818
819 @remarks To clean up wxWidgets, call wxApp::OnExit followed by the static
820 function wxApp::CleanUp. For example, if exiting from an MFC application
821 that also uses wxWidgets:
822 @code
823 int CTheApp::ExitInstance()
824 {
825 // OnExit isn't called by CleanUp so must be called explicitly.
826 wxTheApp->OnExit();
827 wxApp::CleanUp();
828
829 return CWinApp::ExitInstance();
830 }
831 @endcode
832
833 @header{wx/app.h}
834 */
835 int wxEntry(HINSTANCE hInstance,
836 HINSTANCE hPrevInstance = NULL,
837 char* pCmdLine = NULL,
838 int nCmdShow = SW_SHOWNORMAL);
839
840 //@}
841
842
843
844 /** @ingroup group_funcmacro_procctrl */
845 //@{
846
847 /**
848 Exits application after calling wxApp::OnExit.
849
850 Should only be used in an emergency: normally the top-level frame
851 should be deleted (after deleting all other frames) to terminate the
852 application. See wxCloseEvent and wxApp.
853
854 @header{wx/app.h}
855 */
856 void wxExit();
857
858 //@}
859