Java Window Control Identification via Position Interception
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods, such as Microsoft's Spy++ and API-based programs, fail to effectively identify control information on Java windows in a Windows operating system, as Java window controls are lightweight and do not have window handles, making it difficult to recognize them.
Innovation Solution
A method and device that acquire attribute information of all controls in a Java window, including position and type information, to determine the target control based on the current mouse cursor position, and display the target control with its attributes, using draw primitives and interception codes within the Java process.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If Microsoft's Spy++ or API-based programs are used to identify window controls, then Windows heavyweight controls can be accurately recognized, but Java lightweight controls cannot be identified
Solution Approach 1:
The patent introduces an intermediary component that bridges the gap between Windows control identification mechanisms and Java lightweight controls. By intercepting draw primitives and message events at the Java process level, the system translates Java's lightweight control events into a format that can be identified and analyzed, effectively mediating between the Windows API framework and Java's proprietary control system.
Solution Approach 2:
The patent replaces the traditional Windows API-based mechanical identification system with a Java-specific identification mechanism. Instead of relying on Windows window handles and control structures, the system substitutes a new approach that intercepts Java's draw primitives and message events directly from the Java process, thereby replacing the incompatible mechanical system with one that natively supports Java lightweight controls.
2Adaptability or versatility
If Java lightweight controls are used instead of Windows heavyweight controls, then Java program functionality is maintained, but control identification becomes difficult
Solution Approach 1:
The patent applies preliminary action by intercepting and capturing draw primitives and control attribute information before the controls are fully rendered or before user interactions occur. By setting up event interception mechanisms in advance within the Java process, the system proactively captures control information as it is being created or modified, making subsequent detection and identification easier without requiring changes to the Java controls themselves.
Solution Approach 2:
The patent implements feedback by continuously monitoring Java message events and draw primitives, then using this information to identify and track control elements. The system feeds back the intercepted control information into an identification framework that can then query and analyze control attributes, creating a closed-loop system where control detection continuously improves based on real-time feedback from the Java process.
Data Source
Figure 1~2
Figure 3
AI summary
Provided are a method and device for identifying a java window control. The method includes: acquiring attribute information of all controls in a current java window, herein the attribute information of the controls includes position information of the controls; acquiring position information of current location; and determining a target control of the current location according to the position information of the current location and the position information of all controls.