+
+ // finally do the last check: has unicows.lib initialized correctly?
+ hmod = ::LoadLibraryW(L"unicows.dll");
+ if ( !hmod )
+ {
+ ::MessageBox
+ (
+ NULL,
+ L"This program uses Unicode but is not using unicows.dll\n"
+ L"correctly and so cannot work under current operating system.\n"
+ L"Please contact the program author for an updated version.\n"
+ L"\n"
+ L"Program aborted.",
+ ERROR_STRING,
+ MB_ICONERROR | MB_OK
+ );
+
+ return false;
+ }
+
+ ::FreeLibrary(hmod);
+#endif // !wxUSE_UNICODE_MSLU
+ }
+
+ return true;
+}
+
+#endif // NEED_UNICODE_CHECK
+
+void wxSetProcessDPIAware()
+{
+#if wxUSE_DYNLIB_CLASS
+ typedef BOOL (WINAPI *SetProcessDPIAware_t)(void);
+ wxDynamicLibrary dllUser32(wxT("user32.dll"));
+ SetProcessDPIAware_t pfnSetProcessDPIAware =
+ (SetProcessDPIAware_t)dllUser32.RawGetSymbol(wxT("SetProcessDPIAware"));
+
+ if ( pfnSetProcessDPIAware )
+ pfnSetProcessDPIAware();
+#endif // wxUSE_DYNLIB_CLASS
+}
+
+} //anonymous namespace
+
+// ----------------------------------------------------------------------------
+// Windows-specific wxEntry
+// ----------------------------------------------------------------------------
+
+struct wxMSWCommandLineArguments
+{
+ wxMSWCommandLineArguments() { argc = 0; argv = NULL; }
+
+ void Init(const wxArrayString& args)
+ {
+ argc = args.size();
+
+ // +1 here for the terminating NULL
+ argv = new wxChar *[argc + 1];
+ for ( int i = 0; i < argc; i++ )
+ {
+ argv[i] = wxStrdup(args[i].wx_str());
+ }
+
+ // argv[] must be NULL-terminated
+ argv[argc] = NULL;
+ }
+
+ void Free()
+ {
+ if ( !argc )
+ return;
+
+ for ( int i = 0; i < argc; i++ )
+ {
+ free(argv[i]);
+ }
+
+ wxDELETEA(argv);
+ argc = 0;