NSIS检测到窗口最小化闪烁提示

#检测到窗口为最小化时闪烁提示
!include nsDialogs.nsh
#编写:水晶石
Name "IsIconic Example"
OutFile "IsIconic.exe"
XPStyle on
########################################################
var Syslink
Var DIALOG
#######################################################

Page custom nsDialogsPage mypageleave
########################################################

Function OnTimer
  System::Call "user32::IsIconic(p$HWNDPARENT)i.r1"   #返回值为非0代表窗口被最小化
${if} $1 != 0
  System::Call "user32::FlashWindow(p $HWNDPARENT,i 1)"
${EndIf}
FunctionEnd
;____________________________________________________________________________
Function OnSyslink
Pop $R0
   Pop $R1
    Pop $R2
     ${If} $R1 = -2
       ${OrIf} $R1 = -4
        System::Call `*$R2(i, i, i, i, i .R3)`
       ${If} $R3 = 0
       ExecShell open `https://www.cnblogs.com/NSIS/`
    ${EndIf}
${EndIf}
FunctionEnd
;_____________________________________________________________________________
Function mypageleave
   nsDialogs::KillTimer  OnTimer
FunctionEnd
#__________________________________________________________________________
Function nsDialogsPage
  nsDialogs::Create 1018
	Pop $DIALOG
  nsDialogs::CreateControl /NOUNLOAD SysLink ${WS_CHILD}|${WS_VISIBLE}|${WS_TABSTOP} 0 10u 30u -20u 10u `最小化时闪烁提示,更多范例教程访问<A>我的博客</A>`
  pop $Syslink
  ${NSD_OnNotify} $syslink Onsyslink
  ${NSD_CreateTimer}  OnTimer 100
	nsDialogs::Show
FunctionEnd

Section
SectionEnd

 

posted on 2022-09-15 21:06  水晶石  阅读(66)  评论(0编辑  收藏  举报