+ DoRefreshMonitors();
+
+ // Also create a hidden window to listen for WM_SETTINGCHANGE that we
+ // receive when a monitor is added to or removed from the system as we must
+ // refresh our monitor handles information then.
+ m_hiddenHwnd = wxCreateHiddenWindow
+ (
+ &m_hiddenClass,
+ wxT("wxDisplayHiddenWindow"),
+ wxDisplayWndProc
+ );
+}
+
+wxDisplayFactoryMSW::~wxDisplayFactoryMSW()
+{
+ if ( m_hiddenHwnd )
+ {
+ if ( !::DestroyWindow(m_hiddenHwnd) )
+ {
+ wxLogLastError(wxT("DestroyWindow(wxDisplayHiddenWindow)"));
+ }
+
+ if ( m_hiddenClass )
+ {
+ if ( !::UnregisterClass(m_hiddenClass, wxGetInstance()) )
+ {
+ wxLogLastError(wxT("UnregisterClass(wxDisplayHiddenWindow)"));
+ }
+ }
+ }
+
+ ms_factory = NULL;
+}
+
+void wxDisplayFactoryMSW::DoRefreshMonitors()
+{
+ m_displays.Clear();
+