]> git.saurik.com Git - wxWidgets.git/commitdiff
set app name to argv[0] by default, as was done before
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 30 Nov 2001 16:54:15 +0000 (16:54 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 30 Nov 2001 16:54:15 +0000 (16:54 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12761 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/app.cpp

index f29afe759c0c4f46e6339c07220c1095ce2dcbbe..c59675e7f6c7a2d8e9d301ca0187e11fa764b646 100644 (file)
@@ -49,6 +49,7 @@
 #endif
 
 #include "wx/cmdline.h"
+#include "wx/filename.h"
 #include "wx/module.h"
 
 #include "wx/msw/private.h"
@@ -566,6 +567,13 @@ void wxApp::ConvertToStandardCommandArgs(const char* lpCmdLine)
     argv[0] = new wxChar[260]; // 260 is MAX_PATH value from windef.h
     ::GetModuleFileName(wxhInstance, argv[0], 260);
 
+    // also set the app name from argv[0]
+    wxString name;
+    wxFileName::SplitPath(argv[0], NULL, &name, NULL);
+
+    SetAppName(name);
+
+    // copy all the other arguments to wxApp::argv[]
     for ( int i = 1; i < argc; i++ )
     {
         argv[i] = copystring(args[i - 1]);