Version: 3.0.5
Loading...
Searching...
No Matches
init.h File Reference

Classes

class  wxInitializer
 Create an object of this class on the stack to initialize/cleanup the library automatically. More...
 

Functions

bool wxEntryStart (int &argc, wxChar **argv)
 This function can be used to perform the initialization of wxWidgets if you can't use the default initialization code for any reason.
 
bool wxEntryStart (HINSTANCE hInstance, HINSTANCE hPrevInstance=NULL, char *pCmdLine=NULL, int nCmdShow=SW_SHOWNORMAL)
 See wxEntryStart(int&,wxChar**) for more info about this function.
 
void wxEntryCleanup ()
 Free resources allocated by a successful call to wxEntryStart().
 
bool wxInitialize (int argc=0, wxChar **argv=NULL)
 Initialize the library (may be called as many times as needed, but each call to wxInitialize() must be matched by wxUninitialize()).
 
void wxUninitialize ()
 Clean up; the library can't be used any more after the last call to wxUninitialize().
 
void wxMSWDisableSettingHighDPIAware ()
 Prevents wxWidgets from setting HighDPI awareness mode.
 

Function Documentation

◆ wxEntryCleanup()

void wxEntryCleanup ( )

Free resources allocated by a successful call to wxEntryStart().

Include file:

#include <wx/init.h> 

◆ wxEntryStart() [1/2]

bool wxEntryStart ( HINSTANCE  hInstance,
HINSTANCE  hPrevInstance = NULL,
char *  pCmdLine = NULL,
int  nCmdShow = SW_SHOWNORMAL 
)

See wxEntryStart(int&,wxChar**) for more info about this function.

This is an additional overload of wxEntryStart() provided under MSW only. It is meant to be called with the parameters passed to WinMain().

Note
Under Windows CE platform, and only there, the type of pCmdLine is wchar_t *, otherwise it is char *, even in Unicode build.
Availability:  only available for the wxMSW port.

Include file:

#include <wx/init.h> 

◆ wxEntryStart() [2/2]

bool wxEntryStart ( int &  argc,
wxChar **  argv 
)

This function can be used to perform the initialization of wxWidgets if you can't use the default initialization code for any reason.

If the function returns true, the initialization was successful and the global wxApp object wxTheApp has been created. Moreover, wxEntryCleanup() must be called afterwards. If the function returns false, a catastrophic initialization error occurred and (at least the GUI part of) the library can't be used at all.

Notice that parameters argc and argv may be modified by this function.

Include file:

#include <wx/init.h> 

◆ wxInitialize()

bool wxInitialize ( int  argc = 0,
wxChar **  argv = NULL 
)

Initialize the library (may be called as many times as needed, but each call to wxInitialize() must be matched by wxUninitialize()).

With this function you may avoid wxDECLARE_APP() and wxIMPLEMENT_APP() macros and use wxInitialize() and wxUninitialize() dynamically in the program startup and termination.

Include file:

#include <wx/init.h> 

◆ wxMSWDisableSettingHighDPIAware()

void wxMSWDisableSettingHighDPIAware ( )

Prevents wxWidgets from setting HighDPI awareness mode.

wxEntry calls SetDPIProcessAware() early during initialization on Windows. To prevent this (e.g. because wx is embedded in native code and disabling DPI awareness in the manifest is not an option), call this function before* wxEntry() is called.

Availability:  only available for the wxMSW port.

Include file:

#include <wx/init.h> 
Since
3.0.3, but only available in 3.0.x, not 3.1+ which doesn't make the SetDPIProcessAware() call anymore.

◆ wxUninitialize()

void wxUninitialize ( )

Clean up; the library can't be used any more after the last call to wxUninitialize().

See wxInitialize() for more info.

Include file:

#include <wx/init.h>