Upgrade eap::monitor_ui's HWND to volatile

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman 2019-08-13 14:28:21 +02:00
parent 009cd36fe2
commit dfd26f214d
2 changed files with 7 additions and 6 deletions

View File

@ -1219,7 +1219,7 @@ namespace eap
bool m_is_master; ///< Is this monitor master?
HWND m_hwnd; ///< Message window handle
std::list<HWND> m_slaves; ///< List of slaves to notify on finish
HWND m_hwnd_popup; ///< Pop-up window handle
volatile HWND m_hwnd_popup; ///< Pop-up window handle
std::vector<unsigned char> m_data; ///< Data master sent
// Custom window messages

View File

@ -608,12 +608,13 @@ LRESULT eap::monitor_ui::winproc(
assert(m_is_master);
m_slaves.push_back((HWND)lparam);
if (m_hwnd_popup) {
HWND hwnd_popup = m_hwnd_popup;
if (hwnd_popup) {
// Bring pop-up window up.
if (::IsIconic(m_hwnd_popup))
::SendMessage(m_hwnd_popup, WM_SYSCOMMAND, SC_RESTORE, 0);
::SetActiveWindow(m_hwnd_popup);
::SetForegroundWindow(m_hwnd_popup);
if (::IsIconic(hwnd_popup))
::SendMessage(hwnd_popup, WM_SYSCOMMAND, SC_RESTORE, 0);
::SetActiveWindow(hwnd_popup);
::SetForegroundWindow(hwnd_popup);
}
return TRUE;