Skip to content

Commit cfacce2

Browse files
Updated muilti instance hadling
1 parent 1e9a418 commit cfacce2

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

BlackHole

16 Bytes
Binary file not shown.

BlackHole.exe

439 Bytes
Binary file not shown.

BlackHole.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
kernel32 = windll.kernel32
4242
WM_USER = 0x0400
4343
WM_COMMAND = 0x0111
44+
WM_CLOSE = 0x0010
4445
WM_LBUTTONDBLCLK = 0x0203
4546
WM_RBUTTONDOWN = 0x0204
4647
NIM_ADD = 0
@@ -133,7 +134,7 @@ class SECURITY_ATTRIBUTES(Structure):
133134
# Single instance enforcement using mutex
134135
if platform.system() == "Windows":
135136
ERROR_ALREADY_EXISTS = 183
136-
mutex_name = "Global\\BlackHole_SingleInstance_Mutex"
137+
mutex_name = "BlackHole_SingleInstance_Mutex"
137138
mutex = kernel32.CreateMutexW(None, True, mutex_name)
138139
err = kernel32.GetLastError()
139140
if err == ERROR_ALREADY_EXISTS:
@@ -209,7 +210,7 @@ def _enum_proc(h, lparam):
209210
hwnd = None
210211
if hwnd:
211212
try:
212-
user32.PostMessageW(hwnd, WM_USER + 1, 0, WM_LBUTTONDBLCLK)
213+
user32.PostMessageW(hwnd, WM_CLOSE, 0, 0)
213214
except Exception:
214215
pass
215216
sys.exit(0)
@@ -228,7 +229,7 @@ def _enum_proc(h, lparam):
228229
FONT_ITALIC = os.path.join(SCRIPT_DIR, "Fonts", "Nunito-Italic.ttf")
229230
FONT_SEMIBOLD = os.path.join(SCRIPT_DIR, "Fonts", "Nunito-SemiBold.ttf")
230231
LICENSE_TEXT = os.path.join(SCRIPT_DIR, "LICENSE.txt")
231-
VERSION = "1.10.0"
232+
VERSION = "1.10.1"
232233
# Load all the font files for Tkinter (on Windows)
233234
if platform.system() == "Windows":
234235
fonts = [FONT_REGULAR, FONT_MEDIUM, FONT_BOLD, FONT_LIGHT, FONT_ITALIC, FONT_SEMIBOLD]
@@ -237,7 +238,7 @@ def _enum_proc(h, lparam):
237238
# Broadcast font change
238239
HWND_BROADCAST = 0xFFFF
239240
WM_FONTCHANGE = 0x001D
240-
ctypes.windll.user32.SendMessageA(HWND_BROADCAST, WM_FONTCHANGE, 0, 0)
241+
ctypes.windll.user32.PostMessageA(HWND_BROADCAST, WM_FONTCHANGE, 0, 0)
241242
# --- Paths ---
242243
if platform.system() == "Windows":
243244
local_appdata = os.getenv("LOCALAPPDATA") or os.getenv("APPDATA")

Extras/BlackHole.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
; Non-commercial use only
44

55
#define MyAppName "Black Hole"
6-
#define MyAppVersion "1.10.0"
6+
#define MyAppVersion "1.10.1"
77
#define MyAppPublisher "Nova Foundry"
88
#define MyAppURL "https://novafoundry.ca"
99
#define MyAppExeName "BlackHole.exe"

Extras/BlackHole.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<project>
22
<shortName>BlackHole</shortName>
33
<fullName>Black Hole Password Manager</fullName>
4-
<version>1.10.0</version>
4+
<version>1.10.1</version>
55
<readmeFile>C:/Users/jackp/Downloads/Linux/BlackHole/README.txt</readmeFile>
66
<licenseFile>C:/Users/jackp/Downloads/Linux/BlackHole/LICENSE.txt</licenseFile>
77
<logoImage>C:/Users/jackp/Downloads/Black Hole Installer.png</logoImage>

0 commit comments

Comments
 (0)