Repository navigation
Expand file tree
/
Copy pathstrings.py
More file actions
129 lines (105 loc) · 3.69 KB
/
Copy pathstrings.py
File metadata and controls
129 lines (105 loc) · 3.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
"""User-facing strings (English, single source of truth)."""
from __future__ import annotations
APP_NAME = "GhostWindow"
READY = "Ready"
DLL_MISSING = "{dll} not found next to the script"
DLL_MISSING_TITLE = APP_NAME
DLL_MISSING_BODY = "{name} not found next to the script:\n{path}"
NO_ADMIN = "No administrator rights - injection may fail"
NO_ADMIN_TITLE = "Administrator rights required"
NO_ADMIN_BODY = (
"GhostWindow is not running as administrator.\n\n"
"Injection into elevated or other-user processes will fail.\n"
"Restart the program as administrator for full functionality."
)
NO_WINDOW_SELECTED = "No window selected"
UNTITLED = "(untitled)"
PICK_WINDOW_FIRST = "Pick a window first"
PICK_CANCELLED = "Picking cancelled - no window identified"
PICK_SELF = "That is GhostWindow itself"
WINDOW_SELECTED = "Window selected"
INJECTING = "Injecting..."
RESTORING = "Restoring..."
SHUTTING_DOWN = "Shutting down..."
NOTHING_TO_SHOW = "Nothing to show"
WINDOW_CLOSED = "Window is already closed"
BROUGHT_TO_FRONT = "Window brought to front"
FOREGROUND_FAILED = "Failed to activate the window"
PINNED = "Pinned on top"
UNPINNED = "Unpinned"
HWND_COPIED = "HWND copied"
PID_COPIED = "PID copied"
HIDDEN_WINDOWS = "HIDDEN WINDOWS"
PIN_ON_TOP = "Pin on top"
UNPIN = "Unpin"
PICK_WINDOW = "Pick a window"
HIDE_SELF = "Hide GhostWindow"
HIDE = "Hide"
SHOW = "Show"
BRING_TO_FRONT = "Bring to front"
REFRESH = "Refresh"
RESTORE = "Restore"
FORGET = "Forget"
QUIT = "Quit"
HIDE_PROCESS_WINDOWS = "Hide all windows of the same process"
HEADER = (
"Hide any window from OBS / Zoom / Discord, "
"remove it from the taskbar, keep it always on top"
)
NO_SELECTION_TITLE = "No selection"
NO_SELECTION_BODY = "Select a window in the list first."
RESTORE_TITLE = "Restore window"
RESTORE_BODY = (
'Restore window "{title}" from {name} (PID {pid})?\n\n'
"It will become visible to OBS/Zoom again and return to the taskbar."
)
FORGET_TITLE = "Forget window"
FORGET_BODY = (
'Remove "{title}" from the list?\n\n'
"The window will STAY hidden and the DLL will remain loaded "
"in the target process. Use this only if you no longer need "
"to control it from here."
)
QUIT_TITLE = "Quit"
QUIT_BODY = (
"There are still {count} hidden windows in the list.\n\n"
"Restore them and detach the DLL before quitting?"
)
HOTKEY_TAKEN = "Hotkey {label} is already taken by another application"
CONTEXT_BRING_TO_FRONT = "Bring to front"
CONTEXT_SHOW_ONE = "Show this only"
CONTEXT_SHOW_PROCESS = "Show all of this process"
CONTEXT_HIDE_PROCESS = "Hide all of this process"
CONTEXT_RETRY_HIDE = "Retry hide"
CONTEXT_DETACH = "Restore (detach DLL)"
CONTEXT_FORGET = "Forget"
CONTEXT_COPY_HWND = "Copy HWND ({hwnd:#x})"
CONTEXT_COPY_PID = "Copy PID ({pid})"
PICKER_TITLE = "Point the cursor at a window"
PICKER_CANCEL_HINT = "{hotkey} - cancel"
TAB_PROCESS = "PROCESS"
TAB_PID = "PID"
TAB_WINDOW = "WINDOW"
TAB_STATE = "STATE"
TAB_PIN = "PIN"
def hidden(count: int) -> str:
return "Window hidden" if count == 1 else f"Hidden {count} windows"
def restored(count: int) -> str:
return (
"Window is visible again"
if count == 1
else f"Restored {count} windows"
)
def hotkey_taken(label: str) -> str:
return HOTKEY_TAKEN.format(label=label)
def window_restored(title: str) -> str:
return f'Window "{title}" restored'
def forgotten(title: str) -> str:
return f'"{title}" removed from the list (still hidden)'
def target_info(title: str, process: str, pid: int, hwnd: int) -> str:
return (
f"<b>{title}</b><br>"
f"<span style='color:#6d7280; font-size: 9pt;'>"
f"{process} · PID {pid} · "
f"HWND {hwnd:#x}</span>"
)