File tree Expand file tree Collapse file tree 1 file changed +3
-13
lines changed
Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -31,30 +31,20 @@ func setEnv(name string, value string) error {
3131 return err
3232 }
3333 // https://docs.microsoft.com/en-us/windows/desktop/api/shlobj_core/nf-shlobj_core-shchangenotify
34- err = syscall .NewLazyDLL ("shell32.dll" ).NewProc ("SHChangeNotify" ).Call (
34+ syscall .NewLazyDLL ("shell32.dll" ).NewProc ("SHChangeNotify" ).Call (
3535 uintptr (SHCNE_ASSOCCHANGED ),
3636 uintptr (SHCNF_IDLIST ),
3737 0 , 0 )
38- if err != nil {
39- return err
40- }
4138
4239 // https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-sendmessagetimeoutw
43- env , err := syscall .UTF16PtrFromString ("Environment" )
44- if err != nil {
45- return err
46- }
47-
48- err = syscall .NewLazyDLL ("user32.dll" ).NewProc ("SendMessageTimeoutW" ).Call (
40+ env , _ := syscall .UTF16PtrFromString ("Environment" )
41+ syscall .NewLazyDLL ("user32.dll" ).NewProc ("SendMessageTimeoutW" ).Call (
4942 uintptr (HWND_BROADCAST ),
5043 uintptr (WM_SETTINGCHANGE ),
5144 0 ,
5245 uintptr (unsafe .Pointer (env )),
5346 uintptr (SMTO_ABORTIFHUNG ),
5447 uintptr (5000 ))
55- if err != nil {
56- return err
57- }
5848
5949 return nil
6050}
You can’t perform that action at this time.
0 commit comments