Disable Win32 clipboard and IME functions when build target UWP (#2892, #2895)
diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt
index 0531da3..513cd33 100644
--- a/docs/CHANGELOG.txt
+++ b/docs/CHANGELOG.txt
@@ -77,6 +77,7 @@
- Error handling: Assert if user mistakenly calls End() instead of EndChild() on a child window. (#1651)
- Misc: Optimized storage of window settings data (reducing allocation count).
- Misc: Windows: Do not use _wfopen() if IMGUI_DISABLE_WIN32_FUNCTIONS is defined. (#2815)
+- Misc: Windows: Disabled win32 function by default when building with UWP. (#2892, #2895)
- Misc: Using static_assert() when using C++11, instead of our own construct (avoid zealous Clang warnings).
- Docs: Improved and moved FAQ to docs/FAQ.md so it can be readable on the web. [@ButternCream, @ocornut]
- Docs: Added permanent redirect from https://www.dearimgui.org/faq to FAQ page.
diff --git a/imgui.cpp b/imgui.cpp
index 3e56466..bfe4b17 100644
--- a/imgui.cpp
+++ b/imgui.cpp
@@ -9483,6 +9483,10 @@
#else
#include <windows.h>
#endif
+#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP) // UWP doesn't have Win32 functions
+#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS
+#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS
+#endif
#elif defined(__APPLE__)
#include <TargetConditionals.h>
#endif