杉宫竹苑工作室

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

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

[复制链接]
发表于 2017-12-22 17:14:39 | 显示全部楼层 |阅读模式

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

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

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

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

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

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

  53. Section
  54. SectionEnd
复制代码

回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-19 19:03 , Processed in 0.191198 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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