Yes Charles
What i have is old code from ionicwind forum...only
because i have lost latest binder code...
so here is CB code:
'Exe binder ,Thanks to Johnny ....
Def w1:window
DECLARE "kernel32",SetFileAttributesA(lpFileName AS STRING,dwFileAttributes AS INT),INT
CONST FILE_ATTRIBUTE_ARCHIVE = 0x20
CONST FILE_ATTRIBUTE_NORMAL = 0x80
CONST FILE_EXECUTE = 0x20
'declare variables
def runtimeExe:BFILE
def sourceCode:BFILE
def NewExe:BFILE
def membuffer:memory
def membuffer2:memory
def runtimesize:INT
def sourcesize:INT
def newsize:int
def zero:char
def sizeMembuffer:INT
def runtimeName:string
def sourceName:string
def finalSize:INT
'open window
Window w1,0,0,500,400,@minbox,0,"MainGUI",main
Setwindowcolor w1,rgb(200,200,205)
CONTROL w1,"B,LoadRuntimeExe,56,50,120,20,0,1"
Setfont w1,"MS Sans Serif",8,400,0,1
CONTROL w1,"B,LoadSourceCode,56,100,120,20,0,2"
Setfont w1,"MS Sans Serif",8,400,0,2
CONTROL w1,"B,SaveBindedExe,56,150,120,20,0,3"
Setfont w1,"MS Sans Serif",8,400,0,3
'--------------------------------------------------------
'--------------------------------------------------------
run=1
waituntil run=0
'stoptimer w1
'Free the memory in case this was allocated before ending the program
IF Len(membuffer)>0 then FreeMem membuffer
IF Len(membuffer2)>0 then FreeMem membuffer2
closewindow w1
end
'-------------------------------------------------------
Sub main
Select @class
Case @idclosewindow
run=0
'/////////////////////////////////////////////////////////
case @IDCONTROL
IF @CONTROLID = 1
LoadRuntime()
ENDIF
IF @CONTROLID = 2
LoadSource()
ENDIF
IF @CONTROLID = 3
CreateExe()
ENDIF
'////////////////////////////////////////////////////////
Endselect
Return
'-------------------------------------------------------
' load Runtime to memory
SUB LoadRuntime
zero=0
IF (Openfile(runtimeExe,"C:\minGUI.exe","R") = 0)
runtimesize = Len(runtimeExe) :'runtime=FileSize(runtimeexe)
Messagebox 0,"RuntimeLen(bytes):"+str$(runtimesize),"RUNTIME SIZE"
AllocMem membuffer,1,runtimesize
READ(runtimeExe,membuffer)
Messagebox 0,"MEMbuffersize(bytes):"+str$(Len(membuffer)),"R-MEMBUFFER SIZE"
CloseFile runtimeExe
ENDIF
RETURN
'-----------------------------------------------------
'load Source to memory
SUB LoadSource
zero=0
IF (Openfile(sourceCode,"C:\CaptionString.abp","R") = 0)
sourcesize = Len(sourceCode) :'sourcesize=FileSize(sourcecode)
Messagebox 0,"SourceLen(bytes):"+str$(sourcesize),"SOURCE CODE SIZE"
AllocMem membuffer2,1,sourcesize
READ(sourceCode,membuffer2)
Messagebox 0,"CompleteLen(bytes):"+str$(LEN(membuffer2)),"MEMBUFFER-COMPLETE-SIZE"
CloseFile sourceCode
ENDIF
RETURN
'-----------------------------------------------------
'Create Exe / Write final exe to disk
SUB CreateExe
'Check first that both buffers are already filled with data before writing to a new file
IF runtimesize > 0 & sourcesize > 0
newsize = runtimesize + sourcesize
Messagebox 0,"CompleteLen(bytes):"+str$(newsize),"COMPLETE-SIZE"
IF (Openfile(newExe,"C:\MRuntime.exe","W") = 0)
Write newexe,membuffer,membuffer2
finalsize=Seek(newexe)
CloseFile newexe
Messagebox 0,"FinalLen(bytes):"+str$(finalsize),"BINDED EXE SIZE"
ENDIF
ENDIF
RETURN