NSIS使用API创建工具提示条和超级链接

24 篇文章 1 订阅

不再借助专用插件创建超级链接和工具提示条

!includensDialogs.nsh
#编写:水晶石
Name "link_tooltips"
OutFile "link_tooltips.exe"
XPStyle on
Var Link
Var tipS
Page custom nsDialogsPage

Function OnTimer
${Unless} $tips <> 0
System::Call USER32::CreateWindowEx(i0x00000008,t"tooltips_class32",i,i0x80000000,i,i,i,i,i,i,i0,i)i.s
  
Pop $tipS
${EndUnless}
  System::Alloc 16
Pop $0
  
System::Call USER32::GetCursorPos(ir0)
  
System::Call *$0(i.r1,i.r2)
  
System::Free $0
  
System::Call USER32::WindowFromPoint(ir1,ir2)i.r1
${If} $1 $Link
   
StrCpy $R1"超级链接"
   
FindWindow $3 "#32770" "" $HWNDPARENT
   
System::Call *(i0x28,i0x010,i$3,i0x409,i,i,i,i,i0,tR1)i.R1
   
SendMessage $tipS 1028 0 $R1
   
SendMessage $tipS 1033 0 $R1
   
SendMessage $tipS 1025 1 0
   
SendMessage $tipS 1041 1 $R1
   
System::Free $R1
   
SetCtlColors $Link  0xFF0000 transparent
   
System::Call USER32::LoadCursor(i,i32649)i.s
   
System::Call USER32::SetCursor(is)
${Else}
   
SendMessage $tipS 1025 0 0
   
SetCtlColors $Link  0x0000FF transparent
${EndIf}
  
System::Call user32::RedrawWindow(i$Link,i0,i0,i0x0105)
FunctionEnd

Function
nsDialogsPage
nsDialogs::Create 1018
  Pop $0
  ${NSD_CreateLabel}
1005010015"访问我的博客"
  
Pop $Link
  
SetCtlColors $Link  0x0000FF transparent
  System::Call user32::SetClassLong(i$Link,i-12,i0)
  ${NSD_OnClick} $Link OnClick
  
${NSD_CreateTimer} OnTimer 50
nsDialogs::Show
FunctionEnd

function
OnClick
ExecShell "open" "http://blog.csdn.net/shuijing_0"
FunctionEnd

Section
SectionEnd

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值