java_attach_window
Bind to a chosen Java window by hwnd or title and return a session ID for follow-up accessibility inspections and controls.
Instructions
Bind to one Java window and return a session id for later calls.
Use this after java_list_windows, once you know which window to drive. Give either
an exact hwnd or a title; a title may be an fnmatch pattern
("*Report*") exactly as pyjab matches it. Pass hwnd when several windows
share a title pattern.
Binding is also what arms Java Access Bridge for this server: pyjab loads the DLL, hooks the events and registers the JAB prototypes on the thread doing the binding, so the first attach is slower than the later ones.
This never modifies, restarts or injects into the application, and it does not own the process: the application keeps running whatever happens to this session.
Args:
title: Window title, matched with fnmatch. Ignored when hwnd is given.
hwnd: Window handle from java_list_windows. Takes precedence over title.
Returns: A session id, and the window it is bound to. Pass the session id to java_snapshot.
Errors:
is_error when the window cannot be bound, naming what was tried. A window
that is not a Java window, or a title that never appears, is the usual reason;
java_list_windows shows what JAB can see.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "java_attach_window"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hwnd | No | ||
| title | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |