Input method content display method and device, electronic equipment and storage medium

By using interception processing functions in compatible applications to obtain and send input information, the problem of cross-process windows being unable to receive input method messages due to imperfect COM implementation in compatible applications is resolved, thus improving the user experience.

CN121979595APending Publication Date: 2026-05-05ZHONGKE FANGDE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHONGKE FANGDE SOFTWARE CO LTD
Filing Date
2025-12-10
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

Due to incomplete COM implementation in compatible applications, cross-process windows cannot properly receive specific input method messages, affecting user experience.

Method used

By using the interception processing function of a compatible application to obtain input information when a text input operation of the target input method type is detected, and then sending it to a child window for display, the original COM interface transmission method is replaced.

Benefits of technology

The issue of cross-process windows failing to display input information of the target input method type has been resolved, improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121979595A_ABST
    Figure CN121979595A_ABST
Patent Text Reader

Abstract

The invention provides an input method content display method and device, electronic equipment and a computer readable storage medium, and the method comprises the steps: running a target application program of a second operating system based on a compatible application program installed in user equipment; the target application program comprises a main window and a sub-window; when a text input operation of a target input method type is detected and it is determined that processes to which the child window and the main window belong are different, input information of the text input operation is obtained through an interception processing function compatible with an application program; and sending the input information to the child window for display through the interception processing function. According to the method, the problem that the cross-process window cannot input information of the target input method type in a compatible application scene is solved, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, electronic device, and computer-readable storage medium for displaying input method content. Background Technology

[0002] An application can perform corresponding functions through the interaction of multiple application windows. However, there are cases where the multiple windows belong to different processes. For example, if the application loads window B through ActiveX (an independent process based on the Component Object Model (COM)), then window B belongs to a different process than the application's main window A.

[0003] Currently, the first operating system can provide compatible applications, and applications from the second operating system can run on user devices running the first operating system, thus achieving cross-system compatibility. In this scenario, the user can use an input method control to transmit input to window B for display.

[0004] However, in the current solution, due to the imperfect implementation of COM in the compatible application, window B cannot receive certain messages properly, resulting in incomplete input method functionality and affecting user experience. Summary of the Invention

[0005] This application provides a method and apparatus for displaying input method content to solve the problem in the prior art where the incomplete implementation of COM by compatible applications causes window B to be unable to receive certain messages normally, resulting in incomplete input method functions and affecting user experience.

[0006] In a first aspect, embodiments of this application provide a method for displaying input method content, applied to a user device of a first operating system, the method comprising: A target application running a second operating system is based on a compatible application installed on the user device; the target application includes a main window and sub-windows. When a text input operation of the target input method type is detected, and it is determined that the child window and the main window belong to different processes, the input information of the text input operation is obtained through the interception processing function of the compatible application; The input information is sent to the child window for display via the interception processing function.

[0007] Secondly, embodiments of this application provide a display device for input method content, applied to a user device of a first operating system, the device comprising: The runtime module is used to run a target application of a second operating system based on a compatible application installed on the user device; the target application includes a main window and sub-windows. The acquisition module is used to acquire the input information of the text input operation through the interception processing function of the compatible application when a text input operation of the target input method type is detected and it is determined that the child window and the main window belong to different processes. The display module is used to send the input information to the sub-window for display through the interception processing function.

[0008] Thirdly, embodiments of this application also provide an electronic device, including a processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the method of the first aspect.

[0009] Fourthly, embodiments of this application also provide a computer-readable storage medium that, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to perform the method of the first aspect.

[0010] This application embodiment allows the installation of a compatible application on a user device running a first operating system. The function of this compatible application is to run a target application from a second operating system on the same user device. When a text input operation of the target input method type is detected, and it is determined that the child window and the main window belong to different processes, the input information of the text input operation can be obtained through the interception processing function of the compatible application, and then sent to the child window for display. The interception processing function is a function specifically developed for the above scenario. It is triggered when the scenario is detected, and when triggered, it can intercept input information of the target input method type and accurately send the input information to the child window for display. By using the forwarding method of the interception processing function, the problem of cross-process windows being unable to receive input information of the target input method type in the compatible application scenario is directly solved, improving the user experience.

[0011] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0012] Figure 1 This is an implementation scenario diagram provided in an embodiment of this application; Figure 2This is a flowchart illustrating the steps of a method for displaying input method content according to an embodiment of this application. Figure 3 This is a flowchart illustrating the specific steps of a method for displaying input method content provided in an embodiment of this application; Figure 4 This is a flowchart illustrating the implementation of an input method content display method provided in an embodiment of this application; Figure 5 This is a block diagram of an input method content display device provided in an embodiment of this application; Figure 6 This is a block diagram of an apparatus according to this application; Figure 7 This is a schematic diagram of the server structure in some embodiments of this application. Detailed Implementation

