杉宫竹苑工作室

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

寻找NSIS控件ID方法

[复制链接]
发表于 2017-2-26 13:46:39 | 显示全部楼层 |阅读模式

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

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

x
  1. name 'Find Control IDs'
  2. outfile 'findctlID_MUI.exe'
  3. showinstdetails show
  4. InstallDir '$EXEDIR'

  5. var header

  6. !include mui.nsh
  7. ; 许可协议页面
  8. !define MUI_PAGE_CUSTOMFUNCTION_PRE lic_pre
  9. !define MUI_PAGE_CUSTOMFUNCTION_SHOW lic_show
  10. !insertmacro MUI_PAGE_LICENSE 'License.txt'
  11. ; 组件选择页面
  12. !define MUI_PAGE_CUSTOMFUNCTION_SHOW comp_show
  13. !insertmacro MUI_PAGE_COMPONENTS
  14. ; 安装目录选择页面
  15. !define MUI_PAGE_CUSTOMFUNCTION_SHOW dir_show
  16. !insertmacro MUI_PAGE_DIRECTORY
  17. ;开始菜单页面
  18. !define MUI_PAGE_CUSTOMFUNCTION_SHOW smn_show
  19. !insertmacro MUI_PAGE_STARTMENU app $R9
  20. ; 安装过程页面
  21. !define MUI_PAGE_CUSTOMFUNCTION_SHOW inst_show
  22. !insertmacro MUI_PAGE_INSTFILES

  23. !insertmacro MUI_LANGUAGE "English"

  24. section
  25. sectionend
  26. ;协议页面ID
  27. function lic_show
  28. strcpy $header "LICENSE PAGE CONTROLS"
  29. call findIDs
  30. functionend
  31. ;选择页面ID
  32. function comp_show
  33. strcpy $header "COMPONENTS PAGE CONTROLS"
  34. call findIDs
  35. functionend
  36. ;安装页面ID
  37. function dir_show
  38. strcpy $header "DIRECTORY PAGE CONTROLS"
  39. call findIDs
  40. functionend
  41. ;开始页面ID
  42. function smn_show
  43. strcpy $header "START MENU PAGE CONTROLS"
  44. call findIDs
  45. functionend
  46. 过程页面ID
  47. function inst_show
  48. strcpy $header "INSTALL FILES PAGE CONTROLS"
  49. call findIDs
  50. functionend

  51. function lic_pre
  52. fileopen $5 '$EXEDIR\ids.txt' a
  53. fileseek $5 '' END
  54. filewrite $5 "PARENT DIALOG CONTROLS$\r$\n"
  55. strcpy $0 0
  56. loop:
  57. strcmp $0 '2000' end
  58. GetDlgItem $R0 $HWNDPARENT $0
  59. strcmp $R0 0 +3
  60. fileseek $5 '' END
  61. filewrite $5 "Control ID == $0$\r$\n"
  62. intop $0 $0 + 1
  63. goto loop
  64. end:
  65. filewrite $5 "$\r$\n"
  66. fileclose $5
  67. functionend

  68. function findIDs
  69. fileopen $5 '$EXEDIR\ids.txt' a
  70. fileseek $5 '' END
  71. filewrite $5 "$header$\r$\n"
  72. strcpy $0 0
  73. loop:
  74. strcmp $0 '2000' end
  75. FindWindow $R5 "#32770" "" $HWNDPARENT
  76. GetDlgItem $R0 $R5 $0
  77. strcmp $R0 0 +3
  78. fileseek $5 '' END
  79. filewrite $5 "Control ID == $0$\r$\n"
  80. intop $0 $0 + 1
  81. goto loop
  82. end:
  83. filewrite $5 "$\r$\n"
  84. fileclose $5
  85. functionend

  86. function .onInit
  87. IfFileExists '$EXEDIR\ids.txt' 0 +2
  88. delete '$EXEDIR\ids.txt'
  89. functionend
复制代码


回复

使用道具 举报

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

本版积分规则

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

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

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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