Display method and electronic device

By selecting the floating window to highlight when the taskbar window becomes the foreground window, and adjusting the brightness using a mask window, the problem of taskbar window highlighting is solved, improving user experience and display accuracy, and avoiding flickering.

CN119645541BActive Publication Date: 2026-01-09HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411456826.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-17
Publication Date
2026-01-09
Estimated Expiration
2044-10-17

AI Technical Summary

Technical Problem

When multiple display windows are displayed on the screen, if a user minimizes one display window by clicking the taskbar window, the taskbar window may be highlighted or other display windows on the screen may not be highlighted, affecting the user experience.

Method used

When the taskbar window becomes the foreground window, the floating window located on the top layer of the desktop is highlighted, and a mask window is used to adjust the brightness to avoid highlighting the taskbar window. A window container is set to save and update window information, the container is periodically accessed to determine the existence of the floating window, and the foreground window switching is delayed to avoid flickering.

Benefits of technology

It improves the user experience in focus mode, ensures that floating windows are highlighted, avoids taskbar window flickering and unnecessary highlighting, and enhances the accuracy and stability of the displayed window.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119645541B_ABST
    Figure CN119645541B_ABST
Patent Text Reader

Abstract

The application discloses a display method and an electronic device, and relates to the field of terminal devices, which comprises the following steps: displaying a first window; the first window is displayed in a first area on a screen, and the brightness of the first area is higher than that of the area outside the first area; minimizing the first window in response to a first operation on a task bar window; after the first window is minimized, the brightness of a second area on the screen is higher than that of the area outside the second area, and the second area is a display area of a second window on the screen, and the second window is a window displayed on the screen and saved by the electronic device in the recent period. The problem that, when a plurality of display windows are included in the screen and a user minimizes a display window by clicking a task bar window, other windows are not highlighted can be solved. Therefore, the user experience in a focus mode can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of terminal devices, and in particular to a display method and an electronic device. BACKGROUND

[0002] An electronic device that starts a focus mode can highlight a foreground window, and can change the highlighted window as the foreground window is switched, so that the user focuses on the highlighted window.

[0003] However, in a case where the screen includes multiple display windows, and the user minimizes a display window by clicking a taskbar window, it is generally considered that the foreground window is switched to the taskbar window, and there is a probability that the taskbar window is highlighted or all display windows in the screen are not highlighted, so that other display windows in the screen are not highlighted, affecting the user experience. SUMMARY

[0004] Embodiments of the present application provide a display method and an electronic device. The embodiments are used to solve the problem that in a case where the screen includes multiple display windows, and the user minimizes a display window by clicking a taskbar window, other windows are not highlighted. To achieve the above purpose, the embodiments of the present application adopt the following technical solutions:

[0005] In a first aspect, a display method is provided, which includes: displaying a first window; the first window is displayed in a first area on a screen, and the brightness of the first area is greater than the brightness outside the first area; in response to a first operation on a taskbar window, minimizing the first window; after the first window is minimized, the brightness of a second area on the screen is greater than the brightness outside the second area, and the second area is a display area of a second window on the screen, and the second window is a most recently displayed window saved by the electronic device.

[0006] In this embodiment, in a case where the user minimizes the first window by clicking the taskbar window, the second window that is the most recently displayed window saved by the electronic device is taken as the foreground window, and the second window is highlighted. Thus, the taskbar window is avoided from being highlighted or not highlighted, and the user experience is improved.

[0007] In some embodiments, the second window is obtained; the second window is a window saved in a window container; and the window container is used to store the window displayed on the screen.

[0008] In this embodiment, the window displayed on the screen is saved in the window container, and the second window is obtained from the window container, so that the efficiency of determining the second window is improved.

[0009] In some embodiments, the first window in the window container is deleted.

[0010] In this embodiment, after the first window is minimized, the first window is deleted in the window container, real-time updating of the window container can be realized, and the accuracy of determining whether there is a display window on the screen is improved.

[0011] In some embodiments, the first mask window is arranged below the second window, and the display brightness of the first mask window is lower than that of the second window; the first mask window is used to reduce the brightness of the second region on the desktop; and the display brightness of a window corresponding to the display region of the first mask window and overlapping with the first mask window is the same as that of the first mask window.

[0012] In this embodiment, the window below the first mask window is shielded by arranging the first mask window, so that the display brightness of the window below the first mask window is lower than that of the target window above the first mask window, and the highlight display effect of the window is realized.

[0013] In some embodiments, the second mask window is arranged above the taskbar window, and the display brightness of the second mask window is lower than that of the second window; the second mask is used to reduce the brightness of the taskbar window.

[0014] The display brightness of a window corresponding to the display region of the second mask window and overlapping with the second mask window is the same as that of the second mask window.

[0015] In this embodiment, by arranging the second mask window above the taskbar window, the taskbar window can be highlighted when it is considered as a foreground window. The taskbar window can also be prevented from flickering when the foreground window is switched. The second mask window can ensure that the taskbar window is always displayed at low brightness.

[0016] In some embodiments, the window container is periodically accessed; when the number of times of accessing the window container exceeds a preset threshold, whether there is a floating window on the screen is determined according to the latest access result; the floating window refers to a window displayed on the screen.

[0017] In this embodiment, by periodically accessing the window container and determining whether there is a floating window in the window container according to the latest access result when the number of times of accessing the window container exceeds a preset threshold, a delay effect is realized, the message resource of window minimization can be prevented from lagging, and misjudgment can be avoided, thereby improving the accuracy of the focus mode setting.

[0018] In some embodiments, if it is determined that there are at least two floating windows on the screen, the second window is determined according to the order of displaying the floating windows, and the second window is the latest window displayed on the screen saved by the electronic device.

[0019] In this embodiment, the last window displayed on the screen saved by the electronic device is taken as the second window, which can improve the experience of the user in the focus mode.

[0020] In some embodiments, if it is determined that there is no floating window on the screen, the desktop and the taskbar window are highlighted.

[0021] In this embodiment, the desktop and the taskbar window are highlighted in the case that there is no floating window on the screen, and the taskbar window is avoided from being highlighted.

[0022] In some embodiments, the first mask window and the second mask window are hidden.

[0023] In this embodiment, since the desktop and the taskbar window are considered as the lowest layer window, the mask window is set below the desktop and the taskbar window, which will fail, and thus the mask window is hidden to highlight the desktop.

[0024] In some embodiments, the window has a visible window attribute WS_VISIBLE;

[0025] The area overlapping with the desktop is greater than a preset area;

[0026] The number of times of switching to the top layer in a preset time is less than a preset number of times;

[0027] Non-transparent.

[0028] In this embodiment, the window satisfying the above conditions is selected as the target window to highlight the window observed by the user.

[0029] In some embodiments, the foreground window message is obtained, and it is determined whether the object of the foreground window message is the desktop or the taskbar window; if it is determined that the object of the foreground window message is the desktop or the taskbar window, the second window is obtained; otherwise, the object of the foreground window message is saved in the window container.

[0030] In this embodiment, in the case that the object of the foreground window message is the desktop or the taskbar window, the second window is obtained, which can avoid the taskbar window from being highlighted, or the screen being blocked by the mask and being displayed in low brightness. The experience of the user in the focus mode can be improved.

[0031] In a second aspect, an electronic device is provided, which has a function of implementing the method of the first aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.

[0032] In a third aspect, a computer-readable storage medium is provided, and the computer-readable storage medium stores instructions which, when executed on a computer, cause the computer to perform the method of any one of the first aspect.

[0033] In a fourth aspect, a computer program product is provided, and the computer program product stores instructions which, when executed on a computer, cause the computer to perform the method of any one of the first aspect.

[0034] The technical effects brought by any one of the second aspect to the fourth aspect can refer to the technical effects brought by different design manners in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS

[0035] Figure 1 A display window scenario diagram to which the method provided by the embodiment of the present application is applicable;

[0036] Figure 2 A focused mode scenario diagram to which the method provided by the embodiment of the present application is applicable;

[0037] Figure 3 A window Z-axis sequence diagram to which the method provided by the embodiment of the present application is applicable;

[0038] Figure 4 A focused mode scenario diagram to which the method provided by the embodiment of the present application is applicable;

[0039] Figure 5 An operating system message processing mechanism diagram to which the method provided by the embodiment of the present application is applicable;

[0040] Figure 6 A taskbar window highlighting diagram to which the method provided by the embodiment of the present application is applicable;

[0041] Figure 7 A diagram of switching a window in a focused mode to a foreground frequently to which the method provided by the embodiment of the present application is applicable;

[0042] Figure 8 A diagram of a window in a focused mode being ready time lagging behind foreground window message processing to which the method provided by the embodiment of the present application is applicable;

[0043] Figure 9 A flow diagram of a display method provided by the embodiment of the present application;

[0044] Figure 10 A framework flow diagram corresponding to a foreground window message receiving and processing process provided by the embodiment of the present application;

[0045] Figure 11A flowchart of a method for determining an effective window according to an embodiment of the present application is shown in FIG. 1.

[0046] Figure 12 A flowchart of a method for determining whether a floating window exists according to an embodiment of the present application is shown in FIG. 2.

[0047] Figure 13 A flowchart of a method for setting a focus mode according to an embodiment of the present application is shown in FIG. 3.

[0048] Figure 14 A schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application is shown in FIG. 4.

[0049] Figure 15 A schematic diagram of a software architecture of an electronic device according to an embodiment of the present application is shown in FIG. 5.

[0050] Figure 16 A flowchart of a processing procedure of an application according to an embodiment of the present application is shown in FIG. 6.

[0051] Figure 17 A flowchart of a processing procedure of a module in an application according to an embodiment of the present application is shown in FIG. 7. DETAILED DESCRIPTION

[0052] In the description of the embodiments of the present application, the terms used in the following embodiments are only for the purpose of describing the specific embodiments, and are not intended to be limiting on the present application. As used in the specification and the appended claims of the present application, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "at least one," "one or more," as used in the following embodiments, mean one or two or more (including two). The term "and / or" is used to describe the association relationship of the associated objects, which means that there can be three relationships; for example, A and / or B can represent the following three cases: A exists alone, A and B exist together, and B exists alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects.

[0053] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized. The term "connection" includes direct connections and indirect connections, unless otherwise stated. "First" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated.

[0054] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0055] Electronic devices can display multiple windows. A window is a user interface used to display the content of an application. For example... Figure 1 As shown, the electronic device 100 displays a chat window (window 11), a video window (window 12), a taskbar window (window 13), and an operating system desktop 14. The taskbar window (window 13) includes application icons 11-1 and 12-1 corresponding to the chat window (window 11) and video window (window 12), respectively. Additionally, the electronic device 100 includes input devices such as a touchscreen, mouse / touchpad, and keyboard. Users can use these input devices to interact with the content displayed in these windows and control the windows to open, close, or minimize. For example, by using a mouse / touchpad to click application icon 11-1 in the taskbar window (window 13), a user can close / open the chat window (window 11).

[0056] When the electronic device 100 displays at least one window, one window can be highlighted to facilitate the user focusing on the highlighted window. This function can be referred to as focus mode. A switch can be provided on the electronic device 100 to enter or exit the focus mode. For example, the focus mode switch is provided in the device manager application, and when the focus mode switch is turned on, the electronic device 100 enters the focus mode; when the focus mode switch is turned off, the electronic device 100 exits the focus mode. In other examples, the focus mode switch can also be provided in other applications, or separately for an application.

[0057] After the electronic device 100 enters the focus mode, the foreground window can be highlighted. The foreground window generally refers to the focus window, that is, the window that the user is currently interacting with and can receive input. In contrast, the background window refers to the non-focus window, which can remain in a running state but cannot receive input. When the background window changes to the foreground window, it can receive input. For example, the user clicks a window using a mouse, causing the window to change from the background window to the foreground window, so that the window can receive input. Referring to Figure 2 , Figure 2 An example of a display interface of the electronic device 100 after entering the focus mode is shown. In Figure 2 (a), the electronic device 100 displays a chat window (window 21), a video window (window 22), a taskbar window (window 23), and a desktop 24. The video window is the foreground window and is displayed on the top layer of the screen, and the chat window is the background window and is located below the video window. The electronic device 100 highlights the video window, and the chat window, the taskbar window, and the desktop are displayed with a lower brightness (non-highlighted) than the video window. For example, in Figure 2 (a), the diagonal line represents the non-highlighted area of the electronic device 100. If the user selects the chat window using the trackpad to control the cursor, the foreground window is switched, the chat window changes to the foreground window, and the video window changes to the background window. The electronic device 100 sets the focus mode according to the user's operation, so that the chat window is highlighted, and the video window and the desktop are non-highlighted. For example, as shown in Figure 2 (b), the chat window (window 21) is highlighted, and the video window (window 22) and the taskbar window (window 23) and the desktop 24 are non-highlighted. In Figure 2 (b), the diagonal line represents the non-highlighted area of the electronic device 100.

[0058] The screen displayed by electronic device 100 is composed of windows (the desktop can also be considered a special type of window). Each window participating in the composition has window attributes such as display position, Z-axis order, and transparency. The operating system of electronic device 100 can composite these windows according to their attributes to obtain a composite screen, which is then displayed on the screen via a display driver. The Z-axis order of the windows determines their display order within the composite screen. For example, ... Figure 3 As shown, window 31 is located at the top of all windows, window 32 is displayed below window 31, and desktop 33 is displayed below window 32.

[0059] In one implementation, the focus mode is achieved by adding a mask window below the foreground window. This mask window does not display any content, and its transparency is set to a preset value, making it semi-transparent. Thus, the content of the window below the mask window can be displayed through the mask window, but will appear darkened due to the mask window's transparency. The foreground window above the mask window remains unaffected by the mask window's transparency, thereby highlighting the foreground window. See also... Figure 4 , Figure 4 This section presents an example of how to implement highlighting in the foreground window. Figure 4 In (a), the electronic device 100 displays a screen including a foreground window (window 41), a mask window (window 42), a background window (window 43), and a desktop 44. The desktop 44 may include a taskbar window. The mask window is displayed below the foreground window and above the background window and the desktop. The electronic device 100 composites these windows according to their Z-axis order and other window properties to obtain a composite image, and then displays the composite image. Figure 4 As shown in (b), the electronic device 100 displays a composite image, in which the foreground window (window 41) is highlighted, while the background window (window 43) and desktop 44 are not highlighted, and the content displayed in the background window and desktop can be seen. Figure 4 In (b), the non-highlighted areas of the electronic device 100 are indicated by slashes.

[0060] This application provides a display method applied to a first application, which runs on the operating system of an electronic device 100. The operating system of the electronic device 100 may include, for example, [missing information - likely related to the application's functionality]. operating system, Operating systems, etc. This application embodiment deploys an electronic device 100. The operating system is used as an example for illustration. It should be noted that, although the embodiments of this application use an operating system as an example... Taking the operating system as an example, the basic principles also apply to systems based on... An electronic device 100 running an operating system.

[0061] The operating system is a message-driven system, in which a message handling mechanism is the core of the operating system. Messages provide a means for applications to communicate with each other, and with the operating system. The functions that an application is to implement are triggered by messages, and are completed by responding to and handling the messages. The message handling mechanism of an operating system is described below.

[0062] Figure 5 The message handling mechanism of the operating system of the electronic device 100 is described below. As shown in FIG. 1, the operating system is responsible for encapsulating window events detected by input devices into window messages according to a pre-defined message structure (e.g., a MSG message structure). In addition, some applications can also generate window messages. The operating system saves these window messages in a window message queue in the kernel of the operating system, and a first application obtains window messages of interest (e.g., foreground window messages, window destroy / minimize messages) from the window message queue and hands them over to a window procedure function for processing. Figure 5

[0063] The window events can be generated by input devices (e.g., a mouse / trackpad, a keyboard, etc.) in response to user operations, such as a user clicking a mouse to switch windows, or using a combination of keys on a keyboard to switch windows, etc. The operating system obtains these window events and encapsulates them into window messages according to the MSG format. In addition, some applications can also generate window messages, such as when some social software receives a chat message from a server and prepares to display a chat window, or when some application prepares to display a message pop-up window, etc.

[0064] The MSG message structure includes a window handle, a message identifier, etc. The window handle is a special identifier. Generally, the window handle indicates a memory address in which attribute information of a window is saved. The attribute information of the window can be obtained or edited using the window handle. The message identifier can indicate a window message type, which can include, for example, a foreground window message, a window create message, a window destroy message, a window minimize message, etc.

[0065] ​​​Window procedure functions are used to handle window messages. An application may include multiple window procedure functions, each capable of performing different functions. These functions may include changing the window style, window transparency, hiding the window, setting the window's Z-axis order, etc. In this embodiment, the window procedure functions included in the first application can set a focus mode based on foreground window messages. Setting a focus mode may include, for example, calling the Set Window Pos function interface to place a masked window below the foreground window.

[0066] Below, in conjunction with the above Figure 5 The examples provided illustrate the scenarios and methods applicable to the embodiments of this application.

[0067] Currently, in some scenarios, when an electronic device enters focus mode, if the user clicks the application icon on the taskbar window to minimize the window corresponding to that application icon on the desktop, the taskbar window will be highlighted, while other windows on the upper layer of the desktop will be displayed in low brightness, affecting the user experience.

[0068] like Figure 6 The diagram shown illustrates a taskbar window highlighting feature. Figure 6 In (a), the desktop of electronic device 100 displays a chat window (window 61), a video window (window 62), a taskbar window (window 63), and a desktop 64. The taskbar window (window 63) includes application icons 61-1 for the chat window and 62-1 for the video window. At this time, the chat window (window 61) is the foreground window, and electronic device 100 highlights the chat window (window 61); the video window (window 62), taskbar window (window 63), and desktop 64 are displayed in low brightness. In response to the user clicking application icon 61-1 in the taskbar window (window 63) to minimize the chat window, electronic device 100 sets the taskbar window (window 63) as the foreground window according to the window message, highlights the taskbar window, and displays the video window (window 62) and desktop 64 in low brightness. Figure 6 As shown in (b), the electronic device 100 highlights the taskbar window (window 63), while the video window 62 and desktop 64 are displayed in low brightness. Figure 6 In (b), the low-brightness display area is indicated by a slash.

[0069] In some scenarios, after the electronic device 100 enters the focus mode, if the user clicks the application icon on the taskbar window to minimize the window corresponding to the application icon on the desktop, the taskbar window is set as the foreground window, and the mask window is set under the taskbar window. However, the taskbar window is generally considered as a part of the desktop. Therefore, when the mask is set under the taskbar window, there may be a failure, so that the mask window is located above the desktop and the taskbar window. If there are other floating windows at this time, the desktop, other floating windows on the desktop, and the taskbar window are all displayed with low brightness, which affects the user experience. In some related technologies, the topmost attribute can be used to solve the above problem. That is, the target window is placed on the topmost layer of the screen, so that the taskbar window is not blocked when the taskbar window is considered as the foreground window. For example, Figure 6 As shown in (c) of Figure 6 As shown in (d), if the window 61-3 in the application corresponding to the window 61 is opened, the window 61 is still placed on the topmost layer and displayed with high brightness, and the window 61-3 cannot be displayed with high brightness.

[0070] Therefore, the embodiments of the present application provide a display method, which can highlight the floating window located above the desktop when the taskbar window is changed to the foreground window. The method comprises: displaying a first window; the first window is displayed in a first area on the screen, and the brightness of the first area is higher than that of the area outside the first area; in response to a first operation on the taskbar window, minimizing the first window; after the first window is minimized, the brightness of a second area on the screen is higher than that of the area outside the second area, and the second area is the display area of a second window on the screen, and the second window is the last window displayed on the screen saved by the electronic device. The first operation can be clicking the application icon corresponding to the first window on the taskbar window, minimizing the first window, so that the first window is not displayed on the screen, but the application icon corresponding to the first window is still displayed in the taskbar window. Unlike closing the first window, the application icon corresponding to the first window is not displayed in the taskbar window when the first window is closed. The first window and the second window are floating windows.

[0071] The floating window refers to the window visible to the user, which is neither the desktop nor the taskbar window. The floating window can be dragged to move the display position. For example, the floating window includes some application windows, or folder windows, and the like.

[0072] Optionally, the window handle of the first window and the window handle of the second window are stored in a window container. The window container is used to store the windows displayed on the screen. At the same time, in response to the first operation minimizing the first window, the first window in the window container is deleted, specifically, the window handle of the first window in the window container is deleted. The updating of the window container is implemented to ensure the accuracy of the floating window on the screen.

[0073] Therefore, in response to the first operation minimizing the first window in the taskbar window, at this time, the foreground window is changed to the taskbar window, the second window is obtained from the window container. In an example, in the case that there are at least two floating windows in the window container, it can be determined that there are at least two floating windows on the screen, and the second window is determined according to the order of display of the floating windows. The second window is the most recently displayed window stored by the electronic device. For example, the second window can be determined according to the Z-axis order of the floating windows.

[0074] That is, the floating windows displayed on the screen are stored, and in the case that the taskbar window or the desktop is changed to the foreground window, one of the stored floating windows is selected to be determined as the foreground window again and highlighted.

[0075] In some embodiments, a plurality of mask windows are set, one of which (which can be referred to as a taskbar mask window) is set above the taskbar window. In the case that the taskbar window is changed to the foreground window, if there are other floating windows on the desktop, the taskbar mask window is set above the taskbar window to achieve low brightness display of the taskbar window and avoid the case that the taskbar window and the second window are both highlighted.

[0076] The mask window does not display any content, and the transparency is set to a preset value so that the mask window has a semi-transparent effect. In this way, the content of the window below the mask window can be displayed through the mask window, but is affected by the transparency of the mask window, and the foreground window above the mask window is not affected by the transparency of the mask window. Thus, the effect of highlighting the foreground window is achieved.

[0077] For example, the first mask window is set below the target window, and the display brightness of the first mask window is lower than that of the target window. The first mask window is used to reduce the brightness of the second area on the desktop. The display brightness of the window below the first mask window and overlapping the display area corresponding to the first mask window is the same as that of the first mask window.

[0078] The second mask window is placed on top of the fixed window. The display brightness of the second mask window is lower than that of the target window. The second mask window is used to reduce the brightness of the taskbar window. The window located below the second mask window and whose display area overlaps with the second mask window has the same display brightness as the second mask window.

[0079] Additionally, when a taskbar window becomes the foreground window, if there are no floating windows on the desktop, then both the desktop and taskbar windows will be highlighted. For example, the first and second mask windows will be hidden.

[0080] In this way, when the taskbar window becomes the foreground window, if there are floating windows on the desktop, one of the topmost floating windows will be highlighted to prevent the taskbar window from being highlighted and causing other floating windows to be displayed in low brightness. If there are no floating windows on the desktop, the masked window will be hidden, thus highlighting both the desktop and the taskbar window.

[0081] In some scenarios, when an electronic device 100 enters focus mode, if several windows frequently switch to the foreground within a short period, the masked window is constantly placed beneath the foreground window, causing the windows on the electronic device 100 screen to flicker. For example, some applications generate a large number of foreground window messages, causing the Z-axis order of windows on the desktop to switch frequently. If focus mode is set for each foreground window message, the masked window will change with the switching of foreground windows, resulting in screen flickering on the electronic device 100.

[0082] like Figure 7 As shown, Figure 7 This example demonstrates how windows frequently switch to the foreground. Figure 7 In (a), an example diagram is shown where windows 71 and 72 frequently switch to the foreground. In response to window 71 being switched to the foreground (t1), focus mode is applied, placing a mask window (window 73) below window 71, with window 72 positioned below the mask window. In response to window 72 being switched to the foreground, focus mode is applied again, placing a mask window below window 72, with window 71 positioned below the mask window. (t2) Within a short period, windows 71 and 72 frequently switch to the foreground, and the mask window follows these changes, causing the electronic device screen to flicker. Figure 7 (b) Figure 7As shown in (c) of FIG. 7, in response to the window 71 being switched to the foreground for focus mode setting, the electronic device 100 highlights the window 71, and then, in response to the window 72 being switched to the foreground for focus mode setting, the electronic device 100 highlights the window 72. Frequent switching of the windows 71 and 72 to the foreground causes flickering of the screen of the electronic device (in (a) of FIG. 8). Figure 7 As shown in (b) of FIG. 9, in response to the window 71 being switched to the foreground for focus mode setting, the electronic device 100 highlights the window 71, and then, in response to the window 72 being switched to the foreground for focus mode setting, the electronic device 100 highlights the window 72. Frequent switching of the windows 71 and 72 to the foreground causes flickering of the screen of the electronic device (in (a) of FIG. 8). Figure 7 As shown in (c) of FIG. 10, in response to the window 71 being switched to the foreground for focus mode setting, the electronic device 100 highlights the window 71, and then, in response to the window 72 being switched to the foreground for focus mode setting, the electronic device 100 highlights the window 72. Frequent switching of the windows 71 and 72 to the foreground causes flickering of the screen of the electronic device (in (a) of FIG. 8).

[0083] In addition, in some scenarios, the time for loading and releasing resources of a window can be different due to different complexities of the window itself, which can cause the window to be ready (loading of resources is complete, or releasing of resources is complete) to lag behind the processing of the foreground window message, resulting in incorrect focus mode setting. For example, a user clicks an application icon on the taskbar to minimize the window corresponding to the application icon on the desktop. If focus mode setting is performed before the resources of the window are completely released, the mask window is set below the window, and after the resources of the window are completely released, the window does not exist on the desktop, and the mask window is located on the top layer of the desktop, causing the electronic device 100 to not highlight the window.

[0084] Embodiments of the present application provide a display method, which buffers a foreground window message for a preset time, and if the number of times of receiving the foreground window message is less than a preset number within the preset time, focus mode setting is performed. If the number of times of receiving the foreground window message is greater than the preset number, the foreground window message is reconstructed. In this way, flickering of the window caused by frequent switching of the window to the foreground can be avoided.

[0085] As shown in (a) of FIG. 11, in response to an operation of minimizing the window 81, the operating system of the electronic device 100 releases the resources of the window 81, and a first application performs focus mode setting. Since the resources of the window 81 are not completely released at this time, the window message still displays that the window 81 is still displayed on the desktop. Figure 8 As shown in (b) of FIG. 11, the first application selects the window 81 for focus mode setting, takes the window 81 as the foreground window, and sets a mask window (window 83) below the window 81, that is, on the top layer of the desktop 82. Figure 8 As shown in (c) of FIG. 11, after the operating system of the electronic device 100 releases the resources of the window 81, the window 81 exits the display on the desktop. However, at this time, the mask window is located on the top layer of the desktop, and the window below the mask window is hidden, as shown in (c) of FIG. 11, which causes the electronic device 100 to not display the highlighted window. Figure 8 Figure 8 Figure 8

[0086] ​​​The embodiment of the present application provides a display method, after a window is switched to the foreground, foreground window verification is performed. The foreground window verification comprises the following steps: after a preset time period elapses, if the foreground window does not change, the foreground window is selected to perform focused mode setting; if the foreground window changes, a new foreground window is selected to perform focused mode setting.

[0087] For example, a timer verification can be set, after the foreground window selected to perform focused mode setting is obtained, a timer is started, the timer is destroyed after the timer ends, after the timer is destroyed, it is determined whether a new window is switched to the foreground, if yes, the new window switched to the foreground is set to the focused mode, if not, the original foreground window is set to the focused mode.

[0088] Since the timer verification is added, the delay processing of setting the foreground window to the focused mode is performed, and the electronic device screen can be prevented from flickering due to the focused mode setting of a large number of windows switched to the foreground in a short time.

[0089] In addition, the delay processing of setting the foreground window to the focused mode can also wait for resource loading or release of the foreground window, if the resource loading of the foreground window is completed and the foreground window is displayed on the screen, the foreground window can be correctly highlighted, if the resource release of the foreground window is completed and the foreground window is not displayed on the screen, a new foreground window can be selected to be highlighted, and the electronic device screen can be prevented from not displaying the highlighted window.

[0090] As shown in FIG. 1, Figure 9 a flow of the display method is exemplarily introduced.

[0091] S901, obtain a foreground window message.

[0092] In some examples, in response to the operation of the user, a Set Win EventHook function can be used to obtain the foreground window message in the window message queue.

[0093] S902, determine whether the current foreground window message needs to be filtered.

[0094] For example, the window name / window class name is obtained through the window handle included in the foreground window message, if the window name / window class name exists in the preset window filtering list, the foreground window message needs to be filtered.

[0095] The Load XmlFile function is called to parse the xml configuration table, and all feature values that need to be filtered by window name / window class name are read out and stored in the window filter list. Then the window name / window class name of the foreground window is obtained according to the window handle included in the foreground window message, and finally the window name / window class name of the foreground window is compared with the window name / window class name in the window filter list. If the window name / window class name of the foreground window exists in the window filter list, the foreground window message needs to be filtered.

[0096] If the window obtained by the window handle included in the foreground window message has the WS_EX_NOACTION attribute or the WS_EX_TRANSPARENT attribute, the foreground window message needs to be filtered.

[0097] The Get Window Long (GWL) function is called to obtain the window style (for example, GWL_STYLE) and the window extended style (for example, GWL_EXSTYLE). If the window has the WS_EX_NOACTION attribute or the WS_EX_TRANSPARENT attribute, the foreground window message needs to be filtered.

[0098] If the window size obtained by the window handle included in the foreground window message is smaller than the preset size, or the window display area is located outside the screen display area, the foreground window message needs to be filtered.

[0099] The rect attribute of the window is obtained by the window handle included in the foreground window message, the window size and the window display area are obtained according to the rect attribute of the window, and if the window size is smaller than the preset size or the window display area is located outside the screen display area, the foreground window message needs to be filtered. According to the above example, if it is determined that the foreground window message needs to be filtered, S903 is entered. Otherwise, in the case that the foreground window message does not need to be filtered, S904 is directly entered.

[0100] S903, if the foreground window message needs to be filtered, the foreground window is filtered, and a valid window is determined.

[0101] In some examples, the valid window satisfies the following judgment conditions, for example:

[0102] The WS_VISIBLE attribute is possessed.

[0103] For example, a window with the WS_VISIBLE attribute indicates that the operating system considers the window to be visible. If a window does not have the WS_VISIBLE attribute, it means that the operating system considers the window to be invisible and cannot be observed by the user.

[0104] The area where the window intersects the desktop is greater than the preset area;

[0105] For example, some windows have unusual sizes that are difficult for users to observe with the naked eye; for instance, some windows may be only one pixel long or only one pixel wide. Window sizes like these cannot be observed by the user.

[0106] A non-transparent window.

[0107] For example, a transparent window is invisible to the user and cannot be observed by the user.

[0108] Window that is not frequently switched to the top layer. If some windows are frequently switched to the top layer in a short period of time, it will cause screen flickering and affect the user experience.

[0109] In some examples, until the foreground window message that needs to be filtered has the WS_EX_NOACTION attribute, the window handle of that foreground window is saved and S904 is entered.

[0110] for example, Figure 10 This diagram illustrates the framework flow for the message receiving and processing process in the foreground window, such as... Figure 10 As shown, the process retrieves window messages from the message queue (S1001). For example, the `Set WinEventHook` function is used to retrieve messages such as foreground window, maximized, minimized, and hidden messages from the window message queue. It then determines whether the message is a foreground window message (S1002). For example, the `WinEventProc` function is used to receive the window message from S1001 and perform message evaluation. If it is not a foreground window message, the process ends (S1006). If it is `EVENT_SYSTEM_FOREGROUND` (foreground window message), it determines whether filtering is needed (S1003). If no filtering is needed, the process proceeds to S904 (S1005). If filtering is needed, `Process Foreground Wnd Msg` is called to filter the foreground window message. The specific filtering process can be found in step S903. After filtering the foreground window message, the process constructs the foreground window message (S1004) and then proceeds to S904 (S1005). For example, the attributes that the filter window needs to process are filled in, and the construction of the foreground window message is completed.

[0111] S904. Determine whether it is a desktop or taskbar window.

[0112] In some examples, the window message can be identified using a window procedure function (e.g., a Win Event Proc function), and if there is a window activation / deactivation class message WM_OWN_ACTIVE, the foreground window attribute information is parsed from the MSG structure. Specifically, IsDesktopProcess is called to determine whether it is a desktop window. The desktop window includes the taskbar window.

[0113] Figure 11 A flowchart for determining the valid window is shown, as shown in Figure 11 The foreground window message is received (S1101). If the object of the foreground window message determined in S902 and S903 is a valid window, S1102 is directly entered. If the message obtained from the message loop is a constructed WM_OWN_ACTIVE message, the foreground window attribute information needs to be parsed from the structure. It is determined whether it is a desktop or taskbar window (S1102). If the object of the foreground window message is not a desktop or taskbar, the focus mode is set (S1106). Specifically, a mask window can be set below the foreground window, and the window can be saved in a window container. If the object of the foreground window message is a desktop or taskbar, a timer is created (S1103), and it is determined whether there is a floating window (S1104). If there is no floating window, the focus mode is set (S1106). Specifically, the mask window can be hidden, and the desktop and taskbar can be highlighted. If there is a floating window, a second window is determined (S1105). The second window is the last window displayed on the screen saved by the electronic device

[0114] As can be seen from the above, if the object of the current foreground window message is determined to be a desktop or taskbar window, S906 is entered. Otherwise,

[0115] S905 is entered.

[0116] S905, the mask window is set below the foreground window.

[0117] In an example, if it is determined that the valid window is not a desktop or taskbar window, the mask window is set below the valid window, and the window is highlighted.

[0118] In another example, after the mask setting is completed, S910 is entered, and the message loop is re-entered, that is, S901 is re-entered, and the foreground window message is continuously obtained.

[0119] S906, it is determined whether there is a floating window above the desktop.

[0120] In one possible implementation, when the object of the foreground window message is a desktop or a taskbar window, it is determined whether there is a floating window on the upper layer of the desktop. If there is, the floating window on the upper layer of the desktop is determined in the order of the Z axis from top to bottom, and the effective window on the uppermost layer is selected. The mask window is placed under the effective window to highlight the effective window. If there is not, the mask window is hidden to highlight the desktop or the taskbar window.

[0121] That is, it is determined whether there is a floating window in the window container. If there is a floating window in the window container, the second window is determined. If there is not a floating window in the window container, the desktop is highlighted.

[0122] Optionally, a window container can be set, and the window handle of the window determined as the effective window and displayed on the screen is saved in the window container. The first application program can select the window on the uppermost layer or the window recently opened in the window container as the second window. If the first application program fails to obtain the window handle from the window container, it indicates that there is no effective window floating on the upper layer of the current desktop, and the mask window is hidden to highlight the desktop.

[0123] For example, the window container is accessed periodically. If the number of accesses to the window container exceeds a preset threshold, it is determined, according to the result of the last access, whether there is a floating window on the screen. The floating window refers to the window displayed on the screen. If it is determined that there are at least two floating windows on the screen, the second window is determined according to the order of display of the floating windows. The second window is the window recently displayed on the screen saved by the electronic device. If it is determined that there is no floating window on the screen, the desktop and the taskbar window are highlighted.

[0124] In some examples, the user clicks the taskbar window, and the taskbar window is considered as the foreground window. At this time, it is necessary to determine whether there is a floating window on the upper layer of the current desktop.

[0125] For example, a timer is created to determine whether there is a floating window in the first window container, thereby determining whether there is a floating window on the upper layer of the desktop.

[0126] For example, Figure 12 The flowchart for determining whether there is a floating window when the object of the foreground window message is a desktop is shown. As shown in FIG. 2, the following steps are performed. Figure 12The timer is created (S1201). The first window container is accessed according to the time indicated by the timer (S1202). The counter is increased by 1 each time the first window container is accessed (S1203). According to the counter, it is determined whether the preset threshold is exceeded (S1204). Specifically, the first window container is accessed within a preset interval of time. The counter is increased by 1 each time the first window container is accessed. After the counter reaches the preset number of times, the timer is destroyed. According to the access result of the number of times corresponding to the preset threshold, it is determined whether there is a floating window in the first window container. For example, in the case where the preset threshold is 5 and the time interval indicated by the timer is 100 ms, the first window container is accessed once every 100 ms. The first access determines that there is no floating window in the first window container. The second access of the first window container after 100 ms determines that there is no floating window in the first window container. After 5 consecutive accesses, the access result is that there is no floating window in the first window container. It can be determined that there is no floating window in the first window container. Alternatively, in the case where the number of times of accessing the first window container exceeds the preset threshold according to the counter, the timer is destroyed.

[0127] According to the access result corresponding to the number of times of access indicated by the access threshold, it is determined whether there is a floating window (S1205). If there is a floating window in the first window container, the handle corresponding to the most recent floating window is obtained (S1206). The pointer corresponding to the foreground window is updated according to the handle corresponding to the most recent floating window (S1207). That is, the foreground window is directed to the most recent floating window in the first window container. The mask window is set below the foreground window (S1208). If it is determined that there is no floating window on the top layer of the desktop, the foreground window object is the desktop or the taskbar window at this time. The mask window is hidden (S1209). The highlight display of the desktop window and the taskbar window is realized.

[0128] According to the above determination process, if it is determined that there is a floating window, S907 is entered. Otherwise, S908 is entered.

[0129] S907, the focus mode is set.

[0130] In some examples, the first program traverses the floating windows in the desktop, and judges the windows located on the top layer of the desktop in the order of Z-axis from top to bottom, and selects the effective window located on the topmost layer as the foreground window.

[0131] In some examples, the handle corresponding to the last time the window in the first window container is suspended is obtained, and the pointer corresponding to the foreground window is updated. The mask window is set below the foreground window, so that the last time the window in the first window container is suspended is highlighted. The first window container is used to save the window handle that is determined to be a valid window. The first application program can select the window that is most recently opened or the window that is located at the uppermost layer in the first window container as the new foreground window. If the first application program fails to obtain the window handle from the first window container, it indicates that there is no valid window on the uppermost layer of the desktop.

[0132] After the focus mode setting is completed, S910 is entered, and the message loop is re-entered, that is, S901 is re-entered, and the foreground window message is continuously obtained.

[0133] In some examples, during the process of setting the mask window below the foreground window (the last time the window in the first window container is suspended), there is a certain probability that the taskbar window is highlighted. Embodiments of the present application provide a display method, in which two mask windows are set. When there is a valid suspended window on the uppermost layer of the desktop, one of the mask windows is set above the taskbar window, and is used to shield the taskbar window. Not only can the highlight display effect of the valid suspended window be enhanced, but also the flashing of the taskbar window when the suspended window is switched can be avoided. Thus, the experience of the user in the focus mode is improved. After the mask window is set, the message loop is entered, that is, S901 is re-entered, and the foreground message is continuously obtained.

[0134] S908, whether the mask window is hidden is determined.

[0135] If it is determined that there is no suspended window on the uppermost layer of the desktop, the foreground window object is the desktop or the taskbar window. The highlight display of the desktop window and the taskbar window needs to be implemented. The taskbar window is usually considered as a part of the desktop. Therefore, when the mask window is set below the desktop and the taskbar window, there is a certain probability that the setting fails, so that the mask window is located above the desktop and the taskbar window, and the desktop and the taskbar window are shielded and displayed with low brightness. If it is determined that the mask window is hidden, S910 is entered, and the message loop is re-entered, that is, S901 is re-entered, and the foreground window message is continuously obtained. Otherwise, S909 is entered.

[0136] S909, the mask window is hidden.

[0137] Embodiments of the present application provide a display method, in which the first mask window and the second mask window are hidden when the foreground window object is the desktop or the taskbar window.

[0138] If the mask window is detected to be hidden, the desktop and taskbar window can be highlighted. If the mask window is not hidden, the mask window is hidden, and the desktop and taskbar window are highlighted.

[0139] For example, the mask window can be hidden by setting the mask window to be fully transparent or setting the window attribute to WS_NOVISIBLE.

[0140] After the mask window is successfully hidden, the process returns to S910 and enters the message loop.

[0141] S910, the process returns to the message loop.

[0142] After the current foreground window message is processed, the process returns to S901 and obtains the foreground window message.

[0143] In some examples, if the foreground window does not need to be filtered, the foreground window message can be cached. The time interval indicated by the timer is used to determine whether the object of the current foreground window is the same as the object of the previous foreground window. If yes, the current foreground window message is not processed, that is, the window indicated by the foreground window object is filtered out. If no, the focus mode is set according to the foreground window indicated by the current foreground window message.

[0144] For example, if the current foreground window information is className: QAa NetmonClassslnfo, title, the following cached window log is used:

[0145] In the first time interval:

[0146] The current foreground window information is className: QAa NetmonClassslnfo, title,

[0147] The previous foreground window information is className: QAa NetmonClasss, title,

[0148] In the second time interval:

[0149] The current foreground window information is className: QAa NetmonClasss, title,

[0150] The previous foreground window information is className: QAa NetmonClassslnfo, title,

[0151] It can be determined that the current foreground window information cycles and repeats between the first and second time intervals. This indicates that the window with the name "QAa NetmonClassslnfo" and the window with the name "QAaNetmonClasss" are repeatedly switching. Therefore, it can be determined that the current foreground window information is "className: QAa NetmonClassslnfo", and the window with the title is an invalid window. There is no need to set the focus mode for this window.

[0152] Combining the method described above of accessing the first window container based on the time interval corresponding to the timer, in the event of a large number of foreground window switching messages, comparing the cached historical foreground window messages with the first window container according to the time interval indicated by the timer can not only filter out rogue software or non-focused windows that frequently switch to the foreground, thus solving the flickering problem of electronic devices in focus mode, but also avoid delays that occur when foreground window resources are displayed and loaded or minimized and reclaimed, which could lead to misjudgment of the foreground window, causing focus mode setting failure and affecting user experience.

[0153] This application provides a display method for setting a focus mode in S907 above, including: when the object of the foreground window message is a desktop or taskbar window, the windows located on the top layer of the desktop can be judged from top to bottom according to the Z-axis order, the topmost valid window can be selected, and the mask window can be placed below the valid window to achieve the effect of highlighting the topmost valid window.

[0154] like Figure 13 As shown, the method flow is illustrated by example.

[0155] S1301, Traverse all windows.

[0156] In some examples, candidate windows are retrieved sequentially along the Z-axis, starting from the topmost window, and the following process is executed:

[0157] S1302. Determine if the window has the WS_VISIBLE attribute. If yes, execute S1303; otherwise, execute S1301.

[0158] Optionally, the window handle can be used to determine whether the candidate window has the WS_VISIBLE attribute. If the window has the WS_VISIBLE attribute, it means that the window is visible to the operating system, and the subsequent judgment process continues. If the window does not have the WS_VISIBLE attribute, it means that the operating system considers the window to be invisible to the user, and the process returns to S1301 to judge the next level window of the current window.

[0159] S1303, judging whether the area of the window intersecting with the current desktop is less than a preset area, if yes, performing S1301, if no, performing S1304.

[0160] Optionally, if the area of the window intersecting with the desktop is greater than the preset area, it indicates that the window can be observed by the user, if the area of the window intersecting with the screen is less than the preset area, it indicates that the window cannot be observed by the user, and returning to S1301 to judge the next layer window of the window.

[0161] Optionally, the length and width of the window can also be judged, if any of them is less than a preset value (for example, one pixel), it indicates that the window cannot be observed by the user.

[0162] S1304, judging whether the number of times of switching the window to the top layer is greater than a preset number, if yes, performing S1301, if no, performing S1305.

[0163] In some examples, a window container is set, which is used to save the window handle included in the top layer window message in a preset time length and the time of obtaining the top layer window message. The window container saves the window handle of all the windows switched to the top layer in a time length. The number of times of switching the window to the top layer is counted according to the window handle saved by the window container, if the number of times of switching the window to the top layer is greater than a preset value, it indicates that the window is switched to the top layer too frequently and does not belong to a valid window, returning to S1301 to judge the next layer window of the window. If the number of times of switching the window to the top layer is less than a preset number, the window is continuously judged.

[0164] S1305, obtaining the pixel color (RGB value) of the target pixel point for the first time.

[0165] In some examples, the desktop pixel information is obtained by calling a method (for example, a GetDC (NULL) function) of obtaining screen pixel information, wherein the pixel information includes pixel position and RGB value. According to the desktop pixel information and the display area of the window, a target pixel point located in the display area of the window is selected, and the RGB value of the target pixel point is obtained.

[0166] S1306, setting a test window at the position of the target pixel point, changing the window color of the window, and setting the window under the candidate window.

[0167] In some examples, the size of the test window is, for example, one pixel point, and the window color is set to be different from the pixel color of the target pixel point obtained for the first time. For example, the RGB value of the target pixel point +1 can be obtained as the RGB value of the window color.

[0168] S1307, obtaining the pixel color (RGB value) of the target pixel point for the second time.

[0169] In some examples, the desktop pixel information is obtained by calling the GetDC (NULL) function, and the pixel color of the target pixel point is obtained according to the desktop pixel information, similar to the above S1305 step.

[0170] S1308, determining whether the pixel color of the target pixel point changes, if yes, performing S1301, if no, performing S1309.

[0171] In some examples, whether the color of the target pixel point changes can be determined by comparing the RGB value of the target pixel point obtained for the first time and the RGB value of the target pixel point obtained for the second time. If the RGB value of the target pixel point obtained for the first time is different from the RGB value of the target pixel point obtained for the second time, it indicates that the pixel color of the target pixel point obtained for the first time is different from the pixel color of the target pixel point obtained for the second time.

[0172] S1309, setting the mask window under the candidate window.

[0173] For example, the implementation mode described in S1301-S1309 is also applicable to the embodiment in which the object of the foreground window message is a non-desktop window, and the first application program selects a new foreground window for focus mode setting.

[0174] In addition, in some scenarios, some application programs create windows (third windows) outside the screen display area. When such windows are set as foreground windows, the mask window is set under such windows. Since such windows are located outside the screen display area, the electronic device 100 does not display the highlighted window.

[0175] The window attribute includes a rectangular area (rect) attribute, which can indicate the display area of the window. By comparing the display area of the window and the screen display area, it can be determined whether the window is located outside the display area of the screen. For example, the display area of the screen is related to the resolution of the screen. Taking a 1024 by 768 resolution screen as an example, the display area of the screen is in the value interval of X=0-1024, Y=0-768. If the display area of the window is outside the value interval of X=0-1024, Y=0-768, it indicates that the window is located outside the display area of the screen.

[0176] The embodiment of the present application provides a display method, which is applied to a first application program of an electronic device 100. The first application program obtains a window attribute of a foreground window through a window handle included in a foreground window message after obtaining the foreground window message. In a case where it is determined according to the window attribute of the foreground window that a display area of the foreground window is located outside a screen display area, the first application program selects a new foreground window according to a window handle saved in a first window container to set a focus mode of the new foreground window, and sets a mask window under the new foreground window. The effect of highlighting the new foreground window is realized.

[0177] The electronic device 100 can include a terminal device such as a tablet computer, a notebook computer, a netbook, a personal computer (PC), and the like, which can display multiple windows. The electronic device 100 is exemplarily taken as a notebook computer in the embodiments of the present application, and other terminal devices are also applicable to the embodiments of the present application, which are not limited by the present application.

[0178] In an example, the electronic device 100 includes a structure as shown in FIG. 1. Figure 14

[0179] The electronic device can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a loudspeaker 170A, a receiver 170B, a microphone 170C, a headset interface 170D, an input device 180, a display screen 190, and the like.

[0180] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device can include more or fewer components than those shown, or combine certain components, or split certain components, or different arrangement of components. The components shown can be implemented in hardware, software, or a combination of software and hardware.

[0181] ​The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units can be independent devices or integrated in one or more processors.

[0182] The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals according to instruction operation codes and timing signals, and complete the control of fetching and executing instructions.

[0183] The processor 110 can also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can save instructions or data that the processor 110 has just used or repeatedly uses. If the processor 110 needs to use the instructions or data again, it can directly call from the memory. This avoids repeated access and reduces the waiting time of the processor 110, thereby improving the efficiency of the system.

[0184] In some embodiments, the processor 110 can include one or more interfaces. The interface can include a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0185] The UART interface is a universal serial bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is usually used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to realize the Bluetooth function. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 through the UART interface to realize the function of playing music through the Bluetooth headset.

[0186] The MIPI interface can be used to connect the processor 110 and the display screen 190, keyboard and other peripheral devices. The MIPI interface includes a camera serial interface (CSI), a display screen serial interface (DSI), etc. In some embodiments, the processor 110 and the display screen 190 communicate through the DSI interface to realize the display function of the electronic device.

[0187] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 and the display screen 190, the wireless communication module 160, the audio module 170, the input device 180, etc.

[0188] The USB interface 130 is an interface that meets the USB standard specification, and can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device, or to transmit data between the electronic device and a peripheral device. For example, the electronic device can be connected to a peripheral input device such as a keyboard, a mouse, etc. through the interface; it can also be used to connect a headset to play audio through the headset. The interface can also be used to connect other electronic devices, such as AR devices, etc.

[0189] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a structural limitation of the electronic device. In some other embodiments of the present application, the electronic device can also use different interface connection methods or combinations of multiple interface connection methods in the above embodiments.

[0190] The charging management module 140 is configured to receive charging input from a charger. The charger can be a wireless charger or a wired charger. In some embodiments of wired charging, the charging management module 140 can receive charging input from a wired charger through the USB interface 130. In some embodiments of wireless charging, the charging management module 140 can receive wireless charging input through a wireless charging coil of the electronic device. The charging management module 140 can charge the battery 142 and supply power to the electronic device through the power management module 141.

[0191] The power management module 141 is configured to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 190, and the wireless communication module 160. The power management module 141 can also be configured to monitor parameters such as battery capacity, battery cycle count, battery health status (leakage, impedance), and the like. In some other embodiments, the power management module 141 can also be disposed in the processor 110. In some other embodiments, the power management module 141 and the charging management module 140 can also be disposed in the same device.

[0192] The electronic device can display through a GPU, the display screen 190, and an application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 190 and the application processor. The GPU is configured to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs that execute program instructions to generate or change display information.

[0193] The display screen 190 is configured to display images, videos, and the like. The display screen 190 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flex light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light emitting diode (QLED), or the like. In some embodiments, the electronic device can include one or N display screens 190, where N is a positive integer greater than 1. In some embodiments, the display screen 190 is also referred to as a screen.

[0194] The digital signal processor is used to process digital signals, in addition to being able to process digital image signals, it can also process other digital signals. For example, when the electronic device selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc.

[0195] The video codec is used to compress or decompress digital video. The electronic device can support one or more video codecs. In this way, the electronic device can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG 2, MPEG 3, MPEG 4, etc.

[0196] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 110 through the external memory interface 120 to realize data storage functions. For example, music, video, and other files are saved in the external memory card.

[0197] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory 121. The internal memory 121 can include a program storage area and a data storage area. The program storage area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.), etc. The data storage area can store data created during the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), etc.

[0198] The electronic device can realize audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor, etc. For example, music playing, recording, etc.

[0199] The audio module 170 is used to convert digital audio information into analog audio signals, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be disposed in the processor 110, or part of the functions of the audio module 170 can be disposed in the processor 110.

[0200] The input device 180 can include a keyboard, a mouse, and the like. The keyboard is used to input English letters, numbers, punctuation marks, and the like to the electronic device, thereby issuing a command to the electronic device, inputting data, and the like. The mouse is an indicator for positioning a longitudinal and transverse coordinate of a display system of the electronic device, and is used to input an instruction to the electronic device, and the like. The input device 180 can be connected to the electronic device in a wired connection manner, for example, the input device 180 is connected to the electronic device through a GPIO interface, a USB interface, and the like. The input device 180 can also be connected to the electronic device in a wireless manner, for example, the input device 180 is connected to the electronic device through Bluetooth, infrared, and the like.

[0201] A notebook computer is deployed with a software system, such as Figure 15 As shown, the software system can include an application layer and an OS layer, for example.

[0202] The application layer runs an application program, which includes a device manager application program (the first application program in the above embodiment), for example.

[0203] In some examples, the device manager application program includes a message acquisition module, a message filtering module, a desktop window processing module, and a timer verification module. Wherein:

[0204] The message acquisition module is used to acquire a foreground window message in a window message queue.

[0205] The message filtering module is used to process the foreground window message, filter out invalid windows, and divide valid windows into desktops, taskbar windows, and floating windows. The window handle of the floating window is handed over to a window container for recording.

[0206] The desktop window processing module is used to select whether to hide a mask window and whether to create a timer verification in a case where an object of the foreground window message is a desktop or a taskbar window.

[0207] The timer verification module is used to verify whether the foreground window message is changed. If the foreground window message is changed, it is determined whether an object of the current window message is a valid window and whether filtering processing is needed according to the cached foreground window message. At the same time, it is determined whether there is a floating window in the window container when the foreground window message is changed.

[0208] The OS layer runs system services, which include message management, window and graphics systems, for example.

[0209] The message management is used to encapsulate window messages and maintain a window message queue.

[0210] The window and graphics system is used to implement user interface (GUI) functions (also commonly referred to as Windows USER and GDI functions), such as processing windows, user interface controls, and performing drawing.

[0211] The display method provided in the embodiments of this application is described below with reference to the system architecture of the above-mentioned electronic device.

[0212] The message management module detects window events, encapsulates them into window messages, and adds these messages to the window message queue. The device manager application retrieves foreground window messages and window destruction / minimization messages from the window message queue, and sets the focus mode based on these messages. Once the focus mode is set, it notifies the window and graphics system to begin rendering. The window and graphics system then composite and render the window to obtain a composite image, which is then displayed on the screen.

[0213] The following describes how the Device Manager application handles window messages:

[0214] like Figure 16 As shown, the device manager application includes: a message acquisition module, a message filtering module, a desktop window processing module, and a timer verification module, wherein:

[0215] S1601 The message acquisition module acquires window messages, identifies the window messages, sends the foreground window messages to the message filtering module, and sends the window destruction / minimization messages to the first judgment module.

[0216] S1602. The first judgment module determines whether the foreground message needs to be filtered. If so, the foreground window message is sent to the message filtering module. If not, the foreground window message is directly sent to the second judgment module to determine whether the foreground window message object is a desktop or taskbar window.

[0217] S1603, The message filtering module filters messages in the foreground window.

[0218] Optionally, if the foreground window message to be filtered has the WS_EX_TRANSPARENT attribute, or the window size is smaller than the preset size, or the window display position is outside the screen display area, or the window name / window class name exists in the list of filtered windows, etc., construct the window message.

[0219] In other words, referring to the implementation method of S903 in the above example, foreground window messages can be filtered by window name / window class name, window style, window extension style, window size, window display area, etc., to determine valid windows. The valid window is then sent to the second judgment module.

[0220] S1604. The second judgment module determines whether the object of the current foreground window message is a desktop window or a taskbar window. If so, the foreground window message is sent to the desktop window processing module. If not, the foreground window message is sent to the message processing module.

[0221] In some embodiments, the device manager application further comprises a message processing module for processing the foreground window message, and setting the focus mode and hiding the mask window.

[0222] Optionally, the window message can be acquired and identified according to the embodiments of S901-S902 in the above examples.

[0223] S1605, the desktop window processing module sends the foreground window message to the timer checking module.

[0224] S1606, the timer checking module sends the foreground window message to the third judging module.

[0225] S1607, the third judging module judges whether there is a floating window on the desktop upper layer according to the time interval indicated by the timer checking module and the preset threshold.

[0226] Optionally, the first window container can be accessed according to the time indicated by the timer according to the embodiments of S906 in the above examples. The counter is increased by 1 each time the first window container is accessed. In the case that the counter indicates that the preset threshold is exceeded, it is determined according to the access result whether there is a floating window in the first window container. Thus, it is judged whether there is a floating window on the desktop upper layer. If yes, the message processing module is sent, the focus mode is set, and the execution is ended.

[0227] For example, the handle corresponding to the most recent floating window in the first window container is acquired, and the pointer corresponding to the foreground window is updated. The mask window is set below the foreground window, so that the most recent floating window in the first window container achieves the effect of highlight display.

[0228] If not, the foreground window message is sent to the fourth judging module.

[0229] S1608, the fourth judging module judges whether to hide the mask window. If yes, the execution is ended. If not, the message processing module is sent to hide the mask window.

[0230] Optionally, if it is determined that there is no floating window on the desktop upper layer, at this time the foreground window object is the desktop or the taskbar window, the mask window is hidden, and the highlight display of the desktop window and the taskbar window is achieved.

[0231] For example, the mask window can be hidden by setting it to full transparent color or setting the window property to WS_NOVISIBLE.

[0232] In some embodiments, the device manager application further comprises a message construction module for constructing the window message.

[0233] In some examples, the constructed window message includes a window handle of the newly selected foreground window from the first window container, or a window handle of the desktop.

[0234] In some embodiments, the device manager application further includes a cache processing module, which judges foreground window messages that do not need to be filtered, and if the number of times the foreground window message is received within a preset time period is greater than a preset number of times, the message construction module constructs a window message, and if the number of times the foreground window message is received is less than the preset number of times, the focus mode is set. In this way, the situation that the window frequently switches to the foreground and flickers can be avoided.

[0235] As shown in Figure 17 The cache processing module performs the following steps:

[0236] S1701, start the first timer check, and destroy the first timer check after the timing ends.

[0237] S1702, after the first timer check is destroyed, if the number of foreground window switching times is less than a preset number of times, the message processing module is notified to process.

[0238] S1703, after the first timer check is destroyed, if the number of foreground window switching times is greater than a preset number of times, the message construction module constructs a window message.

[0239] Optionally, after the message construction module constructs the window message, the constructed window message is sent to the message processing module, and the message processing module sets the focus mode according to the constructed window message. The specific processing process is not described again.

[0240] It can be understood that the electronic device described above includes hardware structures and / or software modules corresponding to each function to achieve the above functions. Those skilled in the art should easily realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present application can be realized in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in hardware or computer software driven hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of the present application.

[0241] The embodiments of the present application can divide the functional modules of the electronic device according to the above method examples. For example, each functional module can be divided according to each function, or two or more functions can be integrated in one processing module. The integrated module can be realized in the form of hardware or in the form of a software functional module. It should be noted that the division of the modules in the embodiments of the present application is illustrative, and is only a logical function division. Actual implementation can have another division manner.

[0242] The embodiments of the present application also provide a computer readable storage medium, which stores computer program codes. When a processor executes the computer program codes, the electronic device executes the method in the above embodiments.

[0243] The embodiments of the present application also provide a computer program product, which, when running on a computer, causes the computer to execute the method in the above embodiments.

[0244] The computer readable storage medium or the computer program product provided by the embodiments of the present application are used to execute the corresponding method provided above, and thus the beneficial effects achieved thereby can refer to those of the corresponding method provided above, which will not be repeated here.

[0245] Through the description of the above embodiments, those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional modules is exemplified. In actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.

[0246] In the several embodiments provided by the present application, it should be understood that the disclosed device and method can be implemented by other ways. For example, the device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, another division manner can be used, for example, a plurality of units or components can be combined or integrated into another device, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.

[0247] In addition, each functional unit in the embodiments of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.

[0248] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application essentially or say the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The software product is stored in a storage medium, including a plurality of instructions to make a device (which can be a single-chip microcomputer, a chip, etc.) or a processor execute all or part of the steps of the method described in various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a ROM, a magnetic disk or an optical disk, and various storage program codes.

[0249] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any change or replacement within the technical scope disclosed in the present application should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A display method characterized by comprising: The method comprises: saving, in a window container, window handles of all windows switched to a top layer within a time period; counting, according to the window handles saved by the window container, the number of times a window is switched to the top layer, and determining that the window does not belong to valid windows capable of being highlighted if the number of times the window is switched to the top layer is greater than a preset number, and determining that the window belongs to the valid windows if the number of times the window is switched to the top layer is less than the preset number; displaying a first window; the first window is displayed in a first area on a screen, the brightness of the first area is greater than the brightness of an area outside the first area, and the first window belongs to the valid windows; minimizing the first window in response to a first operation on a taskbar window; after the first window is minimized, the brightness of a second area on the screen is greater than the brightness of an area outside the second area, the second area is a display area of a second window on the screen, the second window is a window most recently displayed on the screen and saved by an electronic device, and the second window belongs to the valid windows.

2. The display method according to claim 1, wherein The method further comprises: obtaining the second window; the second window is a window saved in a window container; and the window container is used to store windows displayed on the screen.

3. The display method according to claim 1 or 2, wherein The method further comprises: deleting the first window in the window container.

4. The display method according to claim 1 or 2, wherein The method further comprises: setting a first mask window under the second window, the display brightness of the first mask window being lower than the display brightness of the second window; and the first mask window is used to reduce the brightness of the area outside the second area on the desktop. The display brightness of a window located under the first mask window and overlapping a display area corresponding to the first mask window is the same as the display brightness of the first mask window.

5. The display method according to claim 4, wherein The method further comprises: setting a second mask window above the taskbar window, the display brightness of the second mask window being lower than the display brightness of the second window; and the second mask is used to reduce the brightness of the taskbar window. The display brightness of a window located under the second mask window and overlapping a display area corresponding to the second mask window is the same as the display brightness of the second mask window.

6. The display method according to claim 4, wherein The method further comprises: periodically accessing the window container; if the number of times of accessing the window container exceeds a preset threshold, determining, according to the result of the most recent access, whether there is a floating window on the screen; the floating window represents a window displayed on the screen.

7. The display method according to claim 6, wherein The method further comprises: if it is determined that there are at least two floating windows on the screen, determining the second window according to the order of displaying the floating windows; the second window is a window most recently displayed on the screen and saved by the electronic device.

8. The display method according to claim 7, wherein The method further comprises: if it is determined that there is no floating window on the screen, highlighting the desktop and the taskbar window.

9. The display method according to claim 8, wherein The highlighting the desktop and the taskbar window comprises: hiding the first mask window and the second mask window.

10. The display method according to claim 1 or 2, wherein The first window and the second window comprise the following conditions: having a visible window property WS_VISIBLE. An area overlapped with the desktop is greater than a preset area; A number of times of switching to the top layer within a preset time is less than a preset number of times; Non-transparent.

11. The display method according to claim 1 or 2, wherein The method further includes: acquiring a foreground window message, and determining whether an object of the foreground window message is the desktop or the taskbar window; if it is determined that the object of the foreground window message is the desktop or the taskbar window, acquiring the second window; otherwise, saving the object of the foreground window message in the window container.

12. An electronic device, comprising: The electronic device includes a processor and a memory, the processor is coupled with the memory; the memory is configured to store computer program code; the computer program code includes computer instructions, when the processor executes the computer instructions, the electronic device executes the display method as claimed in any one of claims 1-11.

13. A computer-readable storage medium, characterized in that, The computer program product, when running on an electronic device, causes the electronic device to execute the display method as claimed in any one of claims 1-11.

14. A computer program product, characterised in that, The computer program product, when running on an electronic device, causes the electronic device to execute the display method as claimed in any one of claims 1-11.

Citation Information

Patent Citations

  • Multi-interface display method and electronic equipment

    CN115480629A

  • Infusion equipment and information display method applied to infusion equipment

    CN118142020A