View Single Post
Old 11th March 2008, 21:52   #11
vbguy
Junior Member
 
Join Date: Jul 2006
Posts: 30
You need to replace the hwnd to point to your added text box (or rich text box):

PHP Code:
Var txtLicense ;textbox handle
Var LicFile ;pointer to the license file in memory

!macro addLicense
    
${If} $LicFile == ""
        
ClearErrors
        System
::Call 'kernel32::CreateFile(t "$PLUGINSDIR\\EULA.rtf", i 0x80000000, i 1, i 0, i 3, i 0, i 0) i .r0'
        
IfErrors exit
        
        ;
allocate memory for the file
        System
::Call 'kernel32::GetFileSize(i r0, i 0) i .r1'
        
System::Alloc $1
        Pop 
$2
        
        
;read the file into memory
        System
::Call 'kernel32::ReadFile(i r0, i r2, i r1, *i .r3, i 0)'
        
System::Call 'kernel32::CloseHandle(i r0)'
        
        
Push $2            ;Push the License memory location to stack
        Pop $LicFile 
;Pop the License memory loc to the variable LicFile
    
${EndIf}
    
    ;
White backgroundblack text
    SetCtlColors $txtLicense 0x000000 0x00FFFFFF
    
    SendMessage $txtLicense 
${WM_SETTEXT0 $LicFile

    
exit:
!
macroend 
Then, deallocate the memory when the installer closes:

PHP Code:
Function .onGUIEnd
    System
::Free $LicFile ;clear the memory allocated for the license file
FunctionEnd 
vbguy is offline   Reply With Quote