NSIS刷新托盘图标
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 | !include "MUI2.nsh" !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_LANGUAGE "SimpChinese" Name "ClearTrayIcon" OutFile "ClearTrayIcon.exe" XPStyle on InstallColors /windows ShowInstDetails show AutoCloseWindow false Section Main Call ClearShellTrayIcon SectionEnd Function ClearShellTrayIcon Push $R0 Push $R1 Push $R2 Push $R3 Push $R4 Push $R5 FindWindow $R0 "Shell_TrayWnd" FindWindow $R0 "TrayNotifyWnd" "" $R0 FindWindow $R1 "SysPager" "" $R0 FindWindow $R1 "ToolBarWindow32" "" $R1 IsWindow $R1 +2 FindWindow $R1 "ToolBarWindow32" "" $R0 System::Alloc 16 System::Call "user32::GetClientRect(iR1,isR0)" System::Call "*$R0(i,i,i.R2,i.R3)" System::Free $R0 StrCpy $R4 0x0 IntCmpU $R2 $R4 +10 +10 StrCpy $R5 0x0 IntCmpU $R3 $R5 +6 +6 IntOp $R0 $R5 << 16 IntOp $R0 $R0 | $R4 SendMessage $R1 ${WM_MOUSEMOVE} 0 $R0 IntOp $R5 $R5 + 5 Goto -5 IntOp $R4 $R4 + 5 Goto -9 Pop $R5 Pop $R4 Pop $R3 Pop $R2 Pop $R1 Pop $R0 FunctionEnd |