diff options
Diffstat (limited to 'platform/windows')
-rw-r--r-- | platform/windows/os_windows.cpp | 17 | ||||
-rw-r--r-- | platform/windows/os_windows.h | 1 |
2 files changed, 16 insertions, 2 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index eaf62a3e0a..090fe64b19 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -1475,10 +1475,14 @@ Error OS_Windows::execute(const String& p_path, const List<String>& p_arguments, ZeroMemory( &pi.si, sizeof(pi.si) ); pi.si.cb = sizeof(pi.si); ZeroMemory( &pi.pi, sizeof(pi.pi) ); + LPSTARTUPINFOW si_w = (LPSTARTUPINFOW) &pi.si; print_line("running cmdline: "+cmdline); - - int ret = CreateProcess(NULL, (LPSTR)cmdline.utf8().get_data(), NULL, NULL, 0, NORMAL_PRIORITY_CLASS, NULL, NULL, &pi.si, &pi.pi); + Vector<CharType> modstr; //windows wants to change this no idea why + modstr.resize(cmdline.size()); + for(int i=0;i<cmdline.size();i++) + modstr[i]=cmdline[i]; + int ret = CreateProcessW(NULL, modstr.ptr(), NULL, NULL, 0, NORMAL_PRIORITY_CLASS, NULL, NULL, si_w, &pi.pi); ERR_FAIL_COND_V(ret == 0, ERR_CANT_FORK); if (p_blocking) { @@ -1523,6 +1527,15 @@ Error OS_Windows::set_cwd(const String& p_cwd) { return OK; } +String OS_Windows::get_executable_path() const { + + wchar_t bufname[4096]; + GetModuleFileNameW(NULL,bufname,4096); + String s= bufname; + print_line("EXEC PATHPó: "+s); + return s; +} + void OS_Windows::set_icon(const Image& p_icon) { diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index 5587d89763..6d75ca8d7b 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -235,6 +235,7 @@ public: void set_cursor_shape(CursorShape p_shape); void set_icon(const Image& p_icon); + virtual String get_executable_path() const; virtual String get_locale() const; |