ALT+TAB in Vista activates main window instead of previously active child window

蓝咒 提交于 2019-12-24 16:16:11

问题


My app (written in C++) uses Win32 (not MFC) to create a couple of windows with CreateWindowEx. The main window gets the desktop as parent, the child windows get the main window as parent.

my problem:

  • my app has an active child window
  • I switch to another app (per click, ALT+TAB or other, doesn't matter)
  • I switch back to my app with ALT+TAB

Now the main window of my app is activate, not the child window anymore. If I switch back clicking the taskbar entry, the child window remains active.

This happens only with Aero (with and without Glass). If I activate the classical Window Scheme, everything behaves as under Windows XP (switching back with ALT+TAB leaves the child window active).

Any suggestions or links or other resources?

(Sample code is a bit hard to provide, since the UI-elements are wrapped in classes with own data types for strings etc.)


It seems that Vista with classical scheme sends an WM_ACTIVATE to the main window and another WM_ACTIVATE to the second window (owned by the main window). With Vista Aero enabled only the main windows gets an WM_ACTIVATE. Odd.

来源:https://stackoverflow.com/questions/1158394/alttab-in-vista-activates-main-window-instead-of-previously-active-child-window

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!