Multi-window control method, system, device and medium based on window operating system

By dividing windows into multiple groups and receiving Z-Order message notifications in the Windows environment, three-level management of windows is realized, which solves the problem of difficulty in achieving three-level management in the existing technology and improves the efficiency of operating systems and application systems. stability.

CN114063840BActive Publication Date: 2024-10-11SUPCON TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111314635.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-08
Publication Date
2024-10-11
Estimated Expiration
2041-11-08

AI Technical Summary

Technical Problem

In the Windows environment, it is difficult for users to achieve three-level management of multiple windows. Existing API functions are restricted by Microsoft's checking mechanism, causing the operating system and application systems to run unstable, making it difficult to bypass the checking mechanism to achieve three-level management.

Method used

By dividing the target window into the first window group, the second window group and the third window group, and receiving the message notification from the Windows system about the change of the Z-Order order of the target window in the third window group, the message notification response function is set Default level, modify the value of WINDOWPOS structure members to realize three-level management of windows.

Benefits of technology

It realizes efficient and concise three-level management of windows, solves users' needs for multi-window three-level management, and avoids the risk of unstable operation of operating systems and application systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114063840B_ABST
    Figure CN114063840B_ABST
Patent Text Reader

Abstract

The present application belongs to the field of computer technology, and specifically relates to a multi-window control method based on a Windows operating system, which is applied to an application system running in a Windows environment, and the method includes: S10, dividing all target windows of the application system into a first window group, a second window group, and a third window group; wherein the number of the target windows is greater than or equal to 3; S20, setting the window attribute of the first window group to a top window, setting the window attribute of the second window group to a regular window, and setting the window attribute of the third window group to a top window or a regular window; S30, receiving a message notification from the Windows system about a change in the Z-Order order of the target windows in the third window group, and setting the target windows to a preset level through a message notification response function. The present control method can efficiently and concisely implement three-level management of windows.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computer technology, and specifically relates to a multi-window control method based on a window operating system. Background Art

[0002] In the Windows environment, when the application system developed by a third party is running, Windows provides a "two-level management" mode for windows created by users themselves, namely, top windows and regular windows. For example, the monitoring main interface is set to regular window properties and covers the entire screen as the bottom window, and the monitoring operation interface is set to top window properties and is located above the monitoring main interface. Since the monitoring main interface belongs to multiple different processes, the window of the monitoring operation interface cannot be set as a subwindow of a certain monitoring main interface window to achieve the purpose of window level management, because it may be covered by the monitoring main interface window created by other processes. Different monitoring operation interface windows can cover each other, but will never be covered by the monitoring main interface window of the process to which they belong.

[0003] In actual use, users hope that different types of monitoring operation interfaces do not overlap each other. For example, the system function block panel and the global function block panel are always located above the windowed flowchart, but the windowed flowchart still needs to maintain the characteristic of always being located above the monitoring main interface. This requires the use of a three-level window management mode to achieve this.

[0004] To achieve the three-level management of windows, the window group properties need to be set. However, because Microsoft has added an additional check mechanism for these window groups, the Windows window group property setting and related API functions cannot be called in most cases, such as CreateWindowInBand / CreateWindowInBandEx / SetWindowBand. If you want to bypass the above check mechanism, the only way is to use the dll process injection mechanism, but this will cause the operating system and application system to run unstable and the system will be at great risk. Therefore, it is difficult for users to achieve three-level management of windows. Summary of the invention

[0005] 1. Technical issues to be resolved

[0006] In view of the above-mentioned shortcomings and deficiencies of the prior art, the present application provides a multi-window control method, system, device and readable storage medium based on a window operating system.

[0007] (II) Technical solution

[0008] In order to achieve the above objectives, this application adopts the following technical solutions:

[0009] In a first aspect, an embodiment of the present application provides a multi-window control method based on a Windows operating system, which is applied to an application system running in a Windows environment, and the method includes:

[0010] S10, dividing all target windows of the application system into a first window group, a second window group, and a third window group; wherein the number of the target windows is greater than or equal to 3;

[0011] S20, setting the window attribute of the first window group to a top window, setting the window attribute of the second window group to a regular window, and setting the window attribute of the third window group to a top window or a regular window;

[0012] S30, receiving a message notification of a change in the Z-Order of a target window in the third window group from the Windows system, and setting the target window to a preset level through a message notification response function.

[0013] Optionally, the preset layer is the topmost layer or the bottommost layer.

[0014] Optionally, when the window attribute of the third window group is set to a top window, the preset level is the topmost level;

[0015] When the window attribute of the third window group is set to a normal window, the preset layer is the bottom layer.

[0016] Optionally, the message notification is a WM_WINDOWPOSCHANGING message.

[0017] Optionally, the behavior of changing the window Z-Order order is changed by notifying the response function through a message, including:

[0018] Modify the value of the WINDOWPOS structure member passed as a parameter in the message response function.

[0019] Optionally, when the preset layer is the bottom layer, the WINDOWPOS structure member is hWndInsertAfter.

[0020] Optionally, modify the value of the WINDOWPOS structure member passed as a parameter to HWND_BOTTOM.

[0021] In a second aspect, an embodiment of the present application provides an operation and maintenance system for a distributed control system (DCS). When interacting with a user, the system controls multiple windows on the desktop through a multi-window control method based on a window operating system as described in any one of the first aspects above.

[0022] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the multi-window control method based on the window operating system as described in any one of the first aspect above are implemented.

[0023] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the multi-window control method based on the window operating system as described in any one of the first aspects above are implemented.

[0024] (III) Beneficial effects

[0025] The beneficial effects of the present application are as follows: the present application proposes a multi-window control method based on a Windows operating system, which is applied to an application system running in a Windows environment, and the method includes: S10, dividing all target windows of the application system into a first window group, a second window group, and a third window group; wherein the number of the target windows is greater than or equal to 3; S20, setting the window attribute of the first window group to a top window, setting the window attribute of the second window group to a regular window, and setting the window attribute of the third window group to a top window or a regular window; S30, receiving a message notification from the Windows system regarding a change in the Z-Order order of the target window in the third window group, and setting the target window to a preset level through a message notification response function. The control method of the present application can efficiently and concisely implement three-level management of windows, effectively solving the user's demand for three-level management of multiple windows. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The present application is described with the aid of the following drawings:

[0027] Figure 1 This is a flowchart of a multi-window control method based on a window operating system in one embodiment of the present application;

[0028] Figure 2 This is a diagram showing the hierarchical relationship between regular windows and top windows on the Windows desktop;

[0029] Figure 3 This is a schematic diagram of the hierarchy of the bottom-level window, regular window, and top-level window in one embodiment of the present application;

[0030] Figure 4 It is a schematic diagram of the structure of an electronic device in another embodiment of the present application. DETAILED DESCRIPTION

[0031] In order to better explain the present invention and facilitate understanding, the present invention is described in detail below in conjunction with the accompanying drawings through specific implementation methods. It is understood that the specific embodiments described below are only used to explain the relevant inventions, rather than to limit the invention. It should also be noted that the embodiments and features in the embodiments of this application can be combined with each other in the absence of conflict; for ease of description, only the parts related to the invention are shown in the accompanying drawings.

[0032] Before describing the implementation method in detail, the concept of Z-order is introduced. The Z-order of a window indicates the position of the window in a stack of stacked windows. The stack of windows extends from the inside of the screen to the outside along an imaginary axis, the Z-axis. The window at the top of the Z-order will be pressed on other windows. The window at the bottom of the Z-order will be pressed by other windows.

[0033] Before Windows 8, all windows of the operating system were in the same Z-Order window group, namely the desktop window group (ZBID_DESKTOP). Windows with a "high" Z-Order covered windows with a "low" Z-Order. The newly focused window had the "highest" Z-Order and was on top of all windows. At the same time, the system supports the "top" property of windows (HWN_TOPMOST). Figure 2 This is a diagram of the hierarchical relationship between regular windows and top windows on the Windows desktop. Figure 2 As shown in the figure, the Z-Order of the top windows 1-N with the "top" attribute set is always higher than that of the regular windows 1-N without the "top" attribute set, that is, the top windows are always above the non-top windows. In other words, the operating system further subdivides the desktop window group into two subgroups: the regular window subgroup and the top window subgroup.

[0034] Starting from Windows 8, Microsoft introduced other window groups. The Z-Order of other window groups is higher than that of the desktop window group, and the windows in other window groups can also be divided into two subgroups: regular window subgroup and top window subgroup. Because of this, any regular or top window created by third-party developers outside of Microsoft cannot cover the contents of other window groups.

[0035] The present invention provides a multi-window control method based on Windows environment to solve the user's demand for three-level management of user interface, which is described below through specific embodiments.

[0036] Embodiment 1

[0037] Figure 1 FIG. 1 is a flow chart of a multi-window control method based on a Windows operating system in one embodiment of the present application. Figure 1 As shown, the multi-window control method based on the Windows operating system of this embodiment is applied to an application system running in a Windows environment, and the method includes:

[0038] S10, dividing all target windows of the application system into a first window group, a second window group, and a third window group; wherein the number of target windows is greater than or equal to 3;

[0039] S20, setting the window attribute of the first window group to a top window, setting the window attribute of the second window group to a regular window, and setting the window attribute of the third window group to a top window or a regular window;

[0040] S30, receiving a message notification of a change in the Z-Order of a target window in the third window group from the Windows system, and setting the target window to a preset level through a message notification response function.

[0041] The multi-window control method based on the Windows operating system of this embodiment can efficiently and concisely implement three-level management of windows, effectively solving the user's demand for three-level management of multiple windows.

[0042] In order to better understand the present invention, each step in this embodiment is described below.

[0043] In this embodiment S10, the application system may be an application program developed by a user for specific needs, such as operation and maintenance software in a DCS system.

[0044] In S30 of this embodiment, the preset level is the topmost level or the bottommost level.

[0045] Therefore, in this embodiment S20, when the window attribute of the third window group is set to a top window, the preset level is the topmost level;

[0046] When the window property of the third window group is set to a normal window, the preset layer is the bottom layer.

[0047] For example, when the preset level is the topmost level, a window "two-level management" is implemented between the top windows, so that some of the top windows can always be located at the top of all the top windows and will never be covered by other top windows. For the convenience of the following description, this type of special top window is called the "topmost window". When the preset level is the bottommost level, a window "two-level management" is implemented between the regular windows, so that some of the regular windows can always be located at the bottom of all the regular windows and will never actively cover other regular windows. For the convenience of the following description, this type of special top window is called the "bottommost window".

[0048] Figure 3 FIG. 1 is a schematic diagram of the hierarchy of the bottom-level window, the regular window, and the top-level window in one embodiment of the present application. Figure 3 As shown in the figure, the hierarchical relationship between the bottom-level window, regular window, and top-level window is as follows:

[0049] The bottom window: It is always at the bottom of the system Z-Order and is covered by the other two types of windows;

[0050] Top window: always at the top of the system Z-Order, covering the other two types of windows;

[0051] Regular window: located between the bottom window and the top window, covering the bottom window, but covered by the top window.

[0052] Windows of the same category can cover each other. The specific covering relationship is determined by the window focus: the window that gets the focus last is located on the top of the current category window, covering other windows of the same category.

[0053] In the present embodiment S30, the message notification is a WM_WINDOWPOSCHANGING message, and the behavior of changing the window Z-Order order by the message notification response function includes:

[0054] Modify the value of the WINDOWPOS structure member passed as a parameter in the message response function.

[0055] Specifically, when the preset layer is the bottom layer, the WINDOWPOS structure member is hWndInsertAfter, and the value of the WINDOWPOS structure member passed as a parameter is modified to HWND_BOTTOM.

[0056] Two examples are given below to specifically illustrate the implementation process of the method of this embodiment.

[0057] 1. The window of the third window group is the bottom-most window.

[0058] The following steps are involved:

[0059] S1. When developing an application system, create three or more windows, where the three windows are window A, window B, and window C. Window A is the bottom window, window B is a normal window, and window C is a top window.

[0060] S2. Window A responds to the WM_WINDOWPOSCHANGING message and assigns the hwndInsertAfter value of the WINDOWPOS*lpwndpos parameter to HWND_BOTTOM.

[0061] S3. Set the properties of window B to include the normal window, and set the properties of window C to include the top attribute (HWND_TOPMOST).

[0062] At this point, the bottom-level window, the normal window, and the top-level window form a three-layer relationship. Create several normal windows and top-level windows. When these windows are switched between each other, they will not interfere with the window relationships at other levels.

[0063] It should be noted that if there are multiple bottom-level windows, all bottom-level windows cannot be displayed at the same position at the same time to avoid overlapping.

[0064] The source code example of the bottom-level window implementation is as follows:

[0065]

[0066] 2. The window of the third window group is the topmost window.

[0067] Implementation of startup hiding effect of MFC dialog program.

[0068] The solution to implement the top-level window is: the top-level window can receive the Windows system's message notification of the window Z-Order change, and the behavior of the window Z-Order change can be changed in the message notification response function. Specifically, when other top-level windows are about to cover the top-level window, the top-level window can receive the message notification, and modifying the value of the corresponding message parameter can prevent the window from covering this time. That is, through the WM_WINDOWPOSCHANGIN message in Windows. The WM_WINDOWPOSCHANGING message is sent to the corresponding window before the Windows system or third-party developers call the SetWindowPos function or other window management functions to change the position, size, and Z-Order of the specified window. At the same time, modifying the value of the WINDOWPOS structure member passed as a parameter in the message response function can change the behavior of this message processing.

[0069] When the MFC dialog program is started, the startup hiding effect of the MFC dialog program can be perfectly achieved by directly removing the SWP_SHOWWINDOW property value of the flags member of the WINDOWPOS structure in the WM_WINDOWPOSCHANGING message response function.

[0070] Embodiment 2

[0071] The second aspect of the present application proposes an operation and maintenance system for DCS, which, when interacting with a user, controls multiple windows on a desktop through a multi-window control method based on a window operating system as described in any one of the above embodiments.

[0072] For example, the system function block panel and the global function block panel of the operation and maintenance system are always required to be located above the windowed flowchart, but the windowed flowchart also needs to remain always located above the monitoring main interface. In this case, the "three-level management" of windows can be implemented in the product code in the form of the bottom-level window, regular window, and top-level window in Example 1: all monitoring main interface windows are set as the bottom-level windows, monitoring operation interface windows such as the system function block panel and the global function block panel that need to always be at the top are set as top-level windows, and other monitoring operation interface windows are set as regular windows.

[0073] The intelligent manufacturing system for the operation and maintenance system of DCS provided in this embodiment solves the problem that the monitoring operation software in the existing DCS system only performs two-level management on windows and cannot meet the user's demand for three-level management of windows.

[0074] Embodiment 3

[0075] The third aspect of the present application provides an electronic device through Example 3, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the steps of the multi-window control method based on the window operating system as described in any one of the above embodiments are implemented.

[0076] Figure 4 It is a schematic diagram of the structure of an electronic device in another embodiment of the present application.

[0077] Figure 4 The electronic device shown may include: at least one processor 101, at least one memory 102, at least one network interface 104 and other user interfaces 103. The various components in the electronic device are coupled together via a bus system 105. It is understood that the bus system 105 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 105 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 105 is not described in detail. Figure 4 Various buses are labeled as bus system 105 .

[0078] The user interface 103 may include a display, a keyboard, or a pointing device (eg, a mouse, a trackball, or a touch pad).

[0079] It can be understood that the memory 102 in this embodiment can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DRRAM). The memory 62 described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0080] In some implementations, the memory 102 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system 1021 and an application program 1022 .

[0081] The operating system 1021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application program 622 includes various application programs for implementing various application services. The program for implementing the method of the embodiment of the present invention can be included in the application program 1022.

[0082] In the embodiment of the present invention, the processor 101 calls the program or instructions stored in the memory 102, specifically, the program or instructions stored in the application 1022, and the processor 101 is used to execute the method steps provided in the first aspect.

[0083] The method disclosed in the above embodiment of the present invention can be applied to the processor 101, or implemented by the processor 101. The processor 101 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 101 or the instruction in the form of software. The above processor 101 can be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a ready-made programmable gate array or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as a hardware decoding processor to be executed, or the hardware and software units in the decoding processor can be combined to execute. The software unit can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 102, and the processor 101 reads the information in the memory 102 and completes the steps of the above method in combination with its hardware.

[0084] In addition, in combination with the multi-window control method based on the window operating system in the above embodiment, an embodiment of the present invention may provide a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of any one of the multi-window control methods based on the window operating system in the above method embodiments are implemented.

[0085] It should be noted that in the claims, any reference signs placed between brackets shall not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention may be implemented by means of hardware comprising several distinct components and by means of a suitably programmed computer. The use of the words first, second, third, etc., is for convenience of expression only and does not imply any order. These words may be understood as part of the component name.

[0086] In addition, it should be noted that, in the description of this specification, the description of the terms "one embodiment", "some embodiments", "embodiment", "example", "specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.

[0087] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments after knowing the basic creative concept. Therefore, the claims should be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present invention.

[0088] Obviously, those skilled in the art can make various modifications and variations to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention should also include these modifications and variations.

Claims

1. An operation and maintenance system for DCS, characterized in that: When the system interacts with the user, it controls multiple windows on the desktop through a multi-window control method based on the Windows operating system; The multi-window control method based on the window operating system includes: S10, dividing the target windows of the multiple windows on the desktop into a first window group, a second window group, and a third window group; wherein the number of the target windows is greater than or equal to 3; S20, setting the window attribute of the first window group to a top window, setting the window attribute of the second window group to a regular window, and setting the window attribute of the third window group to a top window or a regular window; S30, receiving a message notification from the Windows system regarding a change in the Z-Order of a target window in the third window group, and setting the target window to a preset level through a message notification response function; The default level is the top or bottom level; When the window attribute of the third window group is a top window, the preset level is the topmost level; when the window attribute of the third window group is set to a regular window, the preset level is the bottommost level; The top window is always located at the top of the Z-Order, covering the other two types of windows; the bottom window is always located at the bottom of the system Z-Order, covered by the other two layers of windows; the regular window is located between the bottom window and the top window, covering the bottom window, but covered by the top window; The overlapping relationship between windows of the same category is determined by the window focus; the window that obtains the focus is located on top of the windows of the same category, covering other windows of the same category.

2. The operation and maintenance system for DCS according to claim 1, characterized in that: The message notification is a WM_WINDOWPOSCHANGING message.

3. The operation and maintenance system for DCS according to claim 1, characterized in that: The behavior of changing the window Z-Order order is changed through message notification response function, including: Modify the value of the WINDOWPOS structure member passed as a parameter in the message response function.

4. The operation and maintenance system for DCS according to claim 3, characterized in that: When the preset layer is the bottom layer, the WINDOWPOS structure member is hWndInsertAfter.

5. The operation and maintenance system for DCS according to claim 4, characterized in that: Modify the value of the WINDOWPOS structure member passed as a parameter to HWND_BOTTOM.

6. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of a multi-window control method based on a window operating system for a DCS operation and maintenance system as described in any one of claims 1 to 5 are implemented.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of a multi-window control method based on a window operating system for a DCS operation and maintenance system as described in any one of claims 1 to 5 are implemented.