I would like to use the DeviceChangeDetector in a Windows project but it seems not to be a public member.
I tried to include it directly by including the following file: #include "modules/juce_events/native/juce_win32_HiddenMessageWindow.h"
But i get the following errors:
error C2440: '=' : cannot convert from 'const wchar_t *' to 'LPCSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
juce_win32_hiddenmessagewindow.h(97): error C2664: 'HiddenMessageWindow::HiddenMessageWindow(const TCHAR *const ,WNDPROC)' : cannot convert parameter 1 from 'const wchar_t *const ' to 'const TCHAR *const '
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
I was trying to use it as a general callback for when devices change. One thing i'm using it for is to detect display changes.
I've now made a local copy which is targeted to specifically handle WM_DISPLAYCHANGE messages. So i've got a workaround but it thought it would have been handy to use it without creating my own copy.
May not be the best alternative, but you could just poll for a list of devices on a timer with some decent interval, check the new list compared to the last. If such isn't the same, then your devices have changed.
thanks jrlanglois but i got the WM_DISPLAYCHANGE messages coming in and that seems to be working for now, as a last resort i could always fallback to a timer of course.