Цитата K.A.V.:
попробуй добавить в свой любимый ListBox горизонтальную прокрутку »
|
Это, как раз, давно придумано :
Код:

OutFile ListBox_H-Scroll.exe
!include nsDialogs.nsh
Var Dialog
Var ReleaseNotesText
Page custom MyPage
Function MyPage
nsDialogs::Create 1018
Pop $Dialog
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
Section
SectionEnd
Да. Громозда... Но зато без IO !
