CreateIPAddress控件怎么设置默认的IP地址呢?
nsis吧
全部回复
仅看楼主
level 3
QQ2008_ 楼主
我使用这种方式不能生效
${NSD_CreateIPAddress} 80u 85u 110u 12u "127.0.0.1"
2013年06月14日 08点06分 1
level 3
QQ2008_ 楼主
吧主大人,有什么解决办法,或者我书写有误?
@贾可 @金赤狼
2013年06月14日 09点06分 3
level 7
!define IPM_CLEARADDRESS 0x0465
!define IPM_SETADDRESS 0x0466
${NSD_CreateIPAddress} 80u 85u 110u 12u ""
Pop $R0
方法一,最简单通用的:
SendMessage $R0 ${WM_SETTEXT} 0 "STR:127.0.0.1"
方法二,IP控件的消息:
SendMessage $R0 ${IPM_SETADDRESS} 0 0x7F000001
# 0x7F = 127,0x00 = 0,0x00 = 0,0x01 = 1
# 这里需要把IP转换为一个32位无符号整数
2013年06月14日 16点06分 4
新版的字体问题好像还没有解决吧,下载了最新的头文件,后退之后,发现字体依然改变了!
2013年06月15日 07点06分
可以了 不知道为什么,可能是系统原因吧,在家里不行,但公司电脑是可以的!
2013年06月17日 02点06分
谢谢 贾哥
2013年06月17日 02点06分
回复 QQ2008_ :bug应该是XP下的,我现在没XP也没法测试了。那个官方的头文件还是有点问题,有一处$1写成了$R1了。
2013年06月17日 06点06分
level 3
QQ2008_ 楼主
/* nsDialogs_createIPaddress.nsh
Header file for creating IP address input controls Usage:
${NSD_CreateIPaddress} x y width height text
( text is ignored but included keep parity with the other ${NSD_Create*} commands version info:
1.1 - Major bugfix: the installer font could get corrupted when using this
control. This is a known issue with the SysIPAddress32 control. The
fix is simple but can't be applied completely within the nsDialogs
framework. Some manual replacement of the NSD_Create command is
thus performed.
1.0 - Initial version
*/
!ifndef NSDIALOGS_createIPaddress_INCLUDED
!define NSDIALOGS_createIPaddress_INCLUDED
!verbose push
!verbose 3
!ifndef ICC_INTERNET_CLASSES
!define ICC_INTERNET_CLASSES 0x00000800
!endif
!include LogicLib.nsh
!include WinMessages.nsh
!define __NSD_IPaddress_CLASS SysIPAddress32
!define __NSD_IPaddress_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}
!define __NSD_IPaddress_EXSTYLE 0
!insertmacro __NSD_DefineControl IPaddress
!define NSD_CreateIPAddressControl "${NSD_CreateIPAddress}"
!undef NSD_CreateIPAddress
!macro NSD_CreateIPAddress x y w h label
Push $0 ; $0
Push $1 ; $1 $0
${NSD_CreateIPAddressControl} ${x} ${y} ${w} ${h} "${label}"
; hwnd $1 $0
Pop $0 ; $1 $0
CreateFont $R1 "$(^Font)" "$(^FontSize)"
SendMessage $0 ${WM_SETFONT} $R1 1
Pop $1 ; $0
Exch $0 ; hwnd
!macroend
!define NSD_CreateIPAddress `!insertmacro NSD_CreateIPAddress`
!macro NSD_InitIPaddress
Push $0 ; $0
Push $1 ; $1 $0
System::Alloc 400 ; memalloc $1 $0
Pop $1 ; $1 $0
System::Call "*$1(i 8, i ${ICC_INTERNET_CLASSES})"
System::Call 'comctl32::InitCommonControlsEx(i r1) i .r0'
System::Free $1
Pop $1 ; $0
Exch $0 ; 1|0 (true|false)
!macroend
!define NSD_InitIPaddress '!insertmacro "NSD_InitIPaddress"' !verbose pop
!endif
2013年06月15日 07点06分 6
你好 请问你这个怎么设置静默安装的ip参数 很急,麻烦了 谢谢
2018年01月25日 14点01分
@名字难取480 做界面是为了收集用户自己填写的ip参数,如果静默安装的话,你直接使用自己规定好的ip参数就行了,跟界面没有关系啊
2018年01月29日 06点01分
1