Skip to content

Commit fd716dd

Browse files
committed
C++ - Adding memcpy and win32_get_hwnd
1 parent ef5df7f commit fd716dd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

include/webui.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,12 @@ namespace webui {
393393
void set_context(const std::string_view element, void* context) const {
394394
webui_set_context(webui_window, element.data(), context);
395395
}
396+
397+
// Gets Win32 window `HWND`. More reliable with WebView than web browser
398+
// window, as browser PIDs may change on launch.
399+
void* win32_get_hwnd() const {
400+
return webui_win32_get_hwnd(webui_window);
401+
}
396402
};
397403

398404
// ------ Namespace members `webui::xxx()` ------
@@ -494,6 +500,11 @@ namespace webui {
494500
return webui_interface_is_app_running();
495501
}
496502

503+
// Copy raw data.
504+
inline void memcpy(void* dest, const void* src, size_t count) {
505+
webui_memcpy(dest, const_cast<void*>(src), count);
506+
}
507+
497508
} // namespace webui
498509

499510
#endif /* _WEBUI_HPP */

0 commit comments

Comments
 (0)