|
@@ -1131,7 +1131,7 @@ static void WindowSettingsHandler_WriteAll(ImGuiContext*, ImGuiSetti
|
|
static const char* GetClipboardTextFn_DefaultImpl(void* user_data_ctx);
|
|
static const char* GetClipboardTextFn_DefaultImpl(void* user_data_ctx);
|
|
static void SetClipboardTextFn_DefaultImpl(void* user_data_ctx, const char* text);
|
|
static void SetClipboardTextFn_DefaultImpl(void* user_data_ctx, const char* text);
|
|
static void PlatformSetImeDataFn_DefaultImpl(ImGuiContext* ctx, ImGuiViewport* viewport, ImGuiPlatformImeData* data);
|
|
static void PlatformSetImeDataFn_DefaultImpl(ImGuiContext* ctx, ImGuiViewport* viewport, ImGuiPlatformImeData* data);
|
|
-static void PlatformOpenInShellFn_DefaultImpl(ImGuiContext* ctx, const char* path);
|
|
|
|
|
|
+static bool PlatformOpenInShellFn_DefaultImpl(ImGuiContext* ctx, const char* path);
|
|
|
|
|
|
namespace ImGui
|
|
namespace ImGui
|
|
{
|
|
{
|
|
@@ -14358,12 +14358,12 @@ static void SetClipboardTextFn_DefaultImpl(void* user_data_ctx, const char* text
|
|
#ifdef _MSC_VER
|
|
#ifdef _MSC_VER
|
|
#pragma comment(lib, "shell32")
|
|
#pragma comment(lib, "shell32")
|
|
#endif
|
|
#endif
|
|
-static void PlatformOpenInShellFn_DefaultImpl(ImGuiContext*, const char* path)
|
|
|
|
|
|
+static bool PlatformOpenInShellFn_DefaultImpl(ImGuiContext*, const char* path)
|
|
{
|
|
{
|
|
- ::ShellExecuteA(NULL, "open", path, NULL, NULL, SW_SHOWDEFAULT);
|
|
|
|
|
|
+ return (INT_PTR)::ShellExecuteA(NULL, "open", path, NULL, NULL, SW_SHOWDEFAULT) > 32;
|
|
}
|
|
}
|
|
#elif !defined(IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS)
|
|
#elif !defined(IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS)
|
|
-static void PlatformOpenInShellFn_DefaultImpl(ImGuiContext*, const char* path)
|
|
|
|
|
|
+static bool PlatformOpenInShellFn_DefaultImpl(ImGuiContext*, const char* path)
|
|
{
|
|
{
|
|
#if __APPLE__
|
|
#if __APPLE__
|
|
const char* open_executable = "open";
|
|
const char* open_executable = "open";
|
|
@@ -14372,10 +14372,10 @@ static void PlatformOpenInShellFn_DefaultImpl(ImGuiContext*, const char* path)
|
|
#endif
|
|
#endif
|
|
ImGuiTextBuffer buf;
|
|
ImGuiTextBuffer buf;
|
|
buf.appendf("%s \"%s\"", open_executable, path);
|
|
buf.appendf("%s \"%s\"", open_executable, path);
|
|
- system(buf.c_str());
|
|
|
|
|
|
+ return system(buf.c_str()) != -1;
|
|
}
|
|
}
|
|
#else
|
|
#else
|
|
-static void PlatformOpenInShellFn_DefaultImpl(ImGuiContext*, const char*) {}
|
|
|
|
|
|
+static bool PlatformOpenInShellFn_DefaultImpl(ImGuiContext*, const char*) { return false; }
|
|
#endif // Default shell handlers
|
|
#endif // Default shell handlers
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
//-----------------------------------------------------------------------------
|