From c251f568a982e96913c07fda36d0e58911999fd0 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 19 Nov 2018 12:12:39 +0100 Subject: [PATCH] Make ZRCola window always-on-top while composing Microsoft Remote Desktop introduced a bug in Windows 10 Falls Update (1709 release) keeping Remote Desktop window always-on-top. This prevents ZRCola window to pop-up on Win+F5. This patch addresses this issue by temporarily making ZRCola window always-on-top when called by Win+F5/F6, and restoring it back to normal when finished by F5/F6 or dismissed by Esc. --- ZRCola/zrcolafrm.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ZRCola/zrcolafrm.cpp b/ZRCola/zrcolafrm.cpp index c5c724b..f5d598d 100644 --- a/ZRCola/zrcolafrm.cpp +++ b/ZRCola/zrcolafrm.cpp @@ -324,6 +324,7 @@ void wxZRColaFrame::OnSendAbort(wxCommandEvent& event) { if (m_hWndSource) { // Return focus to the source window. + ::SetWindowPos(m_hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); if (m_wasIconised) Iconize(); ::SetActiveWindow(m_hWndSource); ::SetForegroundWindow(m_hWndSource); @@ -608,6 +609,7 @@ void wxZRColaFrame::DoSend(const wxString& str) } // Return focus to the source window and send the input. + ::SetWindowPos(m_hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); if (m_wasIconised) Iconize(); ::SetActiveWindow(m_hWndSource); ::SetForegroundWindow(m_hWndSource); @@ -629,6 +631,7 @@ void wxZRColaFrame::DoCopyAndReturn(const wxString& str) } // Return focus to the source window. + ::SetWindowPos(m_hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); if (m_wasIconised) Iconize(); ::SetActiveWindow(m_hWndSource); ::SetForegroundWindow(m_hWndSource); @@ -697,6 +700,7 @@ WXLRESULT wxZRColaFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM Show(true); Iconize(false); Raise(); + ::SetWindowPos(m_hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); ::SetActiveWindow(m_hWnd); //} else if (wxAppBarIsDocked(m_state)) { // // ZRCola window is currently docked.