Skip to content

Commit 9cadb0f

Browse files
committed
Add README, fix permission asking in command line mode
1 parent 57c15eb commit 9cadb0f

File tree

2 files changed

+167
-2
lines changed

2 files changed

+167
-2
lines changed

README.md

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
<p align="center">
2+
<a href="https://github.com/jerrylum/topmost2"><img src="https://i.imgur.com/r7PW6a2.png" alt="IntroIcon" width="100"></a>
3+
</p>
4+
<h3 align="center">TopMost2</h3>
5+
<p align="center">This tool allows you to make any windows always on top.</p>
6+
7+
<h4 align="center"><a href="https://github.com/jerrylum/topmost2/releases">Download Now</a></h4>
8+
9+
---
10+
11+
### Double Click
12+
13+
Double Click the tray icon, make the current selected window stay on top.
14+
15+
<h5 align="left">
16+
<img src="https://i.imgur.com/kuBflkz.gif">
17+
</h5>
18+
19+
<br>
20+
21+
### Global Hotkey
22+
23+
Use the default hotkey `Ctrl + Alt + Space` to make the current selected window stay on top.
24+
25+
<h5 align="left">
26+
<img src="https://i.imgur.com/NokjMLd.gif">
27+
</h5>
28+
<br>
29+
30+
### Change The Hotkey
31+
32+
Right click the tray icon and go to `options` page to change the hotkey to your own favorite combination.
33+
34+
<h5 align="left">
35+
<img src="https://i.imgur.com/LfNdpHR.gif">
36+
</h5>
37+
38+
<br>
39+
40+
### Window List
41+
42+
Click on a menu item from the `Window List` to pin or unpin any windows.
43+
44+
<h5 align="left">
45+
<img src="https://i.imgur.com/6KIfi3d.gif">
46+
</h5>
47+
48+
<br>
49+
50+
### Other Features
51+
52+
- Dynamic icon
53+
- Clear all function
54+
- Automatically startup option
55+
- Enable/Disable keyboard shortcut option
56+
- Freely customizable hotkey
57+
- Global hotkey
58+
- Command-line support
59+
- High compatibility with other programs
60+
- Negligible system resources usage
61+
62+
63+
64+
---
65+
66+
### Why I need this?
67+
68+
`Topmost` or `Always On Top` is a property of every window you see on your computer. A window whose Topmost property is set to `true` appears above all windows whose Topmost properties are set to `false`. <br>
69+
70+
Many windows applications don’t offer an option to make itself topmost. When you are browsing multiple windows at the same time, this may make you annoyed by frequent switching to different windows. With TopMost2, you can add this feature to any applications and solve the above problem.
71+
72+
73+
74+
### Details
75+
76+
- **Tray Icon**
77+
The color of the icon represents the top-most state of the current selected window.
78+
🟥RED = Normal, 🟩GREEN = Top-most
79+
80+
- **Clear All Function**
81+
This function will set all windows to normal states.
82+
83+
- **Elevated Privileges**
84+
If you are trying to set an elevated window, TopMost2 will ask you to elevate the privileges in order to have higher permission to finish the action. Obviously, the reason is that they are protected by the operating system. You can also start TopMost2 as administrator to avoid the above problem.
85+
86+
- **Hotkey**
87+
You can freely set any hotkey combination. By clicking the `Edit` button, you can then press a new combination. After that, click `Done` to finish. If you leave or close the option form. The hotkey setting will be auto-saved by the system.
88+
![Hot Key Demo](https://i.imgur.com/jGFi1tC.gif)
89+
If TopMost2 starts with normal permission, it may not be able to listen to the keyboard in the elevated window.
90+
91+
- **Exit**
92+
This function will set all windows to normal state and shut down the program.
93+
94+
95+
### Command Line
96+
97+
Usage:
98+
99+
```powershell
100+
.\topmost2 [--autostart] {action hWnd}
101+
```
102+
103+
**action:**
104+
105+
- Set top-most: `--set` or `-S` or `/S`
106+
- Remove top-most: `--remove` or `-R` or `/R`
107+
108+
**hWnd:**
109+
110+
The handle pointer in hexadecimal. HWND is a "handle to a window" and is part of the Win32 API.
111+
112+
<br>
113+
114+
For example:
115+
116+
```powershell
117+
.\topmost2 -S 0x311A0 -S 0x190D4E
118+
.\topmost2 -R 0x311A0
119+
```
120+
121+
122+
123+
---
124+
125+
### Other Software
126+
127+
There is some software on the Internet are doing the same thing too. Like [DeskPins](https://efotinis.neocities.org/deskpins/) and [Window TopMost Control](https://www.sordum.org/9182/window-topmost-control-v1-2/). I am trying to compare with them in several ways. Keep in mind, this is not a strict comparison and you might have your own answer base on your daily need and style.
128+
129+
130+
131+
| | TopMost2 | DeskPins | Window TopMost Control |
132+
| ----------------------------------------------- | ----------------- | ------------------------ | ---------------------- |
133+
| Set Elevated application's Window <sup>#0</sup> | ✔️ | ✔️ <sup>#1</sup> | ✔️ |
134+
| Command Line Support | ✔️ || ✔️ |
135+
| Portable | ✔️ || ✔️ |
136+
| Auto Start | ✔️ || ✔️ |
137+
| Auto Pin || ✔️ ||
138+
| Open Source | ✔️ | ✔️ ||
139+
| State visibility | 🟡Good | 🟢Excellent <sup>#2</sup> | 🟠Limited <sup>#3</sup> |
140+
| CPU Usage | 🟢Least | 🟠Highest | 🟡Medium |
141+
| Customize | 🟡Good | 🟢Excellent | 🟡Good |
142+
| Compatibility With Programs | 🟢Excellent | 🟡Good <sup>#4</sup> | 🟢Excellent |
143+
| Hotkey <sup>#5</sup> | More Combinations | More shortcuts | Limited |
144+
| Size | 47KB | 103KB | 680KB |
145+
146+
#0 Able to change a window that belongs to a process with elevated privileges (run as the administrator).
147+
#1 Only if the application starts as administrator. Otherwise, trying to do that will cause unknown behavior.
148+
#2 Pin icon at the top-right corner of the top-most window.
149+
#3 Only provide the "Window List" feature.
150+
#4 Not Compatible with windows which also have top-most setting.
151+
152+
<br>
153+
154+
---
155+
156+
### Download
157+
158+
Please go to [the release page](https://github.com/jerrylum/topmost2/releases) to download the latest version.
159+
This tool requires .Net Framework 4.7.2 (or above). Support Windows 7 SP1 or later.
160+
161+
<br>
162+
163+
### Special Thanks
164+
165+
Thank you SamNg and Theo for their suggestion and testing the software.

TopMost/ArgsProcess.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ private static void Eat()
3535

3636
if (mode == "/S" || mode == "-S" || mode == "--set")
3737
{
38-
API.SetTopMost(hwnd, true);
38+
API.SetTopMost(hwnd, true, false); // dont try admin
3939
}
4040
else if (mode == "/R" || mode == "-R" || mode == "--remove")
4141
{
42-
API.SetTopMost(hwnd, false);
42+
API.SetTopMost(hwnd, false, false); // dont try admin
4343
}
4444

4545
commandModeFlag = true;

0 commit comments

Comments
 (0)