View Single Post
Old 12th May 2009, 12:45   #25
grundic
Junior Member
 
Join Date: May 2009
Posts: 14
I made a test file:

PHP Code:
!include nsDialogs.nsh
!include LogicLib.nsh


OutFile test
.exe

Var Dialog
Var txtLicense


Page custom nsDialog

Function nsDialog
        nsDialogs
::Create 1018
    Pop $Dialog

    
${If} $Dialog == error
        Abort
    
${EndIf}
    
    
nsDialogs::CreateControl /NOUNLOAD RichEdit20A  ${WS_VISIBLE}|${WS_CHILD}|${WS_TABSTOP}|${WS_VSCROLL}|${ES_MULTILINE}|${ES_WANTRETURN} ${__NSD_Text_EXSTYLE0 10u 10090u ''
        
Pop $txtLicense

        call lic
    nsDialogs
::Show
    
    
FunctionEnd

!define SF_RTF 2
!define EM_STREAMIN 1097
;!define EM_EXLIMITTEXT 1077
Function lic
         MessageBox MB_OK 
"Inside function"
    
FileOpen $"test.rtf" r
    FindWindow 
$"#32770" "" $HWNDPARENT
    GetDlgItem 
$$0 1000
    SendMessage 
$${EM_EXLIMITTEXT0 0x7fffffff
    System
::Get /NoUnload "(i, i .R0, i .R1, i .R2) iss"
    
Pop $2
    System
::Call /NoUnload "*(i 0, i 0, k r2) i .r3"
    
System::Call /NoUnload "user32::SendMessage(i r0, i ${EM_STREAMIN}, i ${SF_RTF}, i r3) i.s"
    
loop:
        
Pop $0
        StrCmp 
$"callback1" 0 done
        System
::Call /NoUnload "kernel32::ReadFile(i $4, i $R0, i $R1, i $R2, i 0)"
        
Push 0 # callback's return value
        
System::Call /NoUnload "$2"
        
goto loop
    done
:
    
System::Free $2
    System
::Free $3
    FileClose 
$4
FunctionEnd

Section
       
SectionEnd 
But nothing was shown in RichEdit. What am I doing wrong?
Also, anybody say how can I show custom text in RichEdit without using RTF file?

Thanks in advance!
grundic is offline   Reply With Quote