summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/windows/winutf8.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/windows/winutf8.cpp')
-rw-r--r--src/osd/windows/winutf8.cpp44
1 files changed, 9 insertions, 35 deletions
diff --git a/src/osd/windows/winutf8.cpp b/src/osd/windows/winutf8.cpp
index a860aeb55cc..cdb0e87a86b 100644
--- a/src/osd/windows/winutf8.cpp
+++ b/src/osd/windows/winutf8.cpp
@@ -10,7 +10,7 @@
#include "winutf8.h"
#include "strconv.h"
-#include <stdlib.h>
+#include <cstdlib>
// standard windows headers
#include <shellapi.h>
@@ -27,8 +27,6 @@ void win_output_debug_string_utf8(const char *string)
}
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
-
//============================================================
// win_message_box_utf8
//============================================================
@@ -55,9 +53,6 @@ int win_message_box_utf8(HWND window, const char *text, const char *caption, UIN
return MessageBox(window, t_text, t_caption, type);
}
-#endif
-
-
//============================================================
// win_set_window_text_utf8
@@ -75,13 +70,7 @@ BOOL win_set_window_text_utf8(HWND window, const char *text)
t_text = ts_text.c_str();
}
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
result = SetWindowText(window, t_text);
-#else
- Windows::UI::ViewManagement::ApplicationView::GetForCurrentView()->Title = ref new Platform::String(t_text);
- result = TRUE;
-#endif
-
return result;
}
@@ -93,30 +82,17 @@ BOOL win_set_window_text_utf8(HWND window, const char *text)
std::string win_get_window_text_utf8(HWND window)
{
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
- {
- // invoke the core Win32 API
- int length = GetWindowTextLength(window);
- if (length <= 0)
- return std::string();
-
- TCHAR *buffer = (TCHAR *) alloca((length + 1) * sizeof(TCHAR));
- GetWindowText(window, buffer, length + 1);
- return osd::text::from_tstring(buffer);
- }
-#else
- {
- TCHAR t_buffer[256];
- auto title = Windows::UI::ViewManagement::ApplicationView::GetForCurrentView()->Title;
- wcsncpy(t_buffer, title->Data(), ARRAY_LENGTH(t_buffer));
- return osd::text::from_tstring(t_buffer);
- }
-#endif
+ // invoke the core Win32 API
+ int length = GetWindowTextLength(window);
+ if (length <= 0)
+ return std::string();
+
+ auto *buffer = (TCHAR *) alloca((length + 1) * sizeof(TCHAR));
+ GetWindowText(window, buffer, length + 1);
+ return osd::text::from_tstring(buffer);
}
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
-
//============================================================
// win_create_window_ex_utf8
//============================================================
@@ -138,5 +114,3 @@ HWND win_create_window_ex_utf8(DWORD exstyle, const char* classname, const char*
return CreateWindowEx(exstyle, ts_classname.c_str(), t_windowname, style, x, y, width, height, parent,
menu, instance, param);
}
-
-#endif