RemoteControl.GetWindowsListAsJSON
----------------------------------

On Windows queries the list of all windows as JSON.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [RemoteControl](component_RemoteControl.md) | [11.2](newinversion112.md) | ❌ No | ✅ Yes | ❌ No | ❌ No | ❌ No |

MBS( "RemoteControl.GetWindowsListAsJSON" { ; Flags; filterClass } ) 

**MBS**( **"RemoteControl.GetWindowsListAsJSON";** /\* On Windows queries the list of all windows as JSON. \*/  
**$Flags**; /\* Optional; Pass 1 to limit to windows from current process. \*/   
**$filterClass**) /\* Optional; Filter by window class name.  
You may first query the list for all windows, lookup what target window has as class name and search only for that to reduce data.e.g. "Notepad" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Flags | Pass 1 to limit to windows from current process. |  | Optional |
| filterClass | Filter by window class name.   You may first query the list for all windows, lookup what target window has as class name and search only for that to reduce data. | "Notepad" | Optional |

### Result

Returns JSON or error.

### Description

On Windows queries the list of all windows as JSON.  
You can separate this list and pass the window ID values as number to our other [Window](component_Window.md) functions.  
Returns a JSON array with JSON objects containing Handle, Class, Title, ID, ProcessID, ThreadID, IsMyProcess, IsVisible, IsIconic, IsZoomed, Left, Top, Right, Bottom, Width, Height.  
  
IsMyProcess is true, if the window belongs to the same process as the plugin is loaded into.  
### Examples

Find Notepad window:

 MBS ( "RemoteControl.GetWindowsListAsJSON"; 0; "Notepad"; )  
<small>  
Example result:   
\[ { "Handle" : 591066 , "Class" : "Notepad" , "Title" : "Untitled - Notepad" , "ID" : "15001" , "ProcessID" : 2780 , "ThreadID" : 4764 , "IsMyProcess" : false, "IsVisible" : true, "IsIconic" : false, "IsZoomed" : false, "Left" : 799 , "Top" : 139 , "Right" : 2241 , "Bottom" : 882 , "Width" : 1442 , "Height" : 743 } \] </small>Find only Windows in FileMaker itself:

 MBS ( "RemoteControl.GetWindowsListAsJSON"; 1)  
### See also

- [RemoteControl.GetWindowsList](RemoteControlGetWindowsList.md)

### Release notes

- **Version 11.2**
    - Added [RemoteControl.GetWindowsListAsJSON](https://www.mbsplugins.eu/RemoteControlGetWindowsListAsJSON.shtml) function.

### Blog Entries

- [MBS FileMaker Plugin, June 2021 News](https://www.mbsplugins.de/archive/2021-06-01/MBS_FileMaker_Plugin_June_2021/monkeybreadsoftware_blog_filemaker)
- [New in MBS FileMaker Plugin 11.2](https://www.mbsplugins.de/archive/2021-05-26/New_in_MBS_FileMaker_Plugin_11/monkeybreadsoftware_blog_filemaker)
- [Neues MBS FileMaker Plugin 11.2](https://www.mbsplugins.de/archive/2021-05-18/Neues_MBS_FileMaker_Plugin_112/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 11.2 - More than 6500 Functions In One Plugin](https://www.mbsplugins.de/archive/2021-05-18/MBS_FileMaker_Plugin_112_-_Mor/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 11.2pr3](https://www.mbsplugins.de/archive/2021-04-14/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 12nd April 2021 , last changed 15th June 2021

  
[RemoteControl.GetWindowsList](RemoteControlGetWindowsList.md) - [RemoteControl.HideCursor](RemoteControlHideCursor.md)

[HTML Version](RemoteControlGetWindowsListAsJSON.shtml)