Skip to content

Commit 9d8562f

Browse files
committed
fix(win): SetClassLongPtrW for 32-bit
1 parent 1f7fe8e commit 9d8562f

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/ui/windows/darkmode/hook.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ use std::{
77
use slim_detours_sys::{DETOUR_INLINE_HOOK, SlimDetoursInlineHooks};
88
use sync_unsafe_cell::SyncUnsafeCell;
99
use widestring::U16CStr;
10+
#[cfg(target_pointer_width = "64")]
11+
use windows_sys::Win32::UI::WindowsAndMessaging::SetClassLongPtrW;
12+
#[cfg(target_pointer_width = "32")]
13+
use windows_sys::Win32::UI::WindowsAndMessaging::SetClassLongW as SetClassLongPtrW;
1014
use windows_sys::{
1115
Win32::{
1216
Foundation::{COLORREF, HWND, LPARAM, LRESULT, RECT, S_OK, WPARAM},
@@ -31,8 +35,8 @@ use windows_sys::{
3135
Shell::{DefSubclassProc, SetWindowSubclass},
3236
WindowsAndMessaging::{
3337
EnumChildWindows, GCLP_HBRBACKGROUND, GetClassNameW, GetClientRect,
34-
SPI_GETHIGHCONTRAST, SetClassLongPtrW, SystemParametersInfoW, WM_CTLCOLORDLG,
35-
WM_ERASEBKGND, WM_SETTINGCHANGE,
38+
SPI_GETHIGHCONTRAST, SystemParametersInfoW, WM_CTLCOLORDLG, WM_ERASEBKGND,
39+
WM_SETTINGCHANGE,
3640
},
3741
},
3842
},

0 commit comments

Comments
 (0)