14#include <duvc-ctl/detail/com_helpers.h>
55 }
catch (
const std::exception &
e) {
57 std::string(
e.what()));
76 wc.lpszClassName =
L"DuvcDeviceNotificationWindow";
83 std::to_string(error));
101 L"duvc-ctl Device Monitor",
137 DUVC_LOG_INFO(
"Successfully registered for device notifications");
#define DUVC_LOG_ERROR(msg)
#define DUVC_LOG_WARNING(msg)
#define DUVC_LOG_INFO(msg)
#define DUVC_LOG_DEBUG(msg)
Result type that can contain either a value or an error.
EXTERN_C const CLSID CLSID_VideoInputDeviceCategory
Device enumeration and management functions.
Structured logging interface for duvc-ctl.
static DeviceChangeCallback g_device_callback
void unregister_device_change_callback()
Unregister device change callback.
static HWND create_notification_window()
Create invisible window for receiving device notifications.
static HDEVNOTIFY g_device_notify
void register_device_change_callback(DeviceChangeCallback callback)
Register callback for device hotplug events.
std::function< void(bool device_added, const std::wstring &device_path)> DeviceChangeCallback
Device change callback function type.
static LRESULT CALLBACK device_notification_wndproc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Window procedure for handling device change notifications.
static HDEVNOTIFY register_device_notifications(HWND hwnd)
Register for device interface notifications.
static HWND g_notification_window
static bool register_notification_window_class()
Register window class for device notifications.