杉宫竹苑工作室

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1941|回复: 0

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

[复制链接]
发表于 2017-4-28 16:58:44 | 显示全部楼层 |阅读模式

正式会员享受无限制浏览网站功能和高速网盘下载,赶快加入本站吧!

您需要 登录 才可以下载或查看,没有账号?立即注册

x

不再借助专用插件创建超级链接和工具提示条
  1. !includensDialogs.nsh
  2. #编写:水晶石
  3. Name "link_tooltips"
  4. OutFile "link_tooltips.exe"
  5. XPStyle on
  6. Var Link
  7. Var tipS
  8. Page custom nsDialogsPage

  9. Function OnTimer
  10. ${Unless} $tips <> 0
  11. System::Call USER32::CreateWindowEx(i0x00000008,t"tooltips_class32",i,i0x80000000,i,i,i,i,i,i,i0,i)i.s
  12.   Pop $tipS
  13. ${EndUnless}
  14.   System::Alloc 16
  15. Pop $0
  16.   System::Call USER32::GetCursorPos(ir0)
  17.   System::Call *$0(i.r1,i.r2)
  18.   System::Free $0
  19.   System::Call USER32::WindowFromPoint(ir1,ir2)i.r1
  20. ${If} $1 = $Link
  21.    StrCpy $R1"超级链接"
  22.    FindWindow $3 "#32770" "" $HWNDPARENT
  23.    System::Call *(i0x28,i0x010,i$3,i0x409,i,i,i,i,i0,tR1)i.R1
  24.    SendMessage $tipS 1028 0 $R1
  25.    SendMessage $tipS 1033 0 $R1
  26.    SendMessage $tipS 1025 1 0
  27.    SendMessage $tipS 1041 1 $R1
  28.    System::Free $R1
  29.    SetCtlColors $Link  0xFF0000 transparent
  30.    System::Call USER32::LoadCursor(i,i32649)i.s
  31.    System::Call USER32::SetCursor(is)
  32. ${Else}
  33.    SendMessage $tipS 1025 0 0
  34.    SetCtlColors $Link  0x0000FF transparent
  35. ${EndIf}
  36.   System::Call user32::RedrawWindow(i$Link,i0,i0,i0x0105)
  37. FunctionEnd

  38. Function nsDialogsPage
  39. nsDialogs::Create 1018
  40.   Pop $0
  41.   ${NSD_CreateLabel} 100u 50u 100% 15u "访问我的博客"
  42.   Pop $Link
  43.   SetCtlColors $Link  0x0000FF transparent
  44.   System::Call user32::SetClassLong(i$Link,i-12,i0)
  45.   ${NSD_OnClick} $Link OnClick
  46.   ${NSD_CreateTimer} OnTimer 50
  47. nsDialogs::Show
  48. FunctionEnd

  49. function OnClick
  50. ExecShell "open" "http://blog.csdn.NET/shuijing_0"
  51. FunctionEnd

  52. Section
  53. SectionEnd
复制代码


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|SgzyStudio

GMT+8, 2024-5-18 01:38 , Processed in 0.106758 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表