[0013] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0014] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and are not limited in number; for example, a first object can be one or more. Furthermore, the term "and / or" in the specification and claims is used to describe the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. In the embodiments of this application, the term "multiple" refers to two or more, and other quantifiers are similar.

[0015] Reference Figure 1 , Figure 1 This is an implementation scenario diagram provided in an embodiment of this application, including: user equipment 10.

[0016] The user equipment 10 runs a first operating system, and compatible applications can run in the first operating system; the compatible applications are used to run target applications of the second operating system in the user equipment 10.

[0017] In this embodiment, the compatible application is a compatibility layer that enables applications of a second operating system (such as Windows) to run on multiple first operating systems (such as Linux, Mac OS, Berkeley Software Distribution (BSD), etc.). Preferably, the first operating system is Linux and the second operating system is Windows.

[0018] In related technologies, a target application can achieve corresponding functions through the interaction of multiple application windows. However, these windows may belong to different processes. Users can use an input method control to transmit input content to a child window B (whose process differs from the target application's main window A) via COM. However, due to imperfect COM implementation in compatible applications, window B may fail to receive certain messages correctly, resulting in incomplete input method functionality and impacting user experience.

[0019] For example, suppose the target application creates a child window B through ActiveX. The process to which the child window B belongs is different from the process to which the main window A of the target application belongs. When the user enters Chinese content in the child window B through the input method control, the Chinese message of the input method will be received by the main window A first. However, due to the imperfect implementation of COM in the compatible application, the Chinese message is correctly passed to the child window B by the main window A through the COM interface, causing the child window B to be unable to display the Chinese message.

[0020] To address the aforementioned issues, this application embodiment can, when detecting a text input operation of the target input method type and determining that the child window and the main window belong to different processes, intercept and process the text input operation using a compatible application's interception function. This interception function is a function specifically developed for the aforementioned scenario, triggered when the scenario is detected. Upon triggering, the interception function intercepts input information of the target input method type and accurately sends it to the child window for display. By using the forwarding method of the interception function, the problem of cross-process windows failing to display input information of the target input method type in compatible application scenarios is directly solved, improving the user experience.

[0021] Figure 2 This is a flowchart illustrating the steps of a method for displaying input method content, provided in an embodiment of this application. It is applied to a user device running a first operating system, such as... Figure 2 As shown, the method may include: Step 101: Based on the compatible application installed on the user device, run the target application of the second operating system; the target application includes a main window and sub-windows.

[0022] In this application embodiment, the compatible application is a compatibility layer for applications that can run a second operating system (such as Windows) on multiple first operating systems (such as Linux, Mac OS, Berkeley Software Distribution (BSD), etc.).

[0023] Specifically, compatible applications can be Wine (Wine Is Not an Emulator) applications, which can run Windows applications on various primary operating systems (such as Linux, macOS, and BSD). Instead of mimicking internal Windows logic like a virtual machine or emulator, Wine translates Windows interface calls into dynamic primary operating system calls, eliminating performance and memory overhead, thus cleanly assembling and running Windows applications on primary operating system devices.

[0024] Furthermore, a window is a front-end concept in computer programming; it is a rectangular interface element on the screen with its own drawing area that can receive user input (such as mouse and keyboard input). Windows all have the following characteristics: Handle (HWND): A unique identifier assigned to each window by the operating system; all operations are based on the handle.

[0025] Message queue: Each window has its own dedicated message queue, which is used to receive various event notifications dispatched by the system (such as being clicked or having text entered).

[0026] Z-Order: Windows have a hierarchical relationship of overlapping and parent / child / sibling relationships. Windows can be nested to form a tree structure.

[0027] In this embodiment, the main window and the child window are two windows with a parent-child relationship, with the main window being the parent window of the child window. The main window is the container window that carries the main content of the target application and hosts other windows. The child window is a special window that is visually embedded within the client area of ​​the main window, but can be created and managed by an independent process.

[0028] Step 102: When a text input operation of the target input method type is detected, and it is determined that the child window and the main window belong to different processes, the input information of the text input operation is obtained through the interception processing function of the compatible application.

[0029] Step 103: Send the input information to the sub-window for display through the interception processing function.

[0030] In related technologies, under a second operating system, for information input scenarios based on child windows, the text input information is first received by the main window and then transmitted to the child window for display via a COM interface. However, when the child window and the main window belong to different processes, due to cross-process COM forwarding and defects in the implementation of cross-process COM forwarding in compatible applications, the input information cannot be received by the child window. Therefore, there are two reasons why the child window cannot receive the input information: 1. The child window and the main window belong to different processes; 2. The input method type corresponding to the text input operation is a specific target input method type (e.g., a Chinese input method).

[0031] In this application embodiment, in order to solve the above problems, the text input operation that generates the target input method type can be accurately identified first, and the scenario where the child window and the main window belong to different processes can be determined. Then, the input information transmission in the scenario is improved in a targeted manner.

[0032] Specifically, when a text input operation of the target input method type is detected, and it is determined that the child window and the main window belong to different processes, this embodiment of the application can abandon the original COM interface transmission method and adopt an interception processing function independently implemented in a compatible application to first intercept and obtain the input information of the text input operation, and then send the input information to the child window for display through the interception processing function.

[0033] The interception handling function is a specific function developed for the above scenario. It is triggered when the scenario is detected. When triggered, the interception handling function can intercept input information of the target input method type and accurately send the input information to the child window for display based on the handle of the child window. By forwarding the input information through the interception handling function, the problem of cross-process windows failing to display input information of the target input method type in compatible application scenarios is directly solved.

[0034] It should be noted that if the input method type corresponding to the generated text input operation is not the target input method type, or if the child window and the main window belong to the same process, the original COM interface can be used to pass the input information from the main window to the child window for display. This allows the solution to trigger the interception processing function only when a specific scenario is detected (a text input operation of the target input method type, and it is determined that the child window and the main window belong to different processes), without affecting the normal operation of other scenarios (such as a scenario where the input method type corresponding to the generated text input operation is not the target input method type, or a scenario where the child window and the main window belong to the same process).

[0035] In summary, this application embodiment allows the installation of a compatible application on a user device running a first operating system. The function of this compatible application is to run a target application from a second operating system on the user device running the first operating system. When a text input operation of the target input method type is detected, and it is determined that the child window and the main window belong to different processes, the input information of the text input operation can be obtained through the interception processing function of the compatible application, and then sent to the child window for display. The interception processing function is a function specifically developed for the above scenario. It is triggered when the above scenario is detected, and when triggered, it can intercept the input information of the target input method type and accurately send the input information to the child window for display. By using the forwarding method of the interception processing function, the problem of cross-process windows being unable to display input information of the target input method type in the compatible application scenario is directly solved, improving the user experience.

[0036] Figure 3 This is a flowchart illustrating the steps of a method for displaying input method content, provided in an embodiment of this application, and applied to a server-side application, such as... Figure 3 As shown, the method may include: Step 201: Based on the compatible application installed on the user device, run the target application of the second operating system; the target application includes a main window and child windows.

[0037] For details, please refer to step 101 above; it will not be repeated here.

[0038] Step 202: When the focus information corresponding to the child window is detected in the preset shared memory area, and it is determined that the child window is of the target window type, it is determined that the child window and the main window belong to different processes.

[0039] The focus information is generated when the child window is clicked; the target window type is used to indicate that the child window and the main window belong to different processes.

[0040] This document uses an example to illustrate the following processes in sequence: window activation and focus information transmission, input method context association, cursor management, keyboard message processing, Chinese input method processing, character display, and error handling. Regarding point 1, the transmission of window activation and focus information: Step 1.1: When a user clicks a window or activates it via code (such as ShowWindow or SetActiveWindow), the ancestor window (main window) receives a WM_ACTIVATE message. The window then activates with a WM_ACTIVATE message. After activation, the system sends a WM_ACTIVATE message to the top-level window (where the wParam field in the WM_ACTIVATE message indicates the activation status). The window updates its own interface based on the status (e.g., highlighting the title bar).

[0041] Step 1.2: Execute SetFocus to pass focus down the hierarchy: SetFocus sets the focus, and the main window passes the focus down to the child windows level by level; the original focus window receives WM_KILLFOCUS. The new target window and its parent chain receive WM_SETFOCUS level by level.

[0042] Regarding point 2, input method context association: Step 2.1: When the system determines that an input control is available (the control must be an editable control or a custom window that supports input), the input method context is associated using `ImmAssociateContext(hWnd, hIMC)`. Here, `hIMC` is the input method context handle (obtained via `ImmGetContext`). If `hIMC = NULL`, the input method is disabled (only `WM_CHAR` is processed). The purpose of associating the input method context is to establish a dedicated, state-preserving communication channel between the input method and the specific window.

[0043] Regarding point 3, cursor management: Step 3.1: Create a tooltip cursor. The cursor width / height is usually matched to the font size. The DestroyCaret function needs to be called when the control is destroyed.

[0044] Step 3.2: Cursor display control. Use the ShowCaret function during input (cursor blinking is system-managed). Use the HideCaret function when the cursor loses focus.

[0045] Regarding point 4, keyboard message handling: Step 4.1: Receive the original key press messages. The message order is as follows: WM_KEYDOWN→WM_CHAR→WM_KEYUP.

[0046] Step 4.2: Character message conversion: Determine if it is character input. If so, convert it to a WM_CHAR message and display the character in the control; otherwise, handle other key press logic. The TranslateMessage function is used to convert WM_KEYDOWN (keyboard message) to WM_CHAR (Western characters). When inputting Chinese characters, WM_KEYDOWN is first intercepted by the input method.

[0047] Regarding point 5, Chinese input method processing: Step 5.1: Input method combination state is activated. Determine if it is in Chinese input method state. If so, trigger messages such as WM_IME_COMPOSITION (used to update combined characters in real time (such as highlighting pinyin candidate words)) and WM_IME_STARTCOMPOSITION (input method starts combined input (such as inputting the first letter of pinyin)). The input method combination window displays candidate words.

[0048] Step 5.2: The user selects candidate words, and the final character is submitted to the control.

[0049] Regarding character display (item 6): Step 6.1: Insert characters into the control. This can be done by calling the Edit_ReplaceSel function or by directly modifying the text buffer.

[0050] Step 6.2: Update cursor position. Specifically, the string width is calculated using the GetTextExtentPoint32 function, and the cursor is moved to the end.

[0051] Regarding point 7, error handling: Step 7.1: Input method context error, you can revert to English input mode.

[0052] The above process illustrates the complete input method input to the window frame in a single window in related technologies, which is passed from the parent window to the child window level by level. However, when the child window is a child process loaded in COM mode, the transmission is lost and it is impossible to input text in the child window.

[0053] As mentioned earlier, there are two main reasons why input information cannot be received by the child window: 1. The child window and the main window belong to different processes. 2. The input method type corresponding to the text input operation is a specific target input method type (e.g., a Chinese input method).

[0054] The primary factor in reason 1 is that in Windows, message forwarding across processes (such as ActiveX controls) relies on a complex COM remote procedure call mechanism. As an emulator, the compatible application's implementation of this mechanism is imperfect. During cross-process forwarding, input information from specific input methods (such as Chinese characters) may be lost or fail to be correctly reconstructed at the compatible application's COM / ROC layer due to issues such as parameter serialization and context passing, resulting in the child window not receiving the message at all.

[0055] In this embodiment of the application, when a text input operation of the target input method type is detected, and it is determined that the child window and the main window belong to different processes, this embodiment of the application can abandon the original COM interface transmission method, and instead adopt an interception processing function independently implemented in the compatible application to first intercept and obtain the input information of the text input operation, and then send the input information to the child window for display through the interception processing function, thereby solving the problem of failure to transmit information using the original COM interface.

[0056] Specifically, in this embodiment, the presence of focus information for a child window can be detected within a preset shared memory area. If the focus information exists and the child window is determined to be of the target window type, it can be determined that the child window and the main window belong to different processes. This is because this embodiment allocates a shared memory area accessible to all relevant processes. The shared memory operates by recording the focus information of windows clicked by the user; this focus information reflects the click operation performed on the window. Additionally, the shared memory also records the window's class name, which reflects the window type. The window type includes the target window type (such as the SALTMP class), which indicates that the child window belongs to a different process than the main window. In other words, if the focus information of the current child window exists in the shared memory and the child window is of the target window type, the system can determine that a child window has been clicked by the user and belongs to a different process than the main window.

[0057] Additionally, if the user's focus moves to another regular window, the focus information record of the child window will be cleared or ignored in shared memory, indicating that no special processing is required.

[0058] Step 203: When a text input operation including Chinese content is detected, determine that the text input operation is the target input method type.

[0059] As mentioned earlier, there are two main reasons why input information cannot be received by the child window: 1. The child window and the main window belong to different processes. 2. The input method type corresponding to the text input operation is a specific target input method type (e.g., a Chinese input method).

[0060] The fundamental reason for reason 2 lies in the fact that the input process for Chinese input methods is far more complex than that for English input. It's not a direct "key-character" correspondence, but rather a stateful dialogue process requiring deep application involvement. English input follows a "simple path": the system directly translates keystrokes into WM_CHAR messages and sends them to the window. Chinese input, however, follows a "complex path," requiring a "combined state" containing multiple special input method messages (WM_IME_*). This "combined state" heavily relies on correct and continuous message interaction between the application (window) and the input method engine to display candidate windows, highlight pinyin, and so on.

[0061] Because Chinese input methods have complex processes and unique message types, any signal attenuation or packet loss in the message transmission chain can cause the entire interaction to crash, making input impossible. English input, on the other hand, has a simpler and more direct process, requiring much lower reliability and is often unaffected.

[0062] Specifically, in this embodiment of the application, when a text input operation including Chinese content is detected, the text input operation can be determined to be the target input method type. For example, the status of the input method can be queried, and when the status of the input method is found to be XLookupChars, the text input operation is determined to be a Chinese input method type.

[0063] Step 204: When a text input operation of the target input method type is detected, and it is determined that the child window and the main window belong to different processes, the input information of the text input operation is obtained through the interception processing function of the compatible application.

[0064] For details, please refer to step 102 above; it will not be repeated here.

[0065] Step 205: Using the interception processing function, the input information is sent to the child window for display based on the focus information of the child window.

[0066] In this embodiment, by detecting whether focus information corresponding to a child window exists in a preset shared memory area, and when the focus information exists and the child window is determined to be of the target window type, it can be determined that the processes to which the child window and the main window belong are different. This is because this embodiment allocates a shared memory area that can be accessed by all related processes. The operating mechanism of this shared memory is to record the focus information of the window that has been clicked by the user. The focus information reflects the click operation on the window and can be used to locate the child window that has been clicked by the user. This allows the interception processing function to accurately send the input information to the child window for display based on the focus information of the child window.

[0067] Optionally, the focus information includes the handle of the child window; the handle is used to indicate the address of the child window; step 205 may specifically include: Sub-step 2051: Based on the instruction of the handle of the sub-window, call the NtUserMessageCall interface through the interception processing function to send the input information to the sub-window for display.

[0068] In this embodiment, after intercepting input information that should have been handled by COM errors, the interception processing function can call the NtUserMessageCall interface (manual forwarding interface) to forward the input information. However, the NtUserMessageCall interface needs to know to whom the input information needs to be forwarded. The focus information in shared memory, including the handle of the child window, can be used to indicate the address of the child window. Therefore, the NtUserMessageCall interface can send the input information to the child window for display based on the indication of the child window handle, thereby realizing cross-process manual forwarding of input messages of the target input method type.

[0069] Optionally, the method may further include: Step 206: In response to a click operation on a window in the target application, obtain the focus information of the window that received the click operation.

[0070] Step 207: Record the focus information of the window that received the click operation in the shared memory.

[0071] In this embodiment of the application, for steps 206-207, a shared memory is allocated as a memory area that can be accessed by all related processes. The operating mechanism of this shared memory is to record the focus information of the window that is clicked by the user. The focus information reflects the click operation of the window.

[0072] Specifically, when a user clicks on a child window (the new focus window), such as by clicking a window with the mouse or switching windows using the keyboard (e.g., the Tab key), this physical action is captured by the operating system. The system first sends a WM_KILLFOCUS (loss of focus) message to the original focus window (the window that was the focus before the click), and then sends a WM_SETFOCUS (gain focus) message to the new focus window. This WM_SETFOCUS message is the formal event notification of focus information, and it is placed in the message queue. Furthermore, the system can determine whether the type of the new focus window is the target window type (e.g., SALTMP). If so, it uses a hook technique (e.g., setting a global WM_SETFOCUS message hook) to record the focus information of the new focus window in the message queue in shared memory. Subsequent processes only need to read the handle from this focus information in shared memory to determine which window the user is currently operating on and which requires special processing of input messages from the target input method type, thus calling the NtUserMessageCall interface for precise message forwarding.

[0073] Specifically, a pointer to this pre-created shared memory can be obtained through system APIs (such as CreateFileMapping / OpenFileMapping), thereby opening the shared memory. Then, hWndFocused (the handle of the focused window), the process ID, and a flag "bManualManage=TRUE" can be written to the shared memory. Furthermore, during the write operation, a mutex or critical section can be used to ensure that the data is not corrupted by simultaneous read and write operations in a multi-threaded / multi-process environment.

[0074] Optionally, prior to step 204, the method may further include: Step 208: Bind the input context of the child window to the input context of the main window.

[0075] In this embodiment of the application, before obtaining the input information of the text input operation through the interception processing function of the compatible application, the input context of the child window can be bound to the input context of the main window.

[0076] In Windows, windows in different processes typically have independent input contexts. This can cause the cursor to blink in the window of process B when clicking in the window of process A. Furthermore, some focus and input-related operations may not produce the expected results when crossing processes. This embodiment of the application binds the input context of the child window to the input context of the main window, temporarily merging the input queues of two different threads, making them appear to belong to the same thread, thereby avoiding the aforementioned problems.

[0077] To achieve thread binding, this embodiment first obtains the IDs of the threads containing the main window A and the child window B using the GetWindowThreadProcessId function. Then, it calls the NtUserAttachThreadInput(threadB, threadA, TRUE) function, which appends the input from the child window B's thread to the input queue of the main window A's thread. Once the two threads are bound, the system modifies the input queue pointer of thread B to point to the input queue of thread A. Afterward, all keyboard and mouse messages sent to thread B will first enter thread A's message queue, and then the system will correctly forward them to the window with focus in thread B. Furthermore, during the binding period, calls from thread A will return the focused window of A, and calls from thread B will also return the focused window of A, thus maintaining consistency.

[0078] Additionally, after sending the input information to the child window for display via the interception processing function, the NtUserDetachThreadInput function can be called to separate the bound input method context and restore the original processing logic of the compatible application.

[0079] Based on step 208, step 204 may specifically include: Sub-step 2041: Detect the window position of the sub-window.

[0080] Sub-step 2042: If it is determined that the sub-window is in the top-level window position, obtain the input information of the text input operation.

[0081] In this embodiment of the application, before obtaining the input information of the text input operation through the interception processing function of the compatible application in sub-steps 2041-2042, the window position of the child window can be monitored to ensure that the child window is in the top-level window position, so that the input information of the text input operation can be obtained and manually forwarded when the child window is in the top-level window position.

[0082] In this context, "child window at the top level" means that the child window is the window currently being interacted with by the user. That is, the top-level window is the window the user is currently interacting with. Without monitoring window positions, if the user switches to another program's window (such as a browser), the system will attempt to intercept input messages and forward them to the original child window, leading to system inconsistencies (when a user switches windows, the focus changes, and input messages should be sent to the newly switched window).

[0083] Specifically, in this embodiment of the application, the presence of a child window can be detected in real time by monitoring the Z-Order (Z-Order refers to the order in which windows are stacked on the screen, with the topmost window being the one the user is interacting with).

[0084] Optionally, the method may further include: Step 209: When a text input operation of a non-target input method type is detected, or when it is determined that the sub-window and the main window belong to the same process, the input information of the text input operation is obtained through the compatible application, and the input information is sent to the sub-window for display.

[0085] Step 210: When a text input operation of a non-target input method type is detected, and it is determined that the child window and the main window belong to different processes, the input information is obtained through the COM interface of the compatible application, and the input information is sent to the child window for display.

[0086] In this embodiment of the application, for steps 209-210, if the input method type corresponding to the generated text input operation is not the target input method type, or if the child window and the main window belong to the same process, the input information of the text input operation can be obtained through the compatible application, and the compatible application can directly send the input information to the child window for display.

[0087] Furthermore, the compatible application internally implements a COM interface for cross-process communication and interaction with the second operating system. If the input method type corresponding to the generated text input operation is not the target input method type, and the child window and the main window belong to different processes, the input information of the text input operation can be obtained through the compatible application. The input information is then passed to the child window for display via the COM interface using the built-in COM interface of the compatible application for cross-process transmission. This ensures that the solution in this application only triggers the interception processing function when a specific scenario is detected (a text input operation of the target input method type, and it is determined that the child window and the main window belong to different processes), without affecting the normal operation of other scenarios (such as a scenario where the input method type corresponding to the generated text input operation is not the target input method type, and the child window and the main window belong to the same process; or a scenario where the input method type corresponding to the generated text input operation is not the target input method type, and the child window and the main window belong to different processes).

[0088] The process of obtaining the input information through the COM interface of the compatible application and sending the input information to the child window for display can refer to the process described in step 202 of the above embodiment, and will not be repeated here.

[0089] In summary, referring to Figure 4 The diagram illustrates a flowchart of an implementation method for displaying input method content according to an embodiment of this application. Step S1: Detect Chinese input method operation.

[0090] If no input is detected, proceed to step S2, which involves processing English input; and then proceed to step S3, which involves directly processing English input.

[0091] If detected, proceed to step S4: detect the window state of the child window.

[0092] Step S5: Determine if a child window of the target window type exists. If not, proceed to step S6: Enter the standard process for compatible applications; and execute step S7: Perform input method or character processing according to the standard process. The standard processing flow can be implemented as described in steps 209-210.

[0093] If so, proceed to step S8 and start manual focus management.

[0094] In this step S5, the sub-window's window type can be determined by checking if it is of the SALTMP class. If the sub-window's window type is SALTMP, it is determined to be the target window type; otherwise, it is determined not to be the target window type. Specifically, a sub-window of the target window type is defined in this embodiment as a sub-window whose process is different from that of the main window.

[0095] Step S9: Record the focus information of the child window in shared memory.

[0096] In this embodiment of the application, a shared memory area is allocated as a memory region that can be accessed by all related processes. This shared memory is used to record the focus information of the window that has been clicked by the user. The focus information reflects the click operation that the window has received.

[0097] Step S10: Bind the input method context of the main window and the child window.

[0098] The binding of the input method context can be found in the relevant description of step 208.

[0099] Step S11: Monitor the window position status of the child window.

[0100] Step S12: Determine if the child window is at the top level.

[0101] For monitoring the window position status of child windows and determining whether a child window is on the top layer, please refer to the relevant descriptions in steps 2041-2042.

[0102] If not, proceed to step S13, separate the input method context binding of the thread, and perform input method or character processing according to the standard procedure.

[0103] If so, proceed to step S14 and intercept the input information.

[0104] Step S15: Determine the input method type of the input information.

[0105] If it is Chinese, proceed to step S16 and forward the input method information to the sub-window.

[0106] If it is in English, proceed to step S17 and process the English input directly.

[0107] Step S18: The sub-window processes the input information.

[0108] Step S19: Update the cursor position.

[0109] In summary, this application embodiment allows the installation of a compatible application on a user device running a first operating system. The function of this compatible application is to run a target application from a second operating system on the user device running the first operating system. When a text input operation of the target input method type is detected, and it is determined that the child window and the main window belong to different processes, the input information of the text input operation can be obtained through the interception processing function of the compatible application, and then sent to the child window for display. The interception processing function is a function specifically developed for the above scenario. It is triggered when the above scenario is detected, and when triggered, it can intercept input information of the target input method type and accurately send the input information to the child window for display. By using the forwarding method of the interception processing function, the problem of cross-process windows being unable to receive input information of the target input method type in the compatible application scenario is directly solved, improving the user experience.

[0110] Figure 5 This is a block diagram of an input method content display device provided in an embodiment of this application, applied to an electronic device running a first operating system. The device includes: The running module 301 is used to run a target application of a second operating system based on a compatible application installed in the user equipment; the target application includes a main window and sub-windows; The acquisition module 302 is used to acquire the input information of the text input operation through the interception processing function of the compatible application when a text input operation of the target input method type is detected and it is determined that the sub-window and the main window belong to different processes. The display module 303 is used to send the input information to the sub-window for display through the interception processing function.

[0111] Optionally, the device further includes: The first determining module is used to detect the focus information corresponding to the child window in a preset shared memory area, and when it is determined that the child window is a target window type, it determines that the processes to which the child window and the main window belong are different. The focus information is generated when the child window is clicked; the target window type is used to indicate that the child window and the main window belong to different processes. The display module 303 includes: The sending submodule is used to send the input information to the sub-window for display based on the focus information of the sub-window through the interception processing function.

[0112] Optionally, the focus information includes a handle to the child window; the handle is used to indicate the address of the child window. The sending submodule includes: The sending unit is used to send the input information to the child window for display by calling the NtUserMessageCall interface through the interception processing function according to the instruction of the handle of the child window.

[0113] Optionally, the device further includes: The focus module is used to respond to a click operation on a window in the target application and obtain focus information of the window that receives the click operation; The recording module is used to record the focus information of the window that receives the click operation in the shared memory.

[0114] Optionally, the device further includes: The second determining module is used to determine that the text input operation is the target input method type when a text input operation including Chinese content is detected.

[0115] Optionally, the device further includes: A binding module is used to bind the input context of the child window to the input context of the main window; The acquisition module 302 includes: The detection submodule is used to detect the window position of the sub-window; The acquisition submodule is used to acquire the input information of the text input operation when it is determined that the child window is in the top-level window position.

[0116] Optionally, the device further includes: The first processing module is used to obtain the input information of the text input operation through the compatible application when a text input operation of a non-target input method type is detected, or when it is determined that the sub-window and the main window belong to the same process, and send the input information to the sub-window for display. The second processing module is used to obtain the input information through the COM interface of the compatible application and send the input information to the child window for display when a text input operation of a non-target input method type is detected and it is determined that the child window and the main window belong to different processes.

[0117] In summary, this application embodiment allows the installation of a compatible application on a user device running a first operating system. The function of this compatible application is to run a target application from a second operating system on the user device running the first operating system. When a text input operation of the target input method type is detected, and it is determined that the child window and the main window belong to different processes, the input information of the text input operation can be obtained through the interception processing function of the compatible application, and then sent to the child window for display. The interception processing function is a function specifically developed for the above scenario. It is triggered when the above scenario is detected, and when triggered, it can intercept input information of the target input method type and accurately send the input information to the child window for display. By using the forwarding method of the interception processing function, the problem of cross-process windows being unable to receive input information of the target input method type in the compatible application scenario is directly solved, improving the user experience.

[0118] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0119] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0120] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0121] This application provides an input method content display device, including a memory and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors, and the one or more programs include methods for performing the methods described in one or more of the above embodiments.

