最新消息:

创建文本框横向滚动条

nsis 永恒心锁 1870浏览 0评论
!include LogicLib.nsh
!include WinMessages.nsh
!include nsdialogs.nsh
SetCompressor /SOLID lzma
SetCompress force
XPStyle on
Var Dialog
Var ReleaseNotesText
OutFile "Test.EXE"
Name "Test"
Section "Test"
SectionEnd
Page custom pageshow
 Function pageshow
 nsDialogs::Create /NOUNLOAD 1018
Pop $Dialog
${If} $Dialog == error
Abort
${EndIf}
nsDialogs::CreateControl /NOUNLOAD ${__NSD_ListBox_CLASS} ${__NSD_ListBox_STYLE}|${WS_HSCROLL} ${__NSD_ListBox_EXSTYLE} 0 13u 262u -13u ""
Pop $ReleaseNotesText
${NSD_LB_AddString} $ReleaseNotesText "A pretty loooooooooooooooooooooooooooooooooooooooooooooooong striiiiiiiiiiing"
${NSD_LB_AddString} $ReleaseNotesText "A really long string that should be longer than the listbox that contains this message, so I can enable the horizontal scrollbar!"
SendMessage $ReleaseNotesText ${WM_GETFONT} 0 0 $R0
System::Call user32::GetDC(i$ReleaseNotesText)i.R1
System::Call gdi32::SelectObject(i$R1,i$R0)i.R0
System::Call *(i,i)i.r0
StrCpy $2 0
${NSD_LB_GetCount} $ReleaseNotesText $1
loop:
IntOp $1 $1 - 1
System::Call 'user32::SendMessage(i $ReleaseNotesText,i ${LB_GETTEXT},i $1,t.r3)'
StrLen $4 $3
System::Call 'gdi32::GetTextExtentPoint32(i $R1,t "$3",i $4,i $0)'
System::Call *$0(i.r4,i)
IntOp $4 $4 + 10 ;add a little padding
${IfThen} $4 > $2 ${|} StrCpy $2 $4 ${|}
IntCmp $1 0 "" "" loop
System::Free $0
System::Call gdi32::SelectObject(i$R1,i$R0)i
System::Call user32::ReleaseDC(i$ReleaseNotesText,i$R1)
SendMessage $ReleaseNotesText ${LB_SETHORIZONTALEXTENT} $2 0
nsDialogs::show
FunctionEnd
免责声明:根据《计算机软件保护条例》第十七条规定“为了学习和研究软件内含的设计思想和原理,通过安装、显示、传输或者存储软件等方式使用软件的,可以不经软件著作权人许可,不向其支付报酬。”您需知晓本站所有内容资源均来源于网络,仅供用户交流学习与研究使用,版权归属原版权方所有,版权争议与本站无关,用户本人下载后不能用作商业或非法用途,需在24个小时之内从您的电脑中彻底删除上述内容,否则后果均由用户承担责任;如果您访问和下载此文件,表示您同意只将此文件用于参考、学习而非其他用途,否则一切后果请您自行承担,如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。丨本站为个人博客非盈利性站点,所有软件信息均来自网络,所有资源仅供学习参考研究目的,并不贩卖软件,不存在任何商业目的及用途。丨本文采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权BY-NC-SA协议进行授权

转载请注明:永恒心锁-分享互联网 » 创建文本框横向滚动条

您必须 登录 才能发表评论!