Skip to content

Commit 0df7d75

Browse files
committed
Add SHCNF_FLUSH for better Win11 compatibility
1 parent 8887f91 commit 0df7d75

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "blackhole"
3-
version = "4.1.0"
3+
version = "4.1.1"
44
authors = ["William Venner <[email protected]>"]
55
edition = "2018"
66
repository = "https://github.com/WilliamVenner/blackhole"

src/windows.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ extern "system" {
2424
}
2525
const SHCNE_UPDATEDIR: winapi::um::winnt::LONG = 0x00001000;
2626
const SHCNF_PATHW: winapi::shared::minwindef::UINT = 0x0005;
27+
const SHCNF_FLUSH: winapi::shared::minwindef::UINT = 4096u32;
2728

2829
pub trait Windows {
2930
fn powershell(script: String);
@@ -63,7 +64,7 @@ impl Windows for Blackhole {
6364

6465
// SHChangeNotify(SHCNE_UPDATEDIR, ...) tell a file or directory to update its icon
6566
fn change_notify(ptr: *const winapi::ctypes::c_void) {
66-
unsafe { SHChangeNotify(SHCNE_UPDATEDIR, SHCNF_PATHW, ptr, std::ptr::null_mut()); }
67+
unsafe { SHChangeNotify(SHCNE_UPDATEDIR, SHCNF_PATHW | SHCNF_FLUSH, ptr, std::ptr::null_mut()); }
6768
}
6869

6970
// Sets Windows file attributes

0 commit comments

Comments
 (0)