# Where Are Window Modules Located in the escrcpy Project?

> Discover the precise location of window modules within the escrcpy project. Find window.js implementation files under desktop/electron/modules/ for detailed insights.

- Repository: [viarotel-org/escrcpy](https://github.com/viarotel-org/escrcpy)
- Tags: internals
- Published: 2026-09-10

---

**The window modules in escrcpy are located under `desktop/electron/modules/`, where each feature provides its own [`window.js`](https://github.com/viarotel-org/escrcpy/blob/main/window.js) implementation file.**

escrcpy is an open-source Electron application that provides a GUI for scrcpy. According to the viarotel-org/escrcpy source code and AGENTS.md documentation, **window modules** live under the `desktop/electron/modules/` directory, following a consistent pattern where each functional area contains its own window implementation.

## Window Module Directory Structure

### The Base Directory

The canonical location for all browser window implementations is `desktop/electron/modules/`. As documented in the project's AGENTS.md guide, "Window modules live under `desktop/electron/modules/`" according to the viarotel-org/escrcpy source code.

### Feature-Specific Subdirectories

Within the base directory, each feature maintains its own subdirectory containing a [`window.js`](https://github.com/viarotel-org/escrcpy/blob/main/window.js) file:

- [`desktop/electron/modules/control/window.js`](https://github.com/viarotel-org/escrcpy/blob/main/desktop/electron/modules/control/window.js)
- [`desktop/electron/modules/explorer/window.js`](https://github.com/viarotel-org/escrcpy/blob/main/desktop/electron/modules/explorer/window.js)
- [`desktop/electron/modules/terminal/window.js`](https://github.com/viarotel-org/escrcpy/blob/main/desktop/electron/modules/terminal/window.js)

## Entry Point and Registration

The main entry point at [desktop/electron/modules/index.js](https://github.com/viarotel-org/escrcpy/blob/main/desktop/electron/modules/index.js) registers these modules and exports their window creation functions to the rest of the application.

## Importing Window Modules in Code

When working with the escrcpy source, you import specific window creators from these paths using standard Node.js `require()` statements.

### Opening the Control Window

```javascript
const { createWindow: createControlWindow } = require('./desktop/electron/modules/control/window');

createControlWindow();

```

### Opening the Explorer Window

```javascript
const { createWindow: createExplorerWindow } = require('./desktop/electron/modules/explorer/window');

createExplorerWindow();

```

### Opening the Terminal Window

```javascript
const { createWindow: createTerminalWindow } = require('./desktop/electron/modules/terminal/window');

createTerminalWindow();

```

Adjust the relative path based on your file's location within the project structure.

## Summary

- escrcpy **window modules** are centralized under `desktop/electron/modules/`.
- Each feature (control, explorer, terminal) implements its window logic in a dedicated [`window.js`](https://github.com/viarotel-org/escrcpy/blob/main/window.js) file.
- The [index.js](https://github.com/viarotel-org/escrcpy/blob/main/desktop/electron/modules/index.js) file serves as the registry for all window modules.
- Import patterns use standard Node.js `require()` statements pointing to the specific feature's [`window.js`](https://github.com/viarotel-org/escrcpy/blob/main/window.js).

## Frequently Asked Questions

### What is the exact path for escrcpy window modules?

They are located at `desktop/electron/modules/` in the repository root. Each subdirectory represents a specific feature and contains a [`window.js`](https://github.com/viarotel-org/escrcpy/blob/main/window.js) file responsible for that feature's Electron window creation.

### How do I register a new window module in escrcpy?

Add your feature directory under `desktop/electron/modules/` with a [`window.js`](https://github.com/viarotel-org/escrcpy/blob/main/window.js) export, then register it in [`desktop/electron/modules/index.js`](https://github.com/viarotel-org/escrcpy/blob/main/desktop/electron/modules/index.js) according to the existing pattern used for control, explorer, and terminal modules.

### Can I customize existing window modules?

Yes. Each [`window.js`](https://github.com/viarotel-org/escrcpy/blob/main/window.js) file (such as [control/window.js](https://github.com/viarotel-org/escrcpy/blob/main/desktop/electron/modules/control/window.js)) exports window creation functions that you can modify to adjust window properties, preload scripts, or browser preferences.

### Are window modules available in the renderer process?

Window modules are typically required by the main process to create BrowserWindow instances. The renderer process communicates with these windows via IPC, but the module files themselves reside in the main process context under `desktop/electron/modules/`.