diff --git a/examples/widgets/mainwindows/mdi/mdi.pro b/examples/widgets/mainwindows/mdi/mdi.pro
index 2e3c232..c9f2595 100644
--- a/examples/widgets/mainwindows/mdi/mdi.pro
+++ b/examples/widgets/mainwindows/mdi/mdi.pro
@@ -10,3 +10,5 @@ RESOURCES     = mdi.qrc
 # install
 target.path = $$[QT_INSTALL_EXAMPLES]/widgets/mainwindows/mdi
 INSTALLS += target
+
+CONFIG+=console
diff --git a/src/plugins/platforms/windows/qtwindowsglobal.h b/src/plugins/platforms/windows/qtwindowsglobal.h
index 8c361d7..7eaa460 100644
--- a/src/plugins/platforms/windows/qtwindowsglobal.h
+++ b/src/plugins/platforms/windows/qtwindowsglobal.h
@@ -65,7 +65,8 @@ enum
     TouchEventFlag = 0x400000,
     ClipboardEventFlag = 0x800000,
     ApplicationEventFlag = 0x1000000,
-    ThemingEventFlag = 0x2000000
+    ThemingEventFlag = 0x2000000,
+    PowerStateChangeEventFlag = 0x4000000
 };
 
 enum WindowsEventType // Simplify event types
@@ -116,6 +117,8 @@ enum WindowsEventType // Simplify event types
     DisplayChangedEvent = 437,
     SettingChangedEvent = DisplayChangedEvent + 1,
     ContextMenu = 123,
+    PowerStateSuspend = PowerStateChangeEventFlag + 1,
+    PowerStateResume = PowerStateChangeEventFlag + 2,
     UnknownEvent = 542
 };
 
@@ -250,6 +253,17 @@ inline QtWindows::WindowsEventType windowsEventType(UINT message, WPARAM wParamI
     case WM_APPCOMMAND:
         return QtWindows::AppCommandEvent;
 #endif
+#if defined(WM_POWERBROADCAST)
+    case WM_POWERBROADCAST:
+        switch (quintptr(wParamIn)) {
+        case PBT_APMRESUMEAUTOMATIC:
+            return QtWindows::PowerStateResume;
+        case PBT_APMSUSPEND:
+            return QtWindows::PowerStateSuspend;
+        default:
+            break;
+        }
+#endif // WM_POWERBROADCAST
     default:
         break;
     }
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
index 132f224..9668448 100644
--- a/src/plugins/platforms/windows/qwindowscontext.cpp
+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
@@ -193,7 +193,8 @@ QWindowsUser32DLL::QWindowsUser32DLL() :
     isHungAppWindow(0),
     registerTouchWindow(0), unregisterTouchWindow(0),
     getTouchInputInfo(0), closeTouchInputHandle(0), setProcessDPIAware(0),
-    addClipboardFormatListener(0), removeClipboardFormatListener(0)
+    addClipboardFormatListener(0), removeClipboardFormatListener(0),
+    registerPowerSettingNotification(0)
 {
 }
 
@@ -213,6 +214,8 @@ void QWindowsUser32DLL::init()
     if (QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA) {
         addClipboardFormatListener = (AddClipboardFormatListener)library.resolve("AddClipboardFormatListener");
         removeClipboardFormatListener = (RemoveClipboardFormatListener)library.resolve("RemoveClipboardFormatListener");
+
+        registerPowerSettingNotification = (RegisterPowerSettingNotification)library.resolve("RegisterPowerSettingNotification");
     }
 }
 
@@ -944,9 +947,19 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
         return false;
 #endif
     case QtWindows::DisplayChangedEvent:
+        qDebug() << hwnd << "Displaychanged";
         return d->m_screenManager.handleDisplayChange(wParam, lParam);
     case QtWindows::SettingChangedEvent:
+        qDebug() << hwnd << "Settingschanged";
+        QWindowsScreenManager::dumpScreens();
         return d->m_screenManager.handleScreenChanges();
+    case QtWindows::PowerStateResume:
+        qDebug() << hwnd << "Resume";
+        QWindowsScreenManager::dumpScreens();
+        return false;
+    case QtWindows::PowerStateSuspend:
+        qDebug() << hwnd << "Suspend";
+        return false;
     default:
         break;
     }
diff --git a/src/plugins/platforms/windows/qwindowscontext.h b/src/plugins/platforms/windows/qwindowscontext.h
index 086b968..64422e6 100644
--- a/src/plugins/platforms/windows/qwindowscontext.h
+++ b/src/plugins/platforms/windows/qwindowscontext.h
@@ -95,7 +95,9 @@ struct QWindowsUser32DLL
     typedef BOOL (WINAPI *IsHungAppWindow)(HWND);
     typedef BOOL (WINAPI *SetProcessDPIAware)();
     typedef BOOL (WINAPI *AddClipboardFormatListener)(HWND);
-    typedef BOOL (WINAPI *RemoveClipboardFormatListener)(HWND);
+    typedef BOOL (WINAPI *RemoveClipboardFormatListener)(HWND);    
+    // HPOWERNOTIFY == PVOID
+    typedef PVOID (WINAPI *RegisterPowerSettingNotification)(HANDLE,LPCGUID,DWORD);
 
     // Functions missing in Q_CC_GNU stub libraries.
     SetLayeredWindowAttributes setLayeredWindowAttributes;
@@ -117,6 +119,9 @@ struct QWindowsUser32DLL
     // Clipboard listeners, Windows Vista onwards
     AddClipboardFormatListener addClipboardFormatListener;
     RemoveClipboardFormatListener removeClipboardFormatListener;
+
+    // Power notification, Windows Vista onwards
+    RegisterPowerSettingNotification registerPowerSettingNotification;
 };
 
 struct QWindowsShell32DLL
diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp
index 8d8505e..676fe35 100644
--- a/src/plugins/platforms/windows/qwindowsscreen.cpp
+++ b/src/plugins/platforms/windows/qwindowsscreen.cpp
@@ -478,8 +478,15 @@ void QWindowsScreenManager::removeScreen(int index)
     ones and propagates resolution changes to QWindowSystemInterface.
 */
 
+
+void QWindowsScreenManager::dumpScreens()
+{
+    qDebug() <<  monitorData();
+}
+
 bool QWindowsScreenManager::handleScreenChanges()
 {
+    qDebug() << __FUNCTION__;
     // Look for changed monitors, add new ones
     WindowsScreenDataList newDataList = monitorData();
     const bool lockScreen = newDataList.size() == 1 && (newDataList.front().flags & QWindowsScreenData::LockScreen);
diff --git a/src/plugins/platforms/windows/qwindowsscreen.h b/src/plugins/platforms/windows/qwindowsscreen.h
index 44638bc..4ed2564 100644
--- a/src/plugins/platforms/windows/qwindowsscreen.h
+++ b/src/plugins/platforms/windows/qwindowsscreen.h
@@ -142,6 +142,7 @@ public:
     }
 
     bool handleScreenChanges();
+    static void dumpScreens();
     bool handleDisplayChange(WPARAM wParam, LPARAM lParam);
     const WindowsScreenList &screens() const { return m_screens; }
 
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index f6b1eef..1208bf8 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -912,6 +912,14 @@ QWindowsWindow::QWindowsWindow(QWindow *aWindow, const QWindowsWindowData &data)
     if (aWindow->isTopLevel())
         setWindowIcon(aWindow->icon());
     clearFlag(WithinCreate);
+
+#ifndef Q_OS_WINCE
+    if (QWindowsContext::user32dll.registerPowerSettingNotification) {
+        void *handle = QWindowsContext::user32dll.registerPowerSettingNotification(data.hwnd, &GUID_ACDC_POWER_SOURCE, DEVICE_NOTIFY_WINDOW_HANDLE);
+        if (!handle)
+            qErrnoWarning("RegisterPowerSettingNotification failed");
+    }
+#endif // !Q_OS_WINCE
 }
 
 QWindowsWindow::~QWindowsWindow()
