non-activating-operate 0.0.0-stage → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 awa1231
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,178 @@
1
- # Temporary Holding Version
1
+ # Non Activating Operate
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [Project website](https://awa1231.github.io/NoActivateOperate/) · [GitHub repository](https://github.com/awa1231/NoActivateOperate) · [Download for Windows](https://github.com/awa1231/NoActivateOperate/releases)
4
+
5
+ Click buttons, links, and video controls in background windows without bringing those windows to the front or taking keyboard focus away from the window you are currently typing in.
6
+
7
+ Clicking a text field in a background window automatically brings that window forward, so you can start typing normally, including with Chinese input methods.
8
+
9
+ > ⭐ If you find it useful, please give the project a star on [GitHub](https://github.com/awa1231/NoActivateOperate) — it helps others find it.
10
+ >
11
+ > 如果觉得好用,欢迎去 GitHub 点个 Star。
12
+
13
+ - **Portable:** The application compiles into a single executable of approximately 55 KB. It does not write to system directories. Configuration is stored in `%APPDATA%\Non Activating Operate`.
14
+ - **No build artifacts in the repository:** Run `build.bat` to generate the executable. It uses the .NET Framework compiler included with Windows, so no SDK is required.
15
+ - **System tray utility:** The tray icon is green when the feature is enabled and blue when a window is temporarily being borrowed.
16
+ - **One shortcut:** Press **Ctrl+F** to toggle the feature. You can assign a different shortcut from the tray menu.
17
+
18
+ > ⚠️ `Ctrl+F` is the default Find shortcut in most applications. Once this global shortcut is registered, `Ctrl+F` is captured by Non Activating Operate while the application is running, so Find will no longer work in browsers, editors, and other applications.
19
+ >
20
+ > If this causes problems, right-click the tray icon and select **Change toggle shortcut…** to assign a less common key combination.
21
+
22
+ ---
23
+
24
+ ## Install
25
+
26
+ - **npm (Windows, Node.js 16+):**
27
+
28
+ ```bash
29
+ npx non-activating-operate
30
+ ```
31
+
32
+ or install it globally and start it from anywhere:
33
+
34
+ ```bash
35
+ npm install -g non-activating-operate
36
+ non-activating-operate
37
+ ```
38
+
39
+ The package contains the prebuilt executable and a small launcher.
40
+
41
+ - **Prebuilt binary:** download `Non.Activating.Operate.exe` from the [releases page](https://github.com/awa1231/NoActivateOperate/releases).
42
+ - **From source:** run `build.bat`, then start `Non Activating Operate.exe`.
43
+
44
+ ## Usage
45
+
46
+ 1. Run `build.bat` to create `Non Activating Operate.exe`. Double-click the executable. A small two-window icon appears in the notification area.
47
+ If you downloaded the prebuilt binary from the [releases page](https://github.com/awa1231/NoActivateOperate/releases), the file is named `Non.Activating.Operate.exe`: GitHub replaces spaces in uploaded file names with dots, and it is the same executable.
48
+ 2. Press **Ctrl+F** to enable the feature. The icon turns green and a confirmation sound may play.
49
+ 3. Click the play button, link, or list item in a background window. The window is not brought to the front, and the current window keeps keyboard focus.
50
+ 4. **To type:** Click a text field in the background window. That window is brought to the front temporarily, the cursor is placed where you clicked, and you can start typing normally.
51
+ 5. Press **Ctrl+F** again to disable the feature and restore normal click behavior. If a window is still being temporarily borrowed, it is restored automatically.
52
+
53
+ You can disable **Bring background text fields forward** from the tray menu. Non-activating clicks will still work, but typing across windows will no longer be automatic.
54
+
55
+ ## Tray menu
56
+
57
+ | Item | Description |
58
+ | --- | --- |
59
+ | Enable / Disable | You can also use `Ctrl+F` or double-click the tray icon. |
60
+ | Click behavior: Do not activate the window / Preserve current window stacking | Two click modes. See “Click behavior modes” below. |
61
+ | **Bring background text fields forward** (enabled by default) | Clicking a background text field brings its window forward so you can type immediately. |
62
+ | Use real drag and drop while dragging (enabled by default) | File dragging and drop operations require real mouse input. After the pointer moves 10 pixels, the tool switches to a real drag, which activates the target window once. |
63
+ | Scroll the background window under the pointer (disabled by default) | Route wheel input to the background window beneath the pointer. |
64
+ | Sounds | Play a confirmation sound when enabling, borrowing, or restoring a window. |
65
+ | Temporarily foreground the window under the pointer | Manual fallback for applications whose text fields cannot be detected automatically. |
66
+ | Release the hold after six seconds without typing (enabled by default) | After six seconds without keyboard or mouse input, restore the windows held in the current stacking group to normal behavior. |
67
+ | Restore the temporarily foregrounded window | Return the borrowed window to its original position in the window stack and restore the previous foreground window. |
68
+ | Pin the window under the pointer (keep on top) | Pin a reference window to the top, then interact normally with a lower window without covering it. Select the item again to unpin the window. |
69
+ | Change toggle shortcut… | Replace `Ctrl+F` with another shortcut. |
70
+ | Launch at Windows startup | Add an entry to `HKCU\...\CurrentVersion\Run`. Administrator privileges are not required. |
71
+
72
+ ## Behavior details
73
+
74
+ - **The utility only acts on windows that are not currently active.** When you click the window you are already using, behavior remains completely normal: dragging, text selection, and text-field clicks all work as usual.
75
+ - Left-click, right-click, middle-click, and double-click are supported.
76
+ - **Clicking a text field automatically borrows the foreground.** When you click a text field in a background window, including `Edit`, `RichEdit`, and text controls in browsers, Electron, and WPF applications, the utility temporarily brings the window to the foreground and sends a **real click** at the selected position so the caret is placed correctly. This changes the window order because Windows sends keyboard input only to the foreground window; typing with an input method is not possible without foreground activation.
77
+ - **Drag and drop:** Synthetic clicks cannot start system OLE drag and drop. After the pointer moves 10 pixels while the mouse is held down, the utility switches to a real mouse drag so files and other drag-and-drop targets work normally. This also activates the target window once. You can disable this behavior from the menu.
78
+ - **“Look at the upper window while typing in the lower one”:** In **Preserve current window stacking** mode, clicking a lower window activates it normally and lets you type directly, while the windows above it remain above it and the visible layout stays unchanged.
79
+ - Clicking the **taskbar, notification area, Start menu, or desktop** behaves normally and is unaffected.
80
+ - Clicking the **title bar, border, or scrollbar** of a background window is ignored. Windows must activate a window for these interactions, so the only way to preserve the current stacking order is to ignore them.
81
+ - The tray icon always remains clickable, even while the feature is enabled, so you can disable it at any time.
82
+
83
+ ## Click behavior modes
84
+
85
+ The first group in the tray menu controls what happens after a click. `Ctrl+F` only enables or disables the feature.
86
+
87
+ ### A. Do not activate the window (default)
88
+
89
+ Clicks in background windows are delivered without activation. This is useful for play buttons, links, and list items. Clicking a text field automatically brings its window forward so you can type.
90
+
91
+ ### B. Preserve current window stacking
92
+
93
+ Clicking a lower window **activates it normally**, which allows the caret to enter the field and typing to work directly. Before activation, the utility identifies the windows covering the target window and pins them in their current order at the top. The selected window can then become active while remaining beneath the pinned group, so the visible stacking relationship does not appear to change.
94
+
95
+ - Typing works normally with real keyboard input and a real input method, including Chinese.
96
+ - **All** windows above the target window, not only those that overlap it, are kept in their original order at the top. With three windows, for example, the middle window is not pushed behind the others.
97
+ - The preserved stacking group remains active only for the **current typing session**. It is restored automatically in either of these situations:
98
+ 1. You switch to another window by clicking it, pressing `Alt+Tab`, or selecting a window above the target.
99
+ 2. You stop using the keyboard and mouse for six seconds.
100
+ - New windows created after restoration also appear normally above the target window.
101
+ - You can release the group manually by pressing `Ctrl+F` to disable the feature or by selecting **Release the preserved stacking order** from the menu. To disable the six-second timeout, turn off **Release the hold after six seconds without typing** in the menu.
102
+
103
+ ## How it works
104
+
105
+ Windows normally combines a mouse click on a window with window activation and foreground promotion. When the real mouse button is pressed, Windows activates the target window before dispatching the click, which brings the window to the front.
106
+
107
+ This utility installs a global low-level mouse hook (`WH_MOUSE_LL`) and intercepts the click before Windows dispatches it. It then converts the pointer position to the target window's client coordinates and uses `PostMessage` to send `WM_MOUSEMOVE`, `WM_LBUTTONDOWN`, and `WM_LBUTTONUP` directly to the control beneath the pointer. It also handles double-clicks, right-clicks, middle-clicks, and wheel events.
108
+
109
+ The target window receives one click, but it is never activated. **The Z-order, foreground window, and keyboard focus therefore remain unchanged.** This is different from bringing a window forward and then moving it back: the window is never moved in the first place.
110
+
111
+ Text fields are the exception. After detecting a text field, the utility records the current window stack and foreground window, brings the target window to the foreground, and sends a real click to position the caret. You can then type with a real keyboard and input method. The tray menu can restore the original stacking order and foreground window after borrowing it.
112
+
113
+ Text-field detection works in two stages. It first checks the control class, such as `Edit`, `RichEdit`, `Scintilla`, and various `TextBox` controls. If the class is not recognized, it uses UI Automation to check whether the control type at the clicked position is `Edit`, covering browsers, Electron, WPF, and similar applications.
114
+
115
+ > Another approach that initially appears more realistic was also tested: temporarily adding `WS_EX_NOACTIVATE` to the target window so that a real mouse click would not activate it.
116
+ >
117
+ > Testing showed that this approach **does not work on Windows**. The style takes effect only when a window is created. Applying it at runtime has no effect on click activation, and clicks still activated and raised both WinForms windows and windows using the native `DefWindowProc`. The final implementation therefore uses posted mouse messages.
118
+
119
+ ## Limitations
120
+
121
+ - Applications that process window messages generally work, including Chrome, Edge, Word, Excel, Notepad, File Explorer, VLC, PotPlayer, Electron applications, and WinForms or WPF applications.
122
+ - **Games** and **some UWP or Microsoft Store applications** read raw input through RawInput or CoreWindow. They may not receive these clicks and can appear unresponsive.
123
+ - A small number of applications, especially those using custom-rendered UI frameworks, may bring themselves to the foreground after receiving a click. The utility cannot prevent this because the application genuinely received the click.
124
+ - Some applications expose neither a standard text-field control class nor a usable UI Automation type. Use **Temporarily foreground the window under the pointer** from the tray menu as a manual fallback.
125
+ - To interact with a window running with administrator privileges, Non Activating Operate must also run as administrator. Otherwise Windows blocks message delivery and the utility falls back to a normal click.
126
+
127
+ ## Files
128
+
129
+ | Path | Description |
130
+ | --- | --- |
131
+ | `build.bat` | Compiles `Non Activating Operate.exe` using the .NET Framework 4.x compiler included with Windows. No SDK is required. |
132
+ | `src\` | Source code (C# 5 / WinForms, no third-party dependencies). |
133
+ | `tests\` | Automated acceptance tests described below. |
134
+
135
+ Configuration and logs:
136
+
137
+ ```text
138
+ %APPDATA%\Non Activating Operate\config.ini
139
+ %APPDATA%\Non Activating Operate\log.txt
140
+ ```
141
+
142
+ ## Requirements
143
+
144
+ - Windows 10 or Windows 11 (x64 or x86)
145
+ - .NET Framework 4.x, included with Windows; no separate installation is required
146
+
147
+ > The executable produced by this repository is not code-signed. Windows SmartScreen may report an **Unknown publisher** warning on first launch. Select **More info → Run anyway** to continue.
148
+
149
+ ## Rebuild
150
+
151
+ Double-click `build.bat`, or run:
152
+
153
+ ```bat
154
+ build.bat -nopause
155
+ ```
156
+
157
+ ## Automated acceptance tests
158
+
159
+ `tests\Harness.cs` creates several overlapping and stacked windows and verifies that:
160
+
161
+ - In the control group, ordinary clicks raise background windows and steal foreground focus when the hook is disabled, proving that the test method is valid.
162
+ - Direct engine calls deliver clicks at the correct coordinates without changing Z-order or the foreground window.
163
+ - The end-to-end hook swallows real clicks, delivers posted messages to the target, and preserves Z-order and the foreground window.
164
+ - Synthetic dragging without activation switches correctly to real drag and drop, and true OLE drag and drop works when dragging a file from a background window to another window.
165
+ - Foreground borrowing brings the target window to the front, restores the original foreground window and stacking order afterward, and allows text to be typed into the borrowed window.
166
+ - Double-click, button clicks, wheel input, title-bar ignoring, active-window exemptions, and DPI conversion work correctly.
167
+
168
+ Run the tests with:
169
+
170
+ ```bat
171
+ tests\run-tests.bat
172
+ ```
173
+
174
+ The test suite opens several windows in the lower-right area of the screen and injects real mouse clicks for about six seconds. The test windows close automatically when the run finishes.
175
+
176
+ ## License
177
+
178
+ MIT © 2026 awa1231. See [LICENSE](LICENSE).
Binary file
package/bin/cli.js ADDED
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const { spawn } = require('node:child_process');
5
+ const fs = require('node:fs');
6
+ const path = require('node:path');
7
+
8
+ if (process.platform !== 'win32') {
9
+ console.error('Non Activating Operate is a Windows utility; it runs on Windows 10 and 11 only.');
10
+ process.exit(1);
11
+ }
12
+
13
+ const exe = path.join(__dirname, 'Non Activating Operate.exe');
14
+ if (!fs.existsSync(exe)) {
15
+ console.error('Executable not found: ' + exe);
16
+ console.error('Reinstall the package: npm install -g non-activating-operate');
17
+ process.exit(1);
18
+ }
19
+
20
+ const child = spawn(exe, [], { detached: true, stdio: 'ignore', windowsHide: false });
21
+ child.unref();
22
+
23
+ console.log('Non Activating Operate started.');
24
+ console.log('Look for the two-window icon in the notification area, then press Ctrl+F to enable it.');
25
+ console.log('Right-click the tray icon for options: stacking mode, shortcut, launch at startup, exit.');
26
+ process.exit(0);
package/package.json CHANGED
@@ -1,6 +1,42 @@
1
1
  {
2
2
  "name": "non-activating-operate",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.1",
4
+ "description": "Click, scroll and type in background Windows without stealing focus: non-activating clicks, typing into lower windows while keeping the stacking order.",
5
+ "keywords": [
6
+ "windows",
7
+ "tray",
8
+ "noactivate",
9
+ "click-through",
10
+ "window-manager",
11
+ "focus",
12
+ "automation",
13
+ "utility"
14
+ ],
15
+ "license": "MIT",
16
+ "author": "awa1231",
17
+ "homepage": "https://awa1231.github.io/NoActivateOperate/",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/awa1231/NoActivateOperate.git"
21
+ },
22
+ "bugs": {
23
+ "url": "https://github.com/awa1231/NoActivateOperate/issues"
24
+ },
25
+ "os": [
26
+ "win32"
27
+ ],
28
+ "engines": {
29
+ "node": ">=16"
30
+ },
31
+ "bin": {
32
+ "non-activating-operate": "bin/cli.js"
33
+ },
34
+ "files": [
35
+ "bin/",
36
+ "LICENSE",
37
+ "README.md"
38
+ ],
39
+ "scripts": {
40
+ "prepack": "node scripts/prepack.js"
41
+ }
42
+ }