Detailed Description
Hereinafter, example embodiments according to the present application will be described in detail with reference to the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application and not all of the embodiments of the present application, and it should be understood that the present application is not limited by the example embodiments described herein.
Summary of the application
Windows supports displaying a custom Icon on the original file Icon to indicate the file status, i.e., overlay Icon (Icon). A total of 15 overlay icons are supported by Windows, 4 overlay icons are used by Windows, and the other 11 overlay icons are used for user-defined registration. For the overlay icon for user-defined registration, if the order of the overlay icon is out of 11 bits, the overlay icon is ignored by Windows, so that the overlay icon cannot be displayed. The application provides a display method of an overlay icon of an application program, which is characterized in that the priority of a custom overlay icon in a registry is changed, so that when a Windows resource manager reads the registry, the priority of the adjusted registry is read, the custom overlay icon is displayed based on the priority, and the custom overlay icon can be always displayed at a desired position (for example, the first position of all the custom overlay icons is displayed).
Exemplary method
Fig. 1 is a flowchart of a method for displaying an overlay icon of an application according to an exemplary embodiment of the present application. The embodiment can be applied to an electronic device, as shown in fig. 1, and includes the following steps:
step 101, an icon registration request about the application program is sent to Windows to obtain a custom overlay icon.
The terminal device can register the icon of the application program (software, files and the like), and after the Windows authorization is obtained, the application program is allocated with a custom icon and an overlay icon. Wherein, an Overlay Icon (Overlay Icon) may be displayed at any corner of the custom Icon to identify the state of the application program to which the custom Icon corresponds. In the embodiment of the present application, the custom icon including the overlay icon is referred to as a custom overlay icon.
Step 102, obtaining priorities of all icon key values in the registry, wherein all icon key values comprise icon key values of the custom coverage icons.
The data of the custom overlay icons are all derived from a registry, such as registry entries: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\ CurrentVersion\Explorer\ShellIcon OverlayIdentizers.
The list of entries in the registry (referred to herein as registry entries) list icon key values in which all custom overlay icons are one-to-one. The display position of the custom overlay icon is determined by the priority of its icon key value in the registry key.
Icon key values of the custom overlay icons which acquire Windows authorization are displayed in the registry key, and the priority of the icon key values is also included.
Andstep 103, adjusting the priority of the icon key value of the custom overlay icon in the registry item.
In this step, the priority of the icon key value of the custom overlay icon in the registry item is adjusted, so as to adjust the display order of the custom overlay icon. Illustratively, the priority of the custom overlay icon is adjusted such that it is displayed at a desired location, such as the top of the custom icon.
For example, in the embodiment of the present application, for the custom overlay icon, the priority of its icon key value is adjusted so that its priority is greater than the priority of all other icon key values in the registry key. For example, a is an application currently being used by a user, a custom overlay icon applied for registration is for example B, and overlay icons corresponding to applications used by other multiple users further include E, F … … M, where in the registry entry, the overlay icons are arranged in order of priority from high to low: E. f … … M, B, and the custom overlay icon of application a are prioritized last, windows may not be able to display B. In this step, the priority of B is adjusted, for example, the adjusted priorities are arranged in order of high priority to low priority: B. e, F … … M.
And 104, when the resource manager reads the registry key, redirecting the registry key with the adjusted icon key priority to the resource manager so as to display the custom overlay icon according to the registry key with the adjusted icon key priority.
The Windows resource manager program process name is Explorer.exe, and the Windows resource manager program is mainly used for displaying file and directory interfaces in various magnetic discs such as desktops and the like to users. Different file icons for different files also support displaying different overlay icons for files of different states (mostly used to indicate file states).
When the Explorer process starts, all sub-items of the registry key are enumerated and stored in the memory. When the overlay icon of a file (or an application program) needs to be displayed, calling an icon interface of the overlay icon of the file (or the application program) according to the sequence listed by the subitem of the position of the registry item, further judging whether the overlay icon of the file (or the application program) is in a state corresponding to the subitem icon, and if so, calibrating the overlay icon of the file (or the application program) as the icon corresponding to the subitem.
In this step, when the explorer.exe of the resource manager reads the registry key, enumerates all sub-keys of the registry key, the registry key obtained instep 103 is redirected to the explorer.exe of the resource manager. The explorer.exe resource manager enumerates the sub-items of the registry key obtained instep 103, and then displays the custom overlay icon according to the priority in the registry key.
In an embodiment of the present application, in this step, the registry key with the icon key priority adjusted may be redirected to the resource manager by using Hook technology. The Hook technology transfers the call to the appointed API function to the custom program to run by replacing or redirecting, and the custom program identifies and modifies the input parameters and then executes the original API function, or modifies the returned result of the original API function, or directly returns the appointed result without calling the original API function. Microsoft has itself provided some Hook-related interfaces, as well as other Hook technologies that are not self-contained. In this application, the Hook technology provided by microsoft may be used, and other Hook technologies other than microsoft may be used, which is not limited in this application.
In one embodiment, the Hook technique is used to open an application programming interface at the designated location of the registry key to redirect the registry key with the icon key priority adjusted to the resource manager. Illustratively, one of the RegOpenKeyEx, regOpenKeyExInternal, zwOpenKeyEx, ntOpenKeyEx APIs of the registry key designated location may be opened by Hook, so that the registry key with the icon key priority adjusted is redirected to the resource manager, and the resource manager's access to the registry key with the priority adjusted (note that, in this application, the method of adjusting the priority is to change only the name of the child item without modifying the GUID under the child item).
In another embodiment, the Hook technique is used to invoke the application programming interface regenumekey of the resource manager to redirect the registry key with the icon key priority adjusted to the resource manager. The explorer.exe enumeration registry location is implemented using microsoft regenumekey, an API. In this embodiment, the Hook technique is used to invoke the regenumekey interface to redirect the registry key after the icon key priority adjustment to the resource manager. In other embodiments, several APIs, regEnumKeyEx or zwieneratekey or ntenumatekey, lower in both, called by the Hook technology may also be employed to control the priority order in which sub-items are accessed.
Through the above embodiment, the explorer.exe enumerates the sub-item positions of the registry item with the icon key value priority adjusted, so that the sub-item positions are displayed according to the priority order, that is, the custom overlay icon is displayed. And when the priority of the custom coverage icon of the current user is higher than that of other coverage icons, displaying the coverage icons of the corresponding application programs in the first positions of all the coverage icons.
In summary, in the embodiments provided herein, by modifying the priority of the overlay icon in the registry key to switch the overlay icon or the order in which the overlay icons are displayed as required, the overlay graphics of the specific software (or application program) are displayed at the desired position, and are not preempted by the overlay icons of other software, and are not capable of displaying icons due to excessive registered overlay icon items.
Exemplary apparatus
Fig. 2 is a schematic structural diagram of a display device for overlaying icons of an application according to another exemplary embodiment of the present application.
As shown in fig. 2, a display device for overlaying icons of an application program may be applied to an electronic device, and the device may include: .
The registration request module 201 is configured to send an icon registration request for the application to the windows to obtain a custom overlay icon.
The priority obtaining module 202 is configured to obtain priorities of all icon key values in the registry key, where all icon key values include icon key values of the custom overlay icon.
The priority adjustment module 203 is configured to adjust the priority of the icon key value of the custom overlay icon in the registry key.
And the redirecting module 204 is configured to redirect the registry key with the adjusted icon key priority to the resource manager when the resource manager reads the registry key, so as to display the custom overlay icon according to the registry key with the adjusted icon key priority.
Further, the priority adjustment module may include:
an adjustment unit (not shown in the figure) is configured to adjust the priority of the icon key value of the custom overlay icon so that the priority of the icon key value is greater than the priority of all other icon key values in the registry.
Further, when the redirection module may include:
and the redirecting unit is used for redirecting the registry item with the icon key value priority adjusted to the resource manager by adopting the Hook technology when the resource manager reads the registry item.
Through the above embodiment, the explorer.exe enumerates the sub-item positions of the registry item with the icon key value priority adjusted, so that the sub-item positions are displayed according to the priority order, that is, the custom overlay icon is displayed. And when the priority of the custom overlay icon of the current user is higher than that of other overlay icons, displaying the overlay icons of the corresponding application programs in the first positions of all the overlay icons.
Exemplary electronic device
Next, an electronic device according to an embodiment of the present application is described with reference to fig. 3. The electronic device may be either or both of the first device 100 and the second device 200, or a stand-alone device independent thereof, which may communicate with the first device and the second device to receive the acquired input signals therefrom.
Fig. 3 illustrates a block diagram of an electronic device according to an embodiment of the present application.
As shown in fig. 3, the electronic device 11 includes one or more processors 111 and a memory 112.
The processor 111 may be a Central Processing Unit (CPU) or other form of processing unit having data processing and/or instruction execution capabilities, and may control other components in the electronic device 11 to perform desired functions.
Memory 112 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, random Access Memory (RAM) and/or cache memory (cache), and the like. The non-volatile memory may include, for example, read Only Memory (ROM), hard disk, flash memory, and the like. One or more computer program instructions may be stored on the computer readable storage medium that may be executed by the processor 111 to implement the method of displaying an overlay icon for an application and/or other desired functions of the various embodiments of the present application described above. Various contents such as an input signal, a signal component, a noise component, and the like may also be stored in the computer-readable storage medium.
In one example, the electronic device 11 may further include: an input device 113 and an output device 114, which are interconnected by a bus system and/or other forms of connection mechanisms (not shown).
For example, when the electronic device is a first device or a second device, the input means 113 may be a microphone or a microphone array as described above for capturing an input signal of a sound source. When the electronic device is a stand-alone device, the input means 113 may be a communication network connector for receiving the acquired input signals from the first device and the second device.
In addition, the input device 113 may also include, for example, a keyboard, a mouse, and the like.
The output device 114 may output various information to the outside, including the determined distance information, direction information, and the like. The output device 114 may include, for example, a display, speakers, a printer, and a communication network and remote output devices connected thereto, etc.
Of course, only some of the components of the electronic device 11 relevant to the present application are shown in fig. 3 for simplicity, components such as buses, input/output interfaces, and the like being omitted. In addition, the electronic device 11 may include any other suitable components depending on the particular application.
Exemplary computer program product and computer readable storage Medium
In addition to the methods and apparatus described above, embodiments of the present application may also be a computer program product comprising computer program instructions which, when executed by a processor, cause the processor to perform the steps in a method of displaying an overlay icon of an application according to various embodiments of the present application described in the "exemplary methods" section of the present specification.
The computer program product may write program code for performing the operations of embodiments of the present application in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server.
Furthermore, embodiments of the present application may also be a computer-readable storage medium, having stored thereon computer program instructions that, when executed by a processor, cause the processor to perform steps in a method of displaying overlay icons of an application program according to various embodiments of the present application described in the above-mentioned "exemplary method" section of the present specification.
The computer readable storage medium may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may include, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The basic principles of the present application have been described above in connection with specific embodiments, however, it should be noted that the advantages, benefits, effects, etc. mentioned in the present application are merely examples and not limiting, and these advantages, benefits, effects, etc. are not to be considered as necessarily possessed by the various embodiments of the present application. Furthermore, the specific details disclosed herein are for purposes of illustration and understanding only, and are not intended to be limiting, as the application is not intended to be limited to the details disclosed herein as such.
The block diagrams of the devices, apparatuses, devices, systems referred to in this application are only illustrative examples and are not intended to require or imply that the connections, arrangements, configurations must be made in the manner shown in the block diagrams. As will be appreciated by one of skill in the art, the devices, apparatuses, devices, systems may be connected, arranged, configured in any manner. Words such as "including," "comprising," "having," and the like are words of openness and mean "including but not limited to," and are used interchangeably therewith. The terms "or" and "as used herein refer to and are used interchangeably with the term" and/or "unless the context clearly indicates otherwise. The term "such as" as used herein refers to, and is used interchangeably with, the phrase "such as, but not limited to.
It is also noted that in the apparatus, devices and methods of the present application, the components or steps may be disassembled and/or assembled. Such decomposition and/or recombination should be considered as equivalent to the present application.
The previous description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects without departing from the scope of the application. Thus, the present application is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description has been presented for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of the application to the form disclosed herein. Although a number of example aspects and embodiments have been discussed above, a person of ordinary skill in the art will recognize certain variations, modifications, alterations, additions, and subcombinations thereof.