Inset window to issue the desktop

First, the problem: how to make a window embedded in the desktop window? How to hide at the same time / display the taskbar at the extended screen window?

  Problem analysis: the relationship between the window and the window 1; 2, under what extend the taskbar window screen window class is? What more than one extension panel of the Taskbar window class is?

Second, the relationship between the window and the window:

  Type window is divided into: overlapping windows, pop-up windows, sub-windows, layered window, the window will only accept the message;

  The main window is divided into a direct relationship: the foreground and Background Windows, owner window and owner window, the parent window and the child window;

  Shows the relationship between the window and the current window as a background worker thread window foreground window, outside the reception window; overlapping windows or pop-ups can be owned by other overlapping windows or pop-up window, the child window the owner and the owner window does not exist relations, general owner window displays the first sequence in the owner window z.

Child window is displayed in the parent window's client area of ​​the parent window to hide, hide the child window, before the destruction of the parent window, child window to be destroyed; former child window, the parent window is first displayed. Microsoft provides an API function to change the window's parent-child relationship for us.

  HWND SetParent (HWND hwndChild, // window handle child

           HWND hWndNewParent // if the new parent window handle is NULL, the desktop window is the parent window

          );

  

  With this function, we can change the development of the parent window of the window to the desktop window, you can achieve embedded inside the desktop window, it should be noted that, if the desktop window is destroyed, embedded into the desktop window will first be destroyed out unless until the catch when embedded in a desktop window display again, it can ensure the display synchronized with the desktop window.

Third, the taskbar window class name under the extended screen:

  For the class name only one display window of the desktop, task bar of the window is: Shell_TrayWnd, get to handle the task window by :: FindWindowW function, then its operation process, but if there is an extended screen, and the need to operate two a taskbar it? In fact, the system creates a new window for the extended screen windows taskbar, class named: Shell_SecondaryTrayWnd, then add a further extension screen, the system will then create a task bar window class name: Shell_ThirdTrayWnd it?

  Theory is that the real task bar by crawling under two expansion screen window is the same as: Shell_SecondaryTrayWnd. So, we deal with the extended screen taskbar, without first determining whether there is an extended screen, direct access to the taskbar window by FindWindowW whether there is a function, if Shell_SecondaryTrayWnd does not exist, it can be considered the task bar at the main screen only. Then the task at the same time extended screen display / hide the operation.

 

Reference Address: https://docs.microsoft.com/zh-cn/windows/win32/winmsg/about-windows

Guess you like

Origin www.cnblogs.com/smartNeo/p/11391650.html