[0122] Figure 6 This is a block diagram illustrating an input method content display device 800 according to an exemplary embodiment. For example, device 800 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.

[0123] Reference Figure 6 The device 800 may include one or more of the following components: a processing component 802, a memory 804, a power supply component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.

[0124] Processing component 802 typically controls the overall operation of device 800, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 802 may include one or more processors 820 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 802 may include one or more modules to facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.

[0125] Memory 804 is configured to store various types of data to support the operation of device 800. Examples of this data include instructions for any application or method operating on device 800, contact data, phonebook data, messages, pictures, videos, etc. Memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0126] Power supply component 806 provides power to various components of device 800. Power supply component 806 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to device 800.

[0127] Multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 808 includes a front-facing camera and / or a rear-facing camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0128] Audio component 810 is configured to output and / or input audio signals. For example, audio component 810 includes a microphone (MIC) configured to receive external audio signals when device 800 is in an operating mode, such as call mode, recording mode, and voice information processing mode. The received audio signals may be further stored in memory 804 or transmitted via communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.

[0129] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0130] Sensor assembly 814 includes one or more sensors for providing status assessments of various aspects of device 800. For example, sensor assembly 814 can detect the on / off state of device 800, the relative positioning of components such as the display and keypad of device 800, and can also detect changes in the position of device 800 or a component of device 800, the presence or absence of user contact with device 800, the orientation or acceleration / deceleration of device 800, and temperature changes of device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 814 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.

[0131] Communication component 816 is configured to facilitate wired or wireless communication between device 800 and other devices. Device 800 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 816 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency information processing (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0132] In an exemplary embodiment, the apparatus 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.

[0133] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, which can be executed by a processor 820 of the device 800 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0134] Figure 7 This is a schematic diagram of the server structure in some embodiments of this application. The server 1900 can vary significantly due to different configurations or performance, and may include one or more central processing units (CPUs) 1922 (e.g., one or more processors) and memory 1932, and one or more storage media 1930 (e.g., one or more mass storage devices) for storing application programs 1942 or data 1944. The memory 1932 and storage media 1930 can be temporary or persistent storage. The program stored in the storage media 1930 may include one or more modules (…). Figure 7 (Not shown), each module may include a series of instruction operations on the server. Furthermore, the central processing unit 1922 may be configured to communicate with the storage medium 1930 and execute the series of instruction operations on the storage medium 1930 on the server 1900.

[0135] The server 1900 may also include one or more power supplies 1926, one or more wired or wireless network interfaces 1950, one or more input / output interfaces 1958, one or more keyboards 1956, and / or one or more operating systems 1941, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0136] A non-transitory computer-readable storage medium, wherein instructions in the storage medium, when executed by a processor of a device (server or terminal), enable the device to perform the methods of the embodiments described above.

[0137] A non-transitory computer-readable storage medium is provided, wherein when the instructions in the storage medium are executed by the processor of a device (server or terminal), the device is able to perform the methods described in the above embodiments; therefore, further details will not be repeated here. Additionally, the beneficial effects of employing the same method will also not be repeated. For technical details not disclosed in the computer program products or computer program embodiments related to this application, please refer to the description of the method embodiments of this application.

[0138] Furthermore, it should be noted that this application also provides a computer program product or computer program, which may include computer instructions, which may be stored in a computer-readable storage medium. The processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor can execute the computer instructions to cause the computer device to perform the methods described in the above embodiments; therefore, these will not be repeated here. Additionally, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the embodiments of the computer program product or computer program involved in this application, please refer to the description of the method embodiments of this application.

[0139] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0140] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

[0141] The above description is only a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

[0142] The above provides a detailed description of the input method content display method, apparatus, electronic device, and computer-readable storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for displaying input method content, applied to a user device of a first operating system, characterized in that, The method includes: A target application running a second operating system is based on a compatible application installed on the user device; the target application includes a main window and sub-windows. When a text input operation of the target input method type is detected, and it is determined that the child window and the main window belong to different processes, the input information of the text input operation is obtained through the interception processing function of the compatible application; The input information is sent to the child window for display via the interception processing function.

2. The method for displaying input method content according to claim 1, characterized in that, The method further includes: When the focus information corresponding to the child window is detected in a preset shared memory area, and it is determined that the child window is of the target window type, it is determined that the processes to which the child window and the main window belong are different. The focus information is generated when the child window is clicked; the target window type is used to indicate that the child window and the main window belong to different processes. The step of sending the input information to the child window for display through the interception processing function includes: The interception processing function sends the input information to the child window for display based on the focus information of the child window.

3. The method for displaying input method content according to claim 2, characterized in that, The focus information includes the handle of the child window; the handle is used to indicate the address of the child window; The step of sending the input information to the child window for display based on the focus information of the child window through the interception processing function includes: Based on the pointer to the handle of the child window, the NtUserMessageCall interface is called through the interception processing function to send the input information to the child window for display.

4. The method for displaying input method content according to claim 2, characterized in that, The method further includes: In response to a click operation on a window in the target application, focus information of the window that received the click operation is obtained; The focus information of the window that received the click operation is recorded in the shared memory.

5. The method for displaying input method content according to claim 1, characterized in that, The method further includes: When a text input operation containing Chinese characters is detected, the text input operation is determined to be the target input method type.

6. The method for displaying input method content according to claim 1, characterized in that, Before obtaining the input information of the text input operation through the interception processing function of the compatible application, the method further includes: Bind the input context of the child window to the input context of the main window; The step of obtaining the input information for the text input operation includes: Detect the window position of the child window; If the child window is determined to be in the top-level window position, the input information for the text input operation is obtained.

7. The method for displaying input method content according to claim 1, characterized in that, The method further includes: When a text input operation of a non-target input method type is detected, or when it is determined that the child window and the main window belong to the same process, the input information of the text input operation is obtained through the compatible application, and the input information is sent to the child window for display. When a text input operation of a non-target input method type is detected, and it is determined that the child window and the main window belong to different processes, the input information is obtained through the COM interface of the compatible application, and the input information is sent to the child window for display.

8. A display device for input method content, applied to an electronic device running a first operating system, characterized in that, The device includes: The runtime module is used to run a target application of a second operating system based on a compatible application installed on the user device; the target application includes a main window and sub-windows. The acquisition module is used to acquire the input information of the text input operation through the interception processing function of the compatible application when a text input operation of the target input method type is detected and it is determined that the child window and the main window belong to different processes. The display module is used to send the input information to the sub-window for display through the interception processing function.

9. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device is enabled to perform the method as described in any one of claims 1 to 7.