A method, apparatus, device and medium for sharing a window in a multi-display screen
By responding to sharing commands across multiple monitor screens, traversing and selecting target windows for mapping and sharing, the problem of poor flexibility in window sharing in existing technologies is solved, and efficient window sharing is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- EEO EDUCATION TECH CO LTD
- Filing Date
- 2023-09-15
- Publication Date
- 2026-07-31
AI Technical Summary
Existing screen sharing methods can only share all windows currently displayed on the screen or a specific window that is currently open. They cannot be freely arranged, resulting in poor flexibility and low sharing efficiency.
By responding to sharing commands for multiple first windows, traversing multiple first windows, selecting the target window to be shared, mapping it to the target rendering window, and capturing the image data of the target rendering window for sharing, it is possible to flexibly schedule and share windows on multiple monitors.
It improves the flexibility and efficiency of window sharing, enabling free scheduling and efficient sharing of windows across multiple monitors.
Smart Images

Figure CN117111869B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more specifically, to a method, apparatus, device, and medium for sharing windows in a multi-monitor screen. Background Technology
[0002] With the continuous development of the Internet, in scenarios such as video recording, video processing, live video streaming, and video conferencing, it is often necessary for the sharing party to share the screen of their local device.
[0003] In practice, as office efficiency improves, the local device of the sharing party can typically connect to one or more monitors and share the screen of one or more monitors to facilitate the sharing party's operation instructions or to request assistance from the shared party. However, existing sharing methods can only share all windows currently displayed on the screen or a specific currently open shared window, without the ability to freely relocate them. This results in poor flexibility of shared windows, ultimately leading to low sharing efficiency. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide a method, apparatus, device and medium for sharing windows in multiple monitor screens, which can traverse multiple first windows in response to sharing instructions for multiple first windows, select a target window to be shared and map it to a target rendering window, and capture the image data of the target rendering window for sharing. It can share windows in multiple monitors, and can filter windows, that is, freely schedule the shared windows, thereby improving the flexibility of sharing windows and thus improving sharing efficiency.
[0005] In a first aspect, embodiments of this application provide a method for sharing windows across multiple monitor screens, applied to a host computer, the method comprising:
[0006] In response to the host's operation, the host screen is displayed on multiple target displays connected to the host and in an open state, and multiple currently running first windows are displayed on the host screen; at least one first window is displayed on each target display;
[0007] In response to a sharing instruction for the plurality of first windows, the plurality of first windows are traversed, and a target window to be shared is selected from the plurality of first windows; wherein, while traversing the plurality of first windows, the window handles of the plurality of first windows are stored in a specified shared storage object, and after the target window is determined, the window handles of the second windows that need to be filtered, other than the target window, are deleted from the shared storage object.
[0008] The target window is mapped to the target rendering window, and the image data of the target rendering window is captured and shared to achieve the sharing of the target window.
[0009] In one possible implementation, the response to the sharing instruction for the plurality of first windows, traversing the plurality of first windows, and selecting the target window to be shared from the plurality of first windows, includes:
[0010] In response to a first selection instruction for the plurality of first windows, a target region is defined on the target rendering window, and the target region is divided into a plurality of sub-regions according to a first number of the plurality of first windows, and the sub-region corresponding to each first window is determined.
[0011] Iterate through the multiple first windows and display the first window corresponding to each sub-region in each sub-region;
[0012] In response to a second selection instruction triggered by the selection box mapping of each sub-region through the box selection operation, a target window to be shared is selected from the first window corresponding to each sub-region.
[0013] In one possible implementation, the response to the sharing instruction for the plurality of first windows, traversing the plurality of first windows, and selecting the target window to be shared from the plurality of first windows, includes:
[0014] In response to a first selection instruction for the plurality of first windows, a target region is defined on the target rendering window, and the target region is divided into a plurality of sub-regions according to a second number of the plurality of target displays, and a sub-region corresponding to each of the target displays is determined;
[0015] The first window displayed on each of the target displays is traversed, and the first window of the target display corresponding to each sub-region is displayed in each sub-region; wherein each sub-region and each first window has a selection identifier;
[0016] In response to a third selection instruction that selects an identifier for each sub-region or each first window, a target window to be shared is selected from the first window of each sub-region.
[0017] In one possible implementation, before responding to a sharing instruction for the plurality of first windows, traversing the plurality of first windows, and selecting a target window to be shared from the plurality of first windows, the method further includes:
[0018] The width and height parameters of the target rendering window are determined based on the width and height parameters and scaling ratio of each monitor;
[0019] The target rendering window is created based on its width and height parameters;
[0020] Capture desktop screenshots from multiple monitors and map the desktop screenshots onto the target rendering window.
[0021] In one possible implementation, determining the width and height parameters of the target rendering window based on the width and height parameters and scaling ratio of each display includes:
[0022] Obtain the width, height, and scaling ratio for each monitor;
[0023] The width, height, and scaling parameters of each monitor are combined using virtual desktops to obtain the width and height parameters of the target rendering window.
[0024] In one possible implementation, acquiring desktop screenshots from multiple displays and mapping the desktop screenshots to the target rendering window includes:
[0025] The desktop handles of the multiple displays are obtained based on the system's application programming interface;
[0026] The desktop screenshots of the multiple displays are obtained through the application programming interface of the desktop window manager and the desktop handle, and the desktop screenshots are mapped to the target rendering window through the application programming interface of the desktop window manager.
[0027] In one possible implementation, the step of capturing and sharing the image data of the target rendering window to achieve the sharing of the target window includes:
[0028] Obtain the capture area sent by the application's upper layer;
[0029] The image data of the target rendering window corresponding to the captured area is extracted and sent to the upper layer of the application for sharing.
[0030] Secondly, embodiments of this application also provide a window sharing device in a multi-monitor screen, the device comprising:
[0031] The display module is used to respond to host operation, display the host screen on multiple target displays connected to the host that are in an open state, and display multiple currently running first windows on the host screen; at least one first window is displayed on each target display;
[0032] A selection module is used to respond to a sharing instruction for the plurality of first windows, traverse the plurality of first windows, and select a target window to be shared from the plurality of first windows; wherein, when traversing the plurality of first windows, the window handles of the plurality of first windows are stored in a specified shared storage object, and after the target window is determined, the window handles of the second windows that need to be filtered, other than the target window, are deleted from the shared storage object.
[0033] The capture module is used to map the target window to a target rendering window and capture the image data of the target rendering window for sharing, so as to realize the sharing of the target window.
[0034] In one possible implementation, the selection module is specifically used for:
[0035] In response to a first selection instruction for the plurality of first windows, a target region is defined on the target rendering window, and the target region is divided into a plurality of sub-regions according to a first number of the plurality of first windows, and the sub-region corresponding to each first window is determined.
[0036] Iterate through the multiple first windows and display the first window corresponding to each sub-region in each sub-region;
[0037] In response to a second selection instruction triggered by the selection box mapping of each sub-region through the box selection operation, a target window to be shared is selected from the first window corresponding to each sub-region.
[0038] In one possible implementation, the selection module is specifically used for:
[0039] In response to a first selection instruction for the plurality of first windows, a target region is defined on the target rendering window, and the target region is divided into a plurality of sub-regions according to a second number of the plurality of target displays, and a sub-region corresponding to each of the target displays is determined;
[0040] The first window displayed on each of the target displays is traversed, and the first window of the target display corresponding to each sub-region is displayed in each sub-region; wherein each sub-region and each first window has a selection identifier;
[0041] In response to a third selection instruction that selects an identifier for each sub-region or each first window, a target window to be shared is selected from the first window of each sub-region.
[0042] In one possible implementation, the selection module is specifically used for:
[0043] Before responding to the sharing instruction for the plurality of first windows, traversing the plurality of first windows, and selecting the target window to be shared from the plurality of first windows, the width and height parameters of the target rendering window are determined based on the width and height parameters and scaling ratio of each display.
[0044] Capture desktop screenshots from multiple monitors and map the desktop screenshots onto the target rendering window.
[0045] In one possible implementation, the selection module is specifically used for:
[0046] Obtain the width, height, and scaling ratio for each monitor;
[0047] The width, height, and scaling parameters of each monitor are combined using virtual desktops to obtain the width and height parameters of the target rendering window.
[0048] In one possible implementation, the selection module is specifically used for:
[0049] The desktop handles of the multiple displays are obtained based on the system's application programming interface;
[0050] The desktop screenshots of the multiple displays are obtained through the application programming interface of the desktop window manager and the desktop handle, and the desktop screenshots are mapped to the target rendering window through the application programming interface of the desktop window manager.
[0051] In one possible implementation, the interception module is specifically used for:
[0052] Obtain the capture area sent by the application's upper layer;
[0053] The image data of the target rendering window corresponding to the captured area is extracted and sent to the upper layer of the application for sharing.
[0054] Thirdly, embodiments of this application provide an electronic device, including: a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the method for sharing windows in a multi-monitor screen as described in any of the first aspects.
[0055] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the method for sharing windows in a multi-monitor screen as described in any one of the first aspects.
[0056] This application provides a method, apparatus, device, and medium for sharing windows across multiple monitor screens. Responding to host operation, the system displays the host screen on multiple target monitors connected to the host and in an open state. Multiple currently running first windows are displayed on the host screen. Responding to sharing instructions for the multiple first windows, the system traverses the multiple first windows, selects a target window to be shared from among them, maps the target window to a target rendering window, and captures and shares image data from the target rendering window, thereby achieving target window sharing. This method for sharing windows across multiple monitor screens, by responding to sharing instructions for multiple first windows, traversing the multiple first windows, selecting a target window to be shared, mapping it to a target rendering window, and capturing and sharing image data from the target rendering window, enables screen sharing across multiple monitors. Furthermore, it allows for filtering windows, i.e., free scheduling of shared windows, improving the flexibility of window sharing and thus increasing sharing efficiency.
[0057] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0058] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0059] Figure 1 This is a flowchart of a method for sharing windows in a multi-monitor screen according to an embodiment of this application;
[0060] Figure 2 This is a flowchart of a method for sharing windows in a multi-monitor screen according to another embodiment of this application;
[0061] Figure 3 This is a flowchart of a method for sharing windows in a multi-monitor screen according to another embodiment of this application;
[0062] Figure 4 This is a flowchart of a method for sharing windows in a multi-monitor screen according to another embodiment of this application;
[0063] Figure 5 This is a flowchart of a method for sharing windows in a multi-monitor screen according to another embodiment of this application;
[0064] Figure 6This is a schematic diagram of a window sharing device in a multi-monitor screen according to an embodiment of this application;
[0065] Figure 7 This is a schematic diagram of the structure of a computer device according to an embodiment of this application. Detailed Implementation
[0066] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.
[0067] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0068] It should be noted that the term "comprising" will be used in the embodiments of this application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.
[0069] In scenarios such as video recording, video processing, live video streaming, and video conferencing, screen sharing by the sharing party is often required. This typically involves sharing the screens of one or more monitors connected to the sharing party's local device to provide instructions or request assistance from the shared party. However, this common sharing method can only share all windows currently displayed on the screen or a specific currently open window, lacking flexibility and resulting in low sharing efficiency.
[0070] To address this issue, this application provides a method, apparatus, device, and medium for sharing windows across multiple monitor screens. By responding to sharing instructions for multiple first windows, traversing multiple first windows, selecting a target window to be shared, mapping it to a target rendering window, and capturing image data from the target rendering window for sharing, this method enables screen sharing of windows across multiple monitors. Furthermore, it allows for filtering windows and free scheduling of shared windows, improving the flexibility of window sharing and thus increasing sharing efficiency.
[0071] Figure 1 This is a flowchart of a method for sharing windows in a multi-monitor screen according to an embodiment of this application. This method is applied to a host computer. Figure 1 As shown, the method for sharing windows in a multi-monitor screen according to an embodiment of this application may specifically include:
[0072] S101, in response to host operation, displays the host screen on multiple target displays connected to the host that are in the open state, and displays multiple currently running first windows on the host screen.
[0073] It should be noted that the embodiments of this application are applied to a host, where a host refers to a terminal device that can share windows on a display screen, such as a computer, specifically a local computer. This application uses a computer as an example for description, but this does not constitute a limitation on this application. The specific settings can be made according to the actual situation.
[0074] In this embodiment, the target display is a display connected to the host and in an open state; the host screen is the content displayed on the host screen; and the first window is all the windows displayed in the current process of the host. In response to the host running (i.e., the host is in a normal working state), the host screen is displayed on multiple target displays connected to the host and in an open state, and multiple currently running first windows are displayed on the host screen. It should be noted that at least one first window is displayed on each target display; that is, at least one first window from the multiple first windows on the host is assigned to a target display, as a basic prerequisite for subsequent window sharing on the display screen.
[0075] S102, responding to a sharing instruction for multiple first windows, traverses the multiple first windows and selects the target window to be shared from the multiple first windows.
[0076] In this embodiment, the sharing instruction is an instruction issued by the sharing party to share a window on the screen. For example, the sharing party issues a sharing instruction by clicking the button representing the sharing function option on the host screen. As those skilled in the art will understand, the sharing party is the user of the local computer, and the target window is the window selected by the sharing party to be shared. In response to the sharing instruction for multiple first windows in step S101, the sharing party traverses the multiple first windows and selects the target window to be shared from the multiple first windows for subsequent processing.
[0077] It should be noted that this application does not impose many restrictions on the specific method of selecting the target window to be shared from multiple first windows, and can be set according to the actual situation.
[0078] Optionally, when traversing multiple first windows, the window handles (Handle to a Window, HWND) of multiple first windows are stored in a specified shared storage object. After determining the target window, the window handles of the second windows that need to be filtered, excluding the target window, are deleted from the shared storage object. Here, the second window refers to the window outside the target window in the first windows, i.e., the window that needs to be filtered. The shared storage object is a data structure that stores the window handles of each first window, such as a Windows list. It can be understood that the window handle represents the identifier of the first window; that is, each first window corresponds to a different window handle. After determining the target window to be shared, it means that the windows outside the target window to be shared, i.e., the second windows that need to be filtered, are also determined. The window handles corresponding to these second windows that need to be filtered are deleted from the aforementioned specified shared storage object, thereby enabling the selection of the target window to be shared among multiple first windows.
[0079] S103, map the target window to the target rendering window, and capture the image data of the target rendering window for sharing, so as to realize the sharing of the target window.
[0080] In this embodiment of the application, the target rendering window is the window used to map the window to be shared, and the image data is the image data of the target rendering window corresponding to the target window, such as window screenshots and desktop screenshots. The target window is mapped to the target rendering window, and the image data of the target rendering window is captured and shared to realize the sharing of the target window.
[0081] Optionally, the target windows can be mapped sequentially to the target rendering windows according to the hierarchical order in which they are displayed on the monitor screen.
[0082] The window sharing method in multiple monitors provided in this application responds to host operation, displays the host screen on multiple target monitors connected to the host and in an open state, and displays multiple currently running first windows on the host screen. Responding to sharing instructions for the multiple first windows, the method traverses the multiple first windows, selects a target window to be shared from the multiple first windows, maps the target window to a target rendering window, and captures and shares the image data of the target rendering window, thereby achieving target window sharing. This method in multiple monitors, by responding to sharing instructions for multiple first windows, traversing the multiple first windows, selecting a target window to be shared, mapping it to a target rendering window, and capturing and sharing the image data of the target rendering window, enables screen sharing of windows on multiple monitors. Furthermore, it allows for window filtering, i.e., free scheduling of shared windows, improving the flexibility of window sharing and thus increasing sharing efficiency.
[0083] Furthermore, such as Figure 2 As shown, step S102 in the above embodiment, "responding to a sharing instruction for multiple first windows, traversing multiple first windows, and selecting a target window to be shared from the multiple first windows," may specifically include the following steps:
[0084] S201, in response to a first selection instruction for multiple first windows, delineate a target region on the target rendering window, divide the target region into multiple sub-regions according to a first number of multiple first windows, and determine the sub-region corresponding to each first window.
[0085] In this embodiment of the application, the first selection instruction is an instruction to select multiple first windows, and the target area is a defined area for displaying the first windows. In response to the first selection instruction for multiple first windows, the target area is defined on the target rendering window, and the target area is divided into multiple sub-areas according to the first number of multiple first windows, and the sub-area corresponding to each first window is determined.
[0086] It should be noted that this application does not impose many restrictions on the specific method of dividing the target area into multiple sub-regions, which can be set according to the actual situation.
[0087] As one possible implementation, the target area can be divided into a first number of regions of the same shape and size based on the first number corresponding to multiple first windows. For example, if the first number corresponding to the first window is 12, the target area can be divided into 12 sub-regions of the same shape and size. Specifically, the target area can be divided into 12 rectangular sub-regions, circular sub-regions, etc., of the same shape and size. It should be noted that it is only necessary to ensure that the shape and size of the sub-regions are the same; the specific shape and size can be set according to the actual situation, and this application will not describe it in detail.
[0088] Optionally, when dividing the target area into sub-regions, the sub-regions can be divided on the target area without any gaps, that is, each sub-region is closely connected without any gaps between them, or they can be divided with a pre-set interval between the sub-regions, that is, each sub-region has a certain gap between them. This application will not describe this in detail.
[0089] As one possible implementation, the target region can be divided into sub-regions based on the first quantity corresponding to multiple first windows, and the shape and size of the corresponding sub-region can be determined based on the attributes of each first window, thereby dividing the target region into sub-regions.
[0090] Optionally, the unit area can be set to determine the size of the corresponding sub-region based on the attributes of each first window. For example, when the attribute corresponding to the first window is "document", the size of the sub-region corresponding to the first window can be set to two unit areas, and the size of the sub-region corresponding to the other first windows with non-document attributes can be set to two unit areas, thereby determining the size of the sub-regions corresponding to multiple first windows.
[0091] Furthermore, for example, when the attribute corresponding to the first window is document, the sub-region corresponding to the first window can be set as a rectangular sub-region, and the sub-regions corresponding to the other first windows with non-document attributes can be set as circular sub-regions.
[0092] It should be noted that this application does not impose many restrictions on the specific methods for determining the shape and size of multiple sub-regions, which can be set according to the actual situation.
[0093] It should also be noted that there are multiple ways to arrange these sub-regions. Optionally, the number of horizontally arranged sub-regions can be fixed, and then vertically arranged. For example, if the target area is fixed to have a maximum of 4 horizontally arranged sub-regions, then the 12 sub-regions can be arranged in a 3x4 grid.
[0094] Optionally, the number of vertically arranged sub-regions can be fixed, and then horizontal arrangement can be performed based on this. For example, if the target area is fixed to have a maximum of 6 vertically arranged sub-region data, then these 12 sub-regions can be arranged in a 2x6 grid.
[0095] S202, traverse multiple first windows and display the first window corresponding to each sub-region in each sub-region.
[0096] In this embodiment of the application, multiple first windows are traversed, and the first window corresponding to the sub-region is displayed in each sub-region of the target region defined in step S201.
[0097] Optionally, multiple primary windows can be iterated through using the Windows API (Application Programming Interface), specifically by iterating through all displayable windows in the current process of the computer.
[0098] S203, responding to the second selection instruction for the first window triggered by the selection box mapping through the box selection operation covering each sub-region, select the target window to be shared from the first window corresponding to each sub-region.
[0099] In this embodiment of the application, the second selection instruction is an instruction to select the first window of each sub-region. In response to the second selection instruction for the first window triggered by the selection box mapped by the box selection operation covering each sub-region, the target window to be shared is selected from the first window corresponding to each sub-region for subsequent processing.
[0100] Furthermore, such as Figure 3 As shown, step S102 in the above embodiment, "responding to a sharing instruction for multiple first windows, traversing multiple first windows, and selecting a target window to be shared from multiple first windows", may further include the following steps: S301, responding to a first selection instruction for multiple first windows, defining a target area on the target rendering window, dividing the target area into multiple sub-areas according to the second number of multiple target displays, and determining the sub-area corresponding to each target display.
[0101] In this embodiment, in response to a first selection instruction for multiple first windows, i.e., after the sharing party selects multiple first windows, a target area is delineated on the target rendering window, and the target area is divided into multiple sub-regions according to a second number of target displays, and the sub-region corresponding to each target display is determined. It should be noted that the target area can be divided into a second number of sub-regions with the same shape and size.
[0102] S302, traverse the first window displayed on each target display, and display the first window of the target display corresponding to each sub-region in each sub-region.
[0103] In this embodiment, each sub-region and each first window has a selection identifier, wherein the selection identifier represents the uniqueness of the selection of the sub-region and the first window. The first window displayed on each target display is traversed, and the first window of the target display corresponding to the sub-region is displayed in each sub-region for subsequent processing.
[0104] S303, in response to a third selection instruction for selecting an identifier for each sub-region or each first window, selects the target window to be shared from the first window of each sub-region.
[0105] In this embodiment, the third selection instruction is a selection instruction for the selection identifier of each sub-region or each first window. Responding to the third selection instruction for the selection identifier of each sub-region or each first window, a target window to be shared is selected from the first window of each sub-region. It can be understood that the third selection instruction corresponds to the target window to be shared.
[0106] Furthermore, such as Figure 4 As shown, before step S102 "responding to the sharing instruction for the plurality of first windows, traversing the plurality of first windows, and selecting the target window to be shared from the plurality of first windows" in the above embodiment, the following steps may be included:
[0107] S401 determines the width and height parameters of the target rendering window based on the width and height parameters and scaling ratio of each monitor.
[0108] In this embodiment, the width and height parameters of the target rendering window are determined by the width and height parameters and scaling ratio of each display, so as to create the target rendering window subsequently.
[0109] It should be noted that this application does not impose too many restrictions on the specific method of determining the width and height parameters of the target rendering window based on the width and height parameters and scaling ratio of each monitor, and can be set according to the actual situation.
[0110] As one possible implementation, the width, height, and scaling parameters of each monitor are obtained, and the width, height, and scaling parameters of each monitor are stitched together using virtual desktops to obtain the width and height parameters of the target rendering window.
[0111] S402, Create a target rendering window based on the width and height parameters of the target rendering window.
[0112] In this embodiment of the application, the target rendering window is created according to the width and height parameters of the target rendering window determined in step S401.
[0113] It should be noted that this application does not impose too many restrictions on the specific method of creating the target rendering window, and can be set according to the actual situation.
[0114] Optionally, an intermediate target rendering window can be created based on the Virtual Screen property of the Windows system. Those skilled in the art will understand that Windows systems have supported the VirtualScreen feature since Windows 10 version 1607.
[0115] S403 captures desktop screenshots from multiple monitors and maps the desktop screenshots to the target rendering window.
[0116] In this embodiment, desktop screenshots from multiple monitors are acquired, and the acquired desktop screenshots are mapped to the target rendering window created in step S402 to obtain a target rendering window that includes the desktop screenshots. It is understood that the content displayed on the monitor screen includes the window and the system desktop beneath the window; the system desktop can be obtained by acquiring desktop screenshots.
[0117] One possible implementation is to obtain desktop handles for multiple monitors using the system's Application Programming Interface (API), capture screenshots of the desktops from these monitors using the Desktop Window Manager (DWM) API and the desktop handles, and then map these screenshots to the target rendering window using the DWM API. Alternatively, desktop handles can be obtained using the Windows API, and then the corresponding desktop handles can be further obtained using the DWM API, and the desktop screenshots can be mapped to the target rendering window using the Windows API.
[0118] Those skilled in the art will understand that Windows systems have supported DWM since Windows Vista. Through the DWM API interface, it is possible to quickly take screenshots and map the first window currently running on the computer system and the desktop.
[0119] Furthermore, such as Figure 5 As shown, step S103 in the above embodiment, "capturing and sharing the image data of the target rendering window to achieve the sharing of the target window," may specifically include the following steps:
[0120] S501, obtain the capture area sent by the application's upper layer.
[0121] In this embodiment, the capture area is the area that needs to be captured as set by the application layer. The capture area corresponds to the target window to be shared. The upper application layer is the application layer that sends information such as the capture area to the sharing party, such as a cloud platform. The upper application layer obtains the capture area sent by the upper application layer for subsequent processing.
[0122] S502 captures the image data of the target rendering window area corresponding to the captured area and sends the image data to the upper layer of the application for sharing.
[0123] In this embodiment, the image data refers to the data of the target rendering window region, including the target window to be shared and the desktop screenshot data. Based on the capture area sent by the application upper layer obtained in step S501, the image data of the target rendering window region corresponding to the capture area is captured. Specifically, the image data of the target rendering window is captured, and the area to be displayed is cropped. This image data is then sent to the application upper layer for window sharing. It should be noted that the application upper layer can display or save this image data; this application will not elaborate on this aspect.
[0124] Optionally, you can use the Windows API to capture window screenshots and use the Gdi (Graphics Device Interface) plus API to capture image data of a region to achieve the purpose of quick screen capture.
[0125] Figure 6 This is a flowchart of a window sharing device in a multi-monitor screen according to an embodiment of this application, as follows: Figure 6 As shown, the window sharing device 600 in a multi-monitor screen according to an embodiment of this application may specifically include:
[0126] Display module 601 is used to respond to host operation, display the host screen on multiple target displays connected to the host that are in the open state, and display multiple currently running first windows on the host screen; at least one first window is displayed on each target display.
[0127] The selection module 602 is used to respond to a sharing instruction for multiple first windows, traverse multiple first windows, and select a target window to be shared from multiple first windows; wherein, when traversing multiple first windows, the window handles of multiple first windows are stored in a specified shared storage object, and after the target window is determined, the window handles of the second windows that need to be filtered, other than the target window, are deleted from the shared storage object.
[0128] The capture module 603 is used to map the target window to the target rendering window and capture the image data of the target rendering window for sharing, so as to realize the sharing of the target window.
[0129] In one possible implementation, module 602 is selected, specifically for:
[0130] In response to a first selection instruction for multiple first windows, a target region is defined on the target rendering window, and the target region is divided into multiple sub-regions according to a first number of multiple first windows, and the sub-region corresponding to each first window is determined.
[0131] Iterate through multiple first windows and display the first window corresponding to each sub-region in each sub-region;
[0132] The response to the second selection instruction for the first window triggered by the selection box mapping through the selection operation overlays each sub-region is to select the target window to be shared from the first window corresponding to each sub-region.
[0133] In one possible implementation, module 602 is selected, specifically for:
[0134] In response to a first selection instruction for multiple first windows, a target region is defined on the target rendering window, and the target region is divided into multiple sub-regions according to a second number of multiple target displays, and the sub-region corresponding to each target display is determined.
[0135] Iterate through the first window displayed on each target monitor and display the first window of the target monitor corresponding to each sub-region; wherein each sub-region and each first window has a selection identifier;
[0136] In response to a third selection instruction that selects an identifier for each sub-region or each first window, select the target window to be shared from the first window of each sub-region.
[0137] In one possible implementation, module 602 is selected, specifically for:
[0138] Before responding to a sharing instruction for multiple first windows, traversing multiple first windows, and selecting the target window to be shared from multiple first windows, the width and height parameters of the target rendering window are determined based on the width and height parameters and scaling ratio of each monitor.
[0139] Capture desktop screenshots from multiple monitors and map the desktop screenshots to the target rendering window.
[0140] In one possible implementation, module 602 is selected, specifically for:
[0141] Obtain the width, height, and scaling ratio for each monitor;
[0142] The width, height, and scaling of each monitor are stitched together using virtual desktops to obtain the width and height of the target rendering window.
[0143] In one possible implementation, module 602 is selected, specifically for:
[0144] The system's application programming interface (API) is used to obtain desktop handles for multiple monitors.
[0145] Capture desktop screenshots from multiple monitors using the desktop window manager's application programming interface and desktop handles, and map the desktop screenshots to the target rendering window via the desktop window manager's application programming interface.
[0146] In one possible implementation, the interception module 603 is specifically used for:
[0147] Obtain the capture area sent by the application's upper layer;
[0148] The image data of the target rendering window corresponding to the captured area is extracted and sent to the upper layer of the application for sharing.
[0149] The window sharing device for multiple monitors provided in this application responds to host operation, displays the host screen on multiple target monitors connected to the host and in an open state, and displays multiple currently running first windows on the host screen. Responding to sharing instructions for the multiple first windows, it traverses the multiple first windows, selects a target window to be shared from the multiple first windows, maps the target window to a target rendering window, and captures and shares the image data of the target rendering window, thereby achieving target window sharing. This multi-monitor window sharing device, by responding to sharing instructions for multiple first windows, traversing the multiple first windows, selecting a target window to be shared, mapping it to a target rendering window, and capturing and sharing the image data of the target rendering window, can share windows across multiple monitors. Furthermore, it can filter windows, i.e., freely schedule shared windows, improving the flexibility of shared window sharing and thus improving sharing efficiency.
[0150] like Figure 7 As shown in the embodiment of this application, an electronic device 700 includes a processor 701, a memory 702, and a bus. The memory 702 stores machine-readable instructions executable by the processor 701. When the electronic device is running, the processor 701 communicates with the memory 702 via the bus, and the processor 701 executes the machine-readable instructions to perform the steps of the window sharing method in a multi-monitor screen as described above.
[0151] Specifically, the memory 702 and processor 701 mentioned above can be general-purpose memory and processor, without any specific limitations. When the processor 701 runs the computer program stored in the memory 702, it can execute the above-mentioned method for sharing windows in a multi-monitor screen.
[0152] Corresponding to the above-described method for sharing windows in a multi-monitor screen, this application embodiment also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the above-described method for sharing windows in a multi-monitor screen.
[0153] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the method embodiments, and will not be repeated here. In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some communication interfaces; the indirect coupling or communication connection of devices or modules can be electrical, mechanical, or other forms.
[0154] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0155] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0156] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the deployment methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0157] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for sharing windows across multiple monitor screens, characterized in that, Applied to a host, the method includes: In response to the host's operation, the host screen is displayed on multiple target displays connected to the host and in an open state, and multiple currently running first windows are displayed on the host screen; at least one first window is displayed on each target display; In response to a sharing instruction for the plurality of first windows, the plurality of first windows are traversed, and a target window to be shared is selected from the plurality of first windows; wherein, while traversing the plurality of first windows, the window handles of the plurality of first windows are stored in a specified shared storage object, and after the target window is determined, the window handles of the second windows that need to be filtered, other than the target window, are deleted from the shared storage object. The target window is mapped to the target rendering window, and the image data of the target rendering window is captured and shared to achieve the sharing of the target window.
2. The sharing method according to claim 1, characterized in that, The response to the sharing instruction for the plurality of first windows involves traversing the plurality of first windows and selecting the target window to be shared from the plurality of first windows, including: In response to a first selection instruction for the plurality of first windows, a target region is defined on the target rendering window, and the target region is divided into a plurality of sub-regions according to a first number of the plurality of first windows, and the sub-region corresponding to each first window is determined. Iterate through the multiple first windows and display the first window corresponding to each sub-region in each sub-region; In response to a second selection instruction triggered by the selection box mapping of each sub-region through the box selection operation, a target window to be shared is selected from the first window corresponding to each sub-region.
3. The sharing method according to claim 1, characterized in that, The response to the sharing instruction for the plurality of first windows involves traversing the plurality of first windows and selecting the target window to be shared from the plurality of first windows, including: In response to a first selection instruction for the plurality of first windows, a target region is defined on the target rendering window, and the target region is divided into a plurality of sub-regions according to a second number of the plurality of target displays, and a sub-region corresponding to each of the target displays is determined; The first window displayed on each of the target displays is traversed, and the first window of the target display corresponding to each sub-region is displayed in each sub-region; wherein each sub-region and each first window has a selection identifier; In response to a third selection instruction that selects an identifier for each sub-region or each first window, a target window to be shared is selected from the first window of each sub-region.
4. The sharing method according to claim 1, characterized in that, Before responding to a sharing instruction for the plurality of first windows, traversing the plurality of first windows, and selecting a target window to be shared from the plurality of first windows, the method further includes: The width and height parameters of the target rendering window are determined based on the width and height parameters and scaling ratio of each monitor; The target rendering window is created based on its width and height parameters; Capture desktop screenshots from multiple monitors and map the desktop screenshots onto the target rendering window.
5. The sharing method according to claim 4, characterized in that, The process of determining the width and height parameters of the target rendering window based on the width and height parameters and scaling ratio of each display includes: Obtain the width, height, and scaling ratio for each monitor; The width, height, and scaling parameters of each monitor are combined using virtual desktops to obtain the width and height parameters of the target rendering window.
6. The sharing method according to claim 4, characterized in that, The step of acquiring desktop screenshots from multiple monitors and mapping the desktop screenshots to the target rendering window includes: The desktop handles of the multiple displays are obtained based on the system's application programming interface; The desktop screenshots of the multiple displays are obtained through the application programming interface of the desktop window manager and the desktop handle, and the desktop screenshots are mapped to the target rendering window through the application programming interface of the desktop window manager.
7. The sharing method according to claim 1, characterized in that, The step of capturing and sharing image data of the target rendering window to achieve the sharing of the target window includes: Obtain the capture area sent by the application's upper layer; The image data of the target rendering window corresponding to the captured area is extracted and sent to the upper layer of the application for sharing.
8. A window sharing device in a multi-monitor screen, characterized in that, The device includes: The display module is used to respond to host operation, display the host screen on multiple target displays connected to the host that are in an open state, and display multiple currently running first windows on the host screen; at least one first window is displayed on each target display; A selection module is used to respond to a sharing instruction for the plurality of first windows, traverse the plurality of first windows, and select a target window to be shared from the plurality of first windows; wherein, when traversing the plurality of first windows, the window handles of the plurality of first windows are stored in a specified shared storage object, and after the target window is determined, the window handles of the second windows that need to be filtered, other than the target window, are deleted from the shared storage object. The capture module is used to map the target window to a target rendering window and capture the image data of the target rendering window for sharing, so as to realize the sharing of the target window.
9. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and the processor communicates with the memory via the bus when the electronic device is running, and the machine-readable instructions, when executed by the processor, perform the steps of the method for sharing windows in a multi-monitor screen as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the method for sharing windows in a multi-monitor screen as described in any one of claims 1 to 7.