0

In a multi-monitor setup with extended display, a windows application is covering full screen in one monitor. I want to bring another application on top of the first application by clicking on taskbar icon of the application in secondary monitor.However I am not able to bring any other application on top of the first application. When I click on the first application taskbar icon in secondary monitor,I am able to bring other applications on top. What window property of the first application might be causing this behaviour

I should be able to bring other applications on top of first application

scx
  • 45
  • 1
  • 8
  • "*I am not able to bring any other application on top of the first application.*" It seems that the window uses the [`HWND_TOPMOST`](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowpos) attribute when it is full screen. But the words:"*When I click on the first application taskbar icon in secondary monitor,I am able to bring other applications on top.*" Do you mean that only if you focus on the first windows, you are able to bring other windows on top? – Drake Wu Oct 28 '19 at 02:24
  • @DrakeWu-MSFT Yes you are correct if I focus on the first windows ,I am able to bring other windows on top – scx Oct 28 '19 at 03:58
  • 1. What is the first application and whether it was developed by you? 2. If so, provide a [Minimal, Reproducible](https://stackoverflow.com/help/minimal-reproducible-example) sample that can reproduce the problem and help people find and solve the problem for you. – Drake Wu Oct 28 '19 at 07:03
  • 1
    It depends on how the window is programmed. I can simply use the following methods to reproduce similar problems. 1.create a desktop application. 2. `SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);` when get the `SIZE_MAXIMIZED` or any "full screen" message from `WM_SIZE`. 3. `SetWindowPos(hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);` when get focus message `WM_SETFOCUS`. – Drake Wu Oct 28 '19 at 08:26
  • @DrakeWu-MSFT Are u able to recreate with the above steps? – scx Oct 28 '19 at 08:43
  • I can reproduce the issue with that after max screen or full screen, set the window style to topmost, and then set non-topmost when get focus message. The phenomenon is: when the screen is maximized or full, the window cannot be covered by other non-topmost windows. When clicking its taskbar icon, other windows can cover it. – Drake Wu Oct 28 '19 at 09:13
  • @DrakeWu-MSFT I will check this,thanks – scx Oct 28 '19 at 15:48
  • Any progress? please feel free to provide information I mentioned before so that we can help you better. – Drake Wu Oct 30 '19 at 06:33
  • @DrakeWu-MSFT Thanks for following up,is there any tool I can use so that I will know why the application is going behind(loosing focus) ,I know about Spy++ but it can be used only with Visual Studio – scx Oct 30 '19 at 06:45
  • There seems to be something useful here. https://stackoverflow.com/questions/1811019/i-want-spy-but-i-dont-have-visual-studio – Drake Wu Oct 30 '19 at 07:37
  • @DrakeWu-MSFT I can simply use the following methods to reproduce similar problems. 1.create a desktop application. 2. SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); when get the SIZE_MAXIMIZED or any "full screen" message from WM_SIZE. 3. SetWindowPos(hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); when get focus message WM_SETFOCUS Is this the solution or way to recreate issue? – scx Oct 31 '19 at 08:24
  • Yes, it's a possible way to reproduce the issue. For this case, the solution is to use [`SetWindowPos`](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowpos), and use the `hWndInsertAfter` you want correctly (for example, always set `HWND_NOTOPMOST` so that the window can be cover by other windows) – Drake Wu Nov 01 '19 at 01:16
  • I have tried replacing HWND_TOPMOST with HWND_NOTOPMOST but no luck – scx Nov 01 '19 at 11:44
  • @DrakeWu-MSFT I have commented above – scx Nov 02 '19 at 03:38
  • 1
    Can you provide a [Minimal, Reproducible](https://stackoverflow.com/help/minimal-reproducible-example) sample? – Drake Wu Nov 04 '19 at 02:55
  • @DrakeWu-MSFT Sorry it has multiple process and multiple windows,Sharing reproducible sample will be tough. I have tried replacing HWND_TOPMOST with HWND_NOTOPMOST and also commented out SETForegroundWindow calls. Anyhting else that can be looked into? – scx Nov 04 '19 at 06:12
  • Can I know who downvoted? If downvoted can you please comment on it – scx Nov 04 '19 at 06:14
  • 1
    Did you did in a same session? Can you provide some code snippets related to window message processing? – Drake Wu Nov 04 '19 at 08:17
  • @DrakeWu-MSFT I will recapture Windows messages ,do you want me to see anything in particlular – scx Nov 05 '19 at 15:51
  • 1
    Could you check if the window has the Ex window style `WS_EX_TOPMOST` with this [method](https://stackoverflow.com/questions/5364063/how-to-check-if-window-is-always-on-top) after full screen it? And another question, is it a UWP window or Desktop window?since `SetWindowPos` only available for desktop apps. – Drake Wu Nov 06 '19 at 09:13
  • @DrakeWu-MSFT It is desktop app – scx Nov 06 '19 at 15:19
  • Did the window has the Ex window style `WS_EX_TOPMOST`? – Drake Wu Nov 07 '19 at 07:34
  • @DrakeWu-MSFT I will check within two days and let u know – scx Nov 07 '19 at 16:55
  • @DrakeWu-MSFT The properties as inspected through Spy++ are: Window Styles: WS_CHILDWINDOW,WS_VISIBLE,WS_DISABLED,WS_CLIPSIBLINGS and WS_CLIPCHILDRE – scx Nov 11 '19 at 03:58
  • @DrakeWu-MSFT Extended WIndows Styles are: WS_EX_LEFT,WS_EX_LTTRREADING,WS_EX_NOPARENTNOTIFY,WS_EX_RIGHTSCROLLBAR – scx Nov 11 '19 at 04:01
  • This is a child window. If its parent window has top-most style, then the child window is also top-most – Drake Wu Nov 13 '19 at 02:47

0 Answers0