1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
#include "MainFrame.h"
#include <wx/app.h>
#include <wx/event.h>
#include <wx/image.h>
#ifdef __WXMSW__
typedef BOOL WINAPI (*SetProcessDPIAwareFunc)();
#endif
// Define the MainApp
class MainApp : public wxApp
{
public:
MainApp() {}
virtual ~MainApp() {}
virtual bool OnInit()
{
#ifdef __WXMSW__
HINSTANCE user32Dll = LoadLibrary(L"User32.dll");
if(user32Dll) {
SetProcessDPIAwareFunc pFunc = (SetProcessDPIAwareFunc)GetProcAddress(user32Dll, "SetProcessDPIAware");
if(pFunc) { pFunc(); }
FreeLibrary(user32Dll);
user32Dll = NULL;
}
#endif
// Add the common image handlers
wxImage::AddHandler(new wxPNGHandler);
wxImage::AddHandler(new wxJPEGHandler);
MainFrame* mainFrame = new MainFrame(NULL);
SetTopWindow(mainFrame);
return GetTopWindow()->Show();
}
};
DECLARE_APP(MainApp)
IMPLEMENT_APP(MainApp)
|