` Printed Icetips Article

Icetips Article



Windows API: Save screenshot of web page
2006-04-13 -- Menno De Ruiter
 
Editors note:  This contains over 800 lines of code, most of which are
commented out.  Some lines are long and may break.  This is posted as is and
no editing or testing/verification of the code has been made.  

>I want to scale down a web page (determined by a URL) and display it as an
>image on a Clarion control of some sort - maybe I am dreaming !


.. in combination with Capesoft FileExplorer i use this..

MakeDC      Routine

            Data


TV          Group,pre(),Dim(2)
TV_X            long
TV_Y            long
TV_R            ushort
TV_G            ushort
TV_B            ushort
TV_A            ushort
            End

RV          Group,pre()
RV_X            ULong
RV_Y            ULong
            End

returnval   long



            Code

            barsSheet_BkGndDCHnd                = GetWindowDC(ThisIEWin{Prop:Handle})
            TBar_BkGndDCHnd                     =
CreateCompatibleDC(barsSheet_BkGndDCHnd)
            R#                                  =
ReleaseDC(ThisIEWin{Prop:Handle},barsSheet_BkGndDCHnd)
            X#                                  = SetMapMode(TBar_BkGndDCHnd,MM_TEXT)

            TBar_BFH.TBar_BFHType               = 19778
            TBar_BFH.TBar_BFHSize               = 0
            TBar_BFH.TBar_BFHReserved1          = 0
            TBar_BFH.TBar_BFHReserved2          = 0
            TBar_BFH.TBar_BFHOffBits            = 54

            TBar_BIH.TBar_BIHSize               = Size(TBar_BIH)
            TBar_BIH.TBar_BIHWidth              = ?feControl{Prop:Width} - 20
            TBar_BIH.TBar_BIHHeight             = TotalPages * 800
            TBar_BIH.TBar_BIHPlanes             = 1
            TBar_BIH.TBar_BIHBitCount           = 24
            TBar_BIH.TBar_BIHCompression        = 0
            TBar_BIH.TBar_BIHSizeImage          = 0
            TBar_BIH.TBar_BIHXPelsPerMeter      = 0
            TBar_BIH.TBar_BIHYPelsPerMeter      = 0
            TBar_BIH.TBar_BIHClrUsed            = 0
            TBar_BIH.TBar_BIHClrImportant       = 0
            TBar_DIBSectionHnd                  =
CreateDIBSection(TBar_BkGndDCHnd,Address(TBar_BIH),0,Address(TBar_Ptr_DIBits),0,0)
            ReturnVal                           =
SelectObject(TBar_BkGndDCHnd,TBar_DIBSectionHnd)



...and something like this in the time (look at the bitblt)

!!!    If IndexFilesFromProxyFilesBOOL = True
!!!        Do IndexFilesFromProxyFilesLOOP
!!!    End

        !If GoPrn = True
            If SendStop = True
                SendStop = False
                ThisViewer2.Stop()
            End
            If TotalPages <> 3
                TotalPages = 3
            End

            If DoBitBlt = False
                Case StartPrinting
                Of 1
                    SavedPage = False
                    CurrentPage = 0
                    Do MakeDC
                    StartPrinting = 2
                    CurrentPage = 1
                    NewPage = CurrentPage
                Of TotalPages
                    Do SaveDC
                    StartPrinting = 0
                    CurrentPage = 0
                    SavedPage = True
                    NewPage = CurrentPage
                    ThisIEWin{Prop:YPos} = DefaultY
                Else
                    If StartPrinting > 0 And StartPrinting < TotalPages
                        HeightNow = 800
!                        Execute CurrentPage
                            ThisIEWin{Prop:YPos} = DefaultY
!                            ThisIEWin{Prop:YPos} = DefaultY-(HeightNow*1)
!                            ThisIEWin{Prop:YPos} = DefaultY-(HeightNow*2)
!                            ThisIEWin{Prop:YPos} = DefaultY-(HeightNow*3)
!                            ThisIEWin{Prop:YPos} = DefaultY-(HeightNow*4)
!                            ThisIEWin{Prop:YPos} = DefaultY-(HeightNow*5)
!                            ThisIEWin{Prop:YPos} = DefaultY-(HeightNow*6)
!                            ThisIEWin{Prop:YPos} = DefaultY-(HeightNow*7)
!                            ThisIEWin{Prop:YPos} = DefaultY-(HeightNow*8)
!                            ThisIEWin{Prop:YPos} = DefaultY-(HeightNow*9)
!                            ThisIEWin{Prop:YPos} = DefaultY-(HeightNow*10)
!                            ThisIEWin{Prop:YPos} = DefaultY-(HeightNow*11)
!                            ThisIEWin{Prop:YPos} = DefaultY-(HeightNow*12)
!                            ThisIEWin{Prop:YPos} = DefaultY-(HeightNow*13)
!                            ThisIEWin{Prop:YPos} = DefaultY-(HeightNow*14)
!                            ThisIEWin{Prop:YPos} = DefaultY-(HeightNow*15)
!                        End
                        DoBitBltTimeOut = Clock() + 30
                        DoBitBlt =True
                        NewPage = CurrentPage
                    End
                End
            End
            If DoBitBlt = True And DoBitBltTimeOut < Clock() And StillLoading = False
                DoBitBlt = False
                barsSheet_BkGndDCHnd = GetDC(ThisIEWin{Prop:Handle})
                X# =
BitBlt(TBar_BkGndDCHnd,0,0,TBar_BIH.TBar_BIHWidth,TBar_BIH.TBar_BIHHeight,barsSheet_BkGndDCHnd,0,0,SRCCOPY)

!                Y# = 0
!                C# = 0
!                Loop 18 Times
!                    C# = C# + 1
!                    If C# = (CurrentPage)
!                        If TBar_BkGndDCHnd <> 0
!                            !If CurrentPage = 1
!                            !    X# =
BitBlt(TBar_BkGndDCHnd,0,(CurrentPage*800)-800-4,TBar_BIH.TBar_BIHWidth-8,800,barsSheet_BkGndDCHnd,0,(CurrentPage*800)-800-4,SRCCOPY)
!                            !Else
!                                X# =
BitBlt(TBar_BkGndDCHnd,0,0,TBar_BIH.TBar_BIHWidth,TBar_BIH.TBar_BIHHeight,barsSheet_BkGndDCHnd,0,0,SRCCOPY)
!                            !End
!                            PrintScreened = PrintScreened + 1
!                        Else
!                            message('dc error')
!                        End
!                        Break
!                    End
!                End
                R# = ReleaseDC(ThisIEWin{Prop:Handle},barsSheet_BkGndDCHnd)
                StartPrinting = StartPrinting + 1
                CurrentPage = CurrentPage + 1
            End
            If NewSiteNumber > 0
                If NewSiteNumber <> OldSiteNumber
                    OldSiteNumber = NewSiteNumber
                    Scanned = False
                    !?ListQSites{Prop:Selected} = NewSiteNumber

                    Get(QSites,NewSiteNumber)

        !                Sit:Number = QSit:Number
        !                Share(Sites)
        !                Get(Sites,Sit:IX_Sites_Number)
        !                !Sit:IX_Sites_URL
        !                TheFolderNow = Clip(Sit:URL)
        !                !Do cBulletinCreate2

                        URL2Go = Clip(QSit:URL)
                        Change(?fePath, URL2Go)
                        ThisViewer2.Load (URL2Go)
                        ThisViewer2.fe_Path = Clip(URL2Go)
                        StillLoading = True

                End
            End
        !End


!    If ScreenPrinted = False
!        If ScreenPrintTimeOut < Clock()
!            ScreenPrinted = True
!            Do PrintScreenIE
!        End
!    End

!!    If RetrieveFileData = True
!        SearchString = '.js'
!        !G = 0
!        Loop 1 Times
!            G = G + 1
!            If G > 1000
!                StartRetrieveFileData = 0
!                Break
!            End
!            Get(QTasks,G)
!
!            Dos64kFileName =  URL2Go
!
!            Share(Dos64kFile)
!            Set(Dos64kFile)
!
!            Clear(ReadData)
!            T# = 1
!            S# = Bytes(Dos64kFile)
!            Loop
!                Next(Dos64kFile)
!                If Errorcode() <> 0
!                    ef# = True
!                End
!                ReadData[T# : T# + 64000 -1] = Dos64kPre:Line
!                If ef# = True
!                    break
!                End
!                T# = T# + 64000
!                If T# + 64000 > Size(ReadData) then break.
!            End
!
!            QFFiles:QSitesNumber      = QSit:Number
!
!!!!                    QFFiles:FileAndPathName    = Clip(Left(QFFiles:FileAndPathName))
!!            QSit:Number = QFFiles:QSitesNumber
!!            Get(QSites,+QSit:Number)
!
!
!            V# = False
!            P = 0
!            l2# = len(clip(ReadData))
!            L = Len(clip(SearchString))
!            Loop
!                P = P + 1
!                If P > l2#
!                    Break
!                End
!                If Lower(Clip(SearchString)) = Lower(ReadData[P : P + L-1])
!                    QFFiles:FileAndPathName = ''
!                    P2# = P + L - 1
!                    Loop
!                        P2# = P2# - 1
!                        If P2# = 0 then break.
!                        If ReadData[P2#] = '"' Or ReadData[P2#] = '''' Or ReadData[P2#] =
'='
!                            QFFiles:FileAndPathName = ReadData[P2# +1 : P + L-1]
!                            Break
!                        End
!                    End
!
!
!
!!!                    P2# = Len(Clip(QFFiles:FileAndPathName)) + 1
!!!                    Loop
!!!                        P2# = P2# - 1
!!!                        If P2# = 0
!!!                            Break
!!!                        End
!!!                        If QFFiles:FileAndPathName[P2#] = '/'
!!!                            Break
!!!                        End
!!!                    End
!!!
!!!!                    S# = 0
!!!!                    Loop
!!!!                        S# = S# + 1
!!!!                        If S# > len(clip(QFFiles:FolderName)) then break.
!!!!                        If Lower(QSit:URL[1 : S#]) <> Lower(QFFiles:FileAndPathName[1
: S#])
!!!!                            Break
!!!!                        End
!!!!                    End
!!!!                    If S# > 1
!!!!                        QFFiles:FileAndPathName = QFFiles:FileAndPathName[S# :
Size(QFFiles:FileAndPathName)]
!!!!                    End
!!!
!!!
!!!                    QFFiles:FileName = ''
!!!                    QFFiles:FolderName = ''
!!!                    If P2# > 1
!!!                        QFFiles:FileName       = QFFiles:FileAndPathName[P2# + 1 :
Size(QFFiles:FileAndPathName)]
!!!                        QFFiles:FolderName     = QFFiles:FileAndPathName[1 : P2# -1]
!!!                    Else
!!!                        QFFiles:FileName       = QFFiles:FileAndPathName
!!!                    End
!!!
!!!                    QFFiles:QSitesNumber      = QTasks:ForumNumber
!!!!!                    QFFiles:FileAndPathName    = Clip(Left(QFFiles:FileAndPathName))
!!!                    QSit:Number = QFFiles:QSitesNumber
!!!                    Get(QSites,+QSit:Number)
!
!
!                    QFFiles:URL = QSit:URL
!                    If Lower(QFFiles:URL[1 : 11]) <> 'http://www.'
!                        If Lower(QFFiles:FileAndPathName[1 : 11]) = 'http://www.'
!                            QFFiles:FileAndPathName = 'http://' &
QFFiles:FileAndPathName[12 : Size(QFFiles:FileAndPathName)]
!                        End
!                    End
!                    If Lower(QFFiles:FileAndPathName[1 : 7]) <> 'http://'
!                        QFFiles:FileAndPathName = Clip(QSit:URL) &
Clip(QFFiles:FileAndPathName)
!                    End
!!                    If QFFiles:FileAndPathName[1 : 2] = '//'
!!                        QFFiles:FileAndPathName = QFFiles:FileAndPathName[ 2 :
Size(QFFiles:FileAndPathName)]
!!                    End
!                    If QFFiles:FileAndPathName[1] = '/'
!                        QFFiles:FileAndPathName = QFFiles:FileAndPathName[ 3 :
Size(QFFiles:FileAndPathName)]
!                    End
!                    If QFFiles:FileAndPathName[1 : 3] = '../'
!                        QFFiles:FileAndPathName = QFFiles:FileAndPathName[ 4 :
Size(QFFiles:FileAndPathName)]
!                    End
!                    If QFFiles:FileAndPathName[1 : 2] = '..'
!                        QFFiles:FileAndPathName = QFFiles:FileAndPathName[ 3 :
Size(QFFiles:FileAndPathName)]
!                    End
!
!
!                    P# = 8
!                    L# = Len(Clip(QFFiles:FileAndPathName))
!                    Loop
!                        P# = P# + 1
!                        If (P# + 1) > L#
!                            break
!                        End
!                        If QFFiles:FileAndPathName[P# : P# + 1] = '//'
!                            QFFiles:FileAndPathName = QFFiles:FileAndPathName[1 : P#] &
QFFiles:FileAndPathName[P# + 2 : Size(QFFiles:FileAndPathName)]
!                            P# = 8
!                        End
!                    End
!
!
!
!!!
!!!                    Get(QFFiles,QFFiles:QSitesNumber,QFFiles:FileAndPathName)
!!!                    F# = False
!!!                    If QFFiles:FileAndPathName[1 : 3] = '../'
!!!                        QFFiles:FileAndPathName = Clip(QSit:URL) &
Clip(QFFiles:FileAndPathName[4 : Size(QFFiles:FileAndPathName)])
!!!                        F# = True
!!!                    End
!!!                    If QFFiles:FileAndPathName[1] = '/'
!!!                        QFFiles:FileAndPathName = Clip(QSit:URL) &
Clip(QFFiles:FileAndPathName[2 : Size(QFFiles:FileAndPathName)])
!!!                        F# = True
!!!                    End
!!!
!!!
!!!!!!                    If F# = False
!!!!!!                        If lower(QFFiles:FileAndPathName[1 : 4]) <> 'http'
!!!!!!                            QFFiles:FileAndPathName = Clip(QSit:URL) &
Clip(QFFiles:FileAndPathName[1 : Size(QFFiles:FileAndPathName)])
!!!!!!                            F# = True
!!!!!!                        End
!!!!!!                    End
!!!!                    If Clip(Lower(QTasks:Folder)) = Lower(QFFiles:FolderName[1 :
len(clip(QTasks:Folder))])
!!!!                        QFFiles:FolderName =
QFFiles:FolderName[len(clip(QTasks:Folder)) + 1 : Size(QFFiles:FolderName) ]
!!!!                    End
!!!
!!!
!                    S# = 0
!                    Loop
!                        S# = S# + 1
!                        If S# > len(clip(QFFiles:FileAndPathName)) then break.
!                        If Lower(QSit:URL[1 : S#]) <> Lower(QFFiles:FileAndPathName[1 :
S#])
!                            Break
!                        End
!                    End
!                    If S# > 1
!                        QFFiles:FolderName = QFFiles:FileAndPathName[S# :
Size(QFFiles:FileAndPathName)]
!                    End
!
!
!
!
!                    P2# = Len(Clip(QFFiles:FolderName)) + 1
!                    Loop
!                        P2# = P2# - 1
!                        If P2# = 0
!                            Break
!                        End
!                        If QFFiles:FolderName[P2#] = '/'
!                            Break
!                        End
!                    End
!                    QFFiles:FileName = ''
!                    If P2# > 1
!                        QFFiles:FileName       = QFFiles:FolderName[P2# + 1 :
Size(QFFiles:FolderName)]
!                        QFFiles:FolderName     = QFFiles:FolderName[1 : P2# -1]
!                    Else
!                        QFFiles:FileName       = QFFiles:FolderName
!                        QFFiles:FolderName     = ''
!                    End
!
!
!                    L# = Len(Clip(QSit:URL))
!
!                    If Lower(QSit:URL[1 : L#]) = Lower(QFFiles:FileAndPathName[1 : L#])
!                        Get(QFFiles,QFFiles:QSitesNumber,QFFiles:FileAndPathName)
!                        If Errorcode() <> 0
!                            QFFiles:Number = QFFiles:Number + 1
!!                            If QFFiles:FileAndPathName[1:4] = 'http'
!                               QFFiles:URL = QFFiles:FileAndPathName
!!                            Else
!!                                QFFiles:URL = Clip(QSit:URL) & '/' &
QFFiles:FileAndPathName
!!                            End
!                            Add(QFFiles,+QFFiles:QSitesNumber,+QFFiles:FileAndPathName)
!
!!!!                            ForTas:Number           = ForTas:NumberMax + 1
!!!!                            ForTas:Number           = ForTas:NumberMax
!!!!                            ForTas:ToDo             = True
!!!!                            ForTas:Doing            = 0
!!!!                            ForTas:Done             = 0
!!!!                            ForTas:Failed           = 0
!!!!                            ForTas:Pending          = 0
!!!!                            ForTas:Started          = 0
!!!!                            ForTas:Succeeded        = 0
!!!!                            ForTas:ToTwa            = 0
!!!!                            ForTas:Deployed         = 0
!!!!                            ForTas:IE               = 0
!!!!                            ForTas:IECustom         = 0
!!!!                            ForTas:NW               = True
!!!!                            ForTas:NWCustom         = 0
!!!!                            ForTas:ForumNumber      = Sit:Number
!!!!
!!!!                            ForTas:FileName         = QFFiles:FileName
!!!!                            ForTas:PROXYFileName    = QFFiles:FileName
!!!!
!!!!!                            Clear(InterString512)
!!!!!                            Clear(ForURL)
!!!!!
!!!!!!                            ForTas:FileName         = 'index.php'
!!!!!!                            ForTas:PROXYFileName    = 'index.htm'
!!!!!
!!!!!                            Sit:URL = Clip(Sit:URL)
!!!!!                            ForURL = Sit:URL
!!!!!
!!!!!
!!!!!                            P# = 0
!!!!!                            TP# = 1
!!!!!                            Loop Len(Clip(ForURL)) Times
!!!!!                                P# = P# + 1
!!!!!                                If Val(ForURL[P#]) = 32
!!!!!                                    InterString512[TP#] = Chr(32)
!!!!!                                    TP# = TP# + 1
!!!!!                                    Cycle
!!!!!                                End
!!!!!                                If Val(UPPER(ForURL[P#])) >= 65 And
Val(UPPER(ForURL[P#])) =< 90
!!!!!                                    InterString512[TP#] = ForURL[P#]
!!!!!                                    TP# = TP# + 1
!!!!!                                Else
!!!!!                                    If Val(UPPER(ForURL[P#])) >= 30h And
Val(UPPER(ForURL[P#])) =< 39h
!!!!!                                        InterString512[TP#] = ForURL[P#]
!!!!!                                        TP# = TP# + 1
!!!!!                                    Else
!!!!!                                        InterString512[TP#] = '_'
!!!!!                                        TP# = TP# + 1
!!!!!                                    End
!!!!!                                End
!!!!!                            End
!!!!!                            N" = Format(ForTas:ForumNumber,@N08)
!!!!
!!!!                            ForTas:Folder           = QTasks:Folder & '/' &
QFFiles:FolderName
!!!!                            ForTas:Parameters       = ''
!!!!                            ForTas:FunctionName     = 'RetrieveToProxy'
!!!!                            ForTas:PostURL          = Clip(Sit:URL) & '/' &
QFFiles:FolderName
!!!!                            ForTas:InstructionLine  = ''
!Clip(ForTas:FunctionName) & '(' & Clip(Sit:URL) & Clip(ForTas:FileName) & ',' & DRIVE &
':\Proxy\' & Clip(ForTas:Folder) & '\' & Clip(ForTas:FileName) & ')'
!!!!                            Add(Forum_Tasks)
!!!!                            Cycle
!!!!                        End
!!!!                        Flush(Forum_Tasks)
!!!!                        Message('done')
!!!!
!!!!
!
!
!                        End
!                    Else
!                        Cycle
!                    End
!                End
!            End
!
!            Close(Dos64kFile)
!        End
!    End
!
!
!    End


!    If StartRetrieveFileData = True
!        SearchString = '.js'
!        !G = 0
!        Loop 1 Times
!            G = G + 1
!            If G > 1000
!                StartRetrieveFileData = 0
!                Break
!            End
!            Get(QTasks,G)
!
!            Dos64kFileName = DRIVE & ':\Proxy\' & Clip(QTasks:Folder) & '\' &
Clip(QTasks:PROXYFileName)
!
!            Share(Dos64kFile)
!            Set(Dos64kFile)
!
!            Clear(ReadData)
!            T# = 1
!            S# = Bytes(Dos64kFile)
!            Loop
!                Next(Dos64kFile)
!                If Errorcode() <> 0
!                    ef# = True
!                End
!                ReadData[T# : T# + 64000 -1] = Dos64kPre:Line
!                If ef# = True
!                    break
!                End
!                T# = T# + 64000
!                If T# + 64000 > Size(ReadData) then break.
!            End
!
!                    QFFiles:QSitesNumber      = QTasks:ForumNumber
!!!                    QFFiles:FileAndPathName    = Clip(Left(QFFiles:FileAndPathName))
!                    QSit:Number = QFFiles:QSitesNumber
!                    Get(QSites,+QSit:Number)
!
!
!            V# = False
!            P = 0
!            l2# = len(clip(ReadData))
!            L = Len(clip(SearchString))
!            Loop
!                P = P + 1
!                If P > l2#
!                    Break
!                End
!                If Lower(Clip(SearchString)) = Lower(ReadData[P : P + L-1])
!                    QFFiles:FileAndPathName = ''
!                    P2# = P + L - 1
!                    Loop
!                        P2# = P2# - 1
!                        If P2# = 0 then break.
!                        If ReadData[P2#] = '"' Or ReadData[P2#] = '''' Or ReadData[P2#] =
'='
!                            QFFiles:FileAndPathName = ReadData[P2# +1 : P + L-1]
!                            Break
!                        End
!                    End
!
!!!                    P2# = Len(Clip(QFFiles:FileAndPathName)) + 1
!!!                    Loop
!!!                        P2# = P2# - 1
!!!                        If P2# = 0
!!!                            Break
!!!                        End
!!!                        If QFFiles:FileAndPathName[P2#] = '/'
!!!                            Break
!!!                        End
!!!                    End
!!!
!!!!                    S# = 0
!!!!                    Loop
!!!!                        S# = S# + 1
!!!!                        If S# > len(clip(QFFiles:FolderName)) then break.
!!!!                        If Lower(QSit:URL[1 : S#]) <> Lower(QFFiles:FileAndPathName[1
: S#])
!!!!                            Break
!!!!                        End
!!!!                    End
!!!!                    If S# > 1
!!!!                        QFFiles:FileAndPathName = QFFiles:FileAndPathName[S# :
Size(QFFiles:FileAndPathName)]
!!!!                    End
!!!
!!!
!!!                    QFFiles:FileName = ''
!!!                    QFFiles:FolderName = ''
!!!                    If P2# > 1
!!!                        QFFiles:FileName       = QFFiles:FileAndPathName[P2# + 1 :
Size(QFFiles:FileAndPathName)]
!!!                        QFFiles:FolderName     = QFFiles:FileAndPathName[1 : P2# -1]
!!!                    Else
!!!                        QFFiles:FileName       = QFFiles:FileAndPathName
!!!                    End
!!!
!!!                    QFFiles:QSitesNumber      = QTasks:ForumNumber
!!!!!                    QFFiles:FileAndPathName    = Clip(Left(QFFiles:FileAndPathName))
!!!                    QSit:Number = QFFiles:QSitesNumber
!!!                    Get(QSites,+QSit:Number)
!
!
!                    QFFiles:URL = QSit:URL
!                    If Lower(QFFiles:URL[1 : 11]) <> 'http://www.'
!                        If Lower(QFFiles:FileAndPathName[1 : 11]) = 'http://www.'
!                            QFFiles:FileAndPathName = 'http://' &
QFFiles:FileAndPathName[12 : Size(QFFiles:FileAndPathName)]
!                        End
!                    End
!                    If Lower(QFFiles:FileAndPathName[1 : 7]) <> 'http://'
!                        QFFiles:FileAndPathName = Clip(QSit:URL) &
Clip(QFFiles:FileAndPathName)
!                    End
!!                    If QFFiles:FileAndPathName[1 : 2] = '//'
!!                        QFFiles:FileAndPathName = QFFiles:FileAndPathName[ 2 :
Size(QFFiles:FileAndPathName)]
!!                    End
!                    If QFFiles:FileAndPathName[1] = '/'
!                        QFFiles:FileAndPathName = QFFiles:FileAndPathName[ 3 :
Size(QFFiles:FileAndPathName)]
!                    End
!                    If QFFiles:FileAndPathName[1 : 3] = '../'
!                        QFFiles:FileAndPathName = QFFiles:FileAndPathName[ 4 :
Size(QFFiles:FileAndPathName)]
!                    End
!                    If QFFiles:FileAndPathName[1 : 2] = '..'
!                        QFFiles:FileAndPathName = QFFiles:FileAndPathName[ 3 :
Size(QFFiles:FileAndPathName)]
!                    End
!
!
!                    P# = 8
!                    L# = Len(Clip(QFFiles:FileAndPathName))
!                    Loop
!                        P# = P# + 1
!                        If (P# + 1) > L#
!                            break
!                        End
!                        If QFFiles:FileAndPathName[P# : P# + 1] = '//'
!                            QFFiles:FileAndPathName = QFFiles:FileAndPathName[1 : P#] &
QFFiles:FileAndPathName[P# + 2 : Size(QFFiles:FileAndPathName)]
!                            P# = 8
!                        End
!                    End
!
!
!
!!!
!!!                    Get(QFFiles,QFFiles:QSitesNumber,QFFiles:FileAndPathName)
!!!                    F# = False
!!!                    If QFFiles:FileAndPathName[1 : 3] = '../'
!!!                        QFFiles:FileAndPathName = Clip(QSit:URL) &
Clip(QFFiles:FileAndPathName[4 : Size(QFFiles:FileAndPathName)])
!!!                        F# = True
!!!                    End
!!!                    If QFFiles:FileAndPathName[1] = '/'
!!!                        QFFiles:FileAndPathName = Clip(QSit:URL) &
Clip(QFFiles:FileAndPathName[2 : Size(QFFiles:FileAndPathName)])
!!!                        F# = True
!!!                    End
!!!
!!!
!!!!!!                    If F# = False
!!!!!!                        If lower(QFFiles:FileAndPathName[1 : 4]) <> 'http'
!!!!!!                            QFFiles:FileAndPathName = Clip(QSit:URL) &
Clip(QFFiles:FileAndPathName[1 : Size(QFFiles:FileAndPathName)])
!!!!!!                            F# = True
!!!!!!                        End
!!!!!!                    End
!!!!                    If Clip(Lower(QTasks:Folder)) = Lower(QFFiles:FolderName[1 :
len(clip(QTasks:Folder))])
!!!!                        QFFiles:FolderName =
QFFiles:FolderName[len(clip(QTasks:Folder)) + 1 : Size(QFFiles:FolderName) ]
!!!!                    End
!!!
!!!
!                    S# = 0
!                    Loop
!                        S# = S# + 1
!                        If S# > len(clip(QFFiles:FileAndPathName)) then break.
!                        If Lower(QSit:URL[1 : S#]) <> Lower(QFFiles:FileAndPathName[1 :
S#])
!                            Break
!                        End
!                    End
!                    If S# > 1
!                        QFFiles:FolderName = QFFiles:FileAndPathName[S# :
Size(QFFiles:FileAndPathName)]
!                    End
!
!
!
!
!                    P2# = Len(Clip(QFFiles:FolderName)) + 1
!                    Loop
!                        P2# = P2# - 1
!                        If P2# = 0
!                            Break
!                        End
!                        If QFFiles:FolderName[P2#] = '/'
!                            Break
!                        End
!                    End
!                    QFFiles:FileName = ''
!                    If P2# > 1
!                        QFFiles:FileName       = QFFiles:FolderName[P2# + 1 :
Size(QFFiles:FolderName)]
!                        QFFiles:FolderName     = QFFiles:FolderName[1 : P2# -1]
!                    Else
!                        QFFiles:FileName       = QFFiles:FolderName
!                        QFFiles:FolderName     = ''
!                    End
!
!
!                    L# = Len(Clip(QSit:URL))
!
!                    If Lower(QSit:URL[1 : L#]) = Lower(QFFiles:FileAndPathName[1 : L#])
!                        Get(QFFiles,QFFiles:QSitesNumber,QFFiles:FileAndPathName)
!                        If Errorcode() <> 0
!                            QFFiles:Number = QFFiles:Number + 1
!!                            If QFFiles:FileAndPathName[1:4] = 'http'
!                               QFFiles:URL = QFFiles:FileAndPathName
!!                            Else
!!                                QFFiles:URL = Clip(QSit:URL) & '/' &
QFFiles:FileAndPathName
!!                            End
!                            Add(QFFiles,+QFFiles:QSitesNumber,+QFFiles:FileAndPathName)
!
!!!!                            ForTas:Number           = ForTas:NumberMax + 1
!!!!                            ForTas:Number           = ForTas:NumberMax
!!!!                            ForTas:ToDo             = True
!!!!                            ForTas:Doing            = 0
!!!!                            ForTas:Done             = 0
!!!!                            ForTas:Failed           = 0
!!!!                            ForTas:Pending          = 0
!!!!                            ForTas:Started          = 0
!!!!                            ForTas:Succeeded        = 0
!!!!                            ForTas:ToTwa            = 0
!!!!                            ForTas:Deployed         = 0
!!!!                            ForTas:IE               = 0
!!!!                            ForTas:IECustom         = 0
!!!!                            ForTas:NW               = True
!!!!                            ForTas:NWCustom         = 0
!!!!                            ForTas:ForumNumber      = Sit:Number
!!!!
!!!!                            ForTas:FileName         = QFFiles:FileName
!!!!                            ForTas:PROXYFileName    = QFFiles:FileName
!!!!
!!!!!                            Clear(InterString512)
!!!!!                            Clear(ForURL)
!!!!!
!!!!!!                            ForTas:FileName         = 'index.php'
!!!!!!                            ForTas:PROXYFileName    = 'index.htm'
!!!!!
!!!!!                            Sit:URL = Clip(Sit:URL)
!!!!!                            ForURL = Sit:URL
!!!!!
!!!!!
!!!!!                            P# = 0
!!!!!                            TP# = 1
!!!!!                            Loop Len(Clip(ForURL)) Times
!!!!!                                P# = P# + 1
!!!!!                                If Val(ForURL[P#]) = 32
!!!!!                                    InterString512[TP#] = Chr(32)
!!!!!                                    TP# = TP# + 1
!!!!!                                    Cycle
!!!!!                                End
!!!!!                                If Val(UPPER(ForURL[P#])) >= 65 And
Val(UPPER(ForURL[P#])) =< 90
!!!!!                                    InterString512[TP#] = ForURL[P#]
!!!!!                                    TP# = TP# + 1
!!!!!                                Else
!!!!!                                    If Val(UPPER(ForURL[P#])) >= 30h And
Val(UPPER(ForURL[P#])) =< 39h
!!!!!                                        InterString512[TP#] = ForURL[P#]
!!!!!                                        TP# = TP# + 1
!!!!!                                    Else
!!!!!                                        InterString512[TP#] = '_'
!!!!!                                        TP# = TP# + 1
!!!!!                                    End
!!!!!                                End
!!!!!                            End
!!!!!                            N" = Format(ForTas:ForumNumber,@N08)
!!!!
!!!!                            ForTas:Folder           = QTasks:Folder & '/' &
QFFiles:FolderName
!!!!                            ForTas:Parameters       = ''
!!!!                            ForTas:FunctionName     = 'RetrieveToProxy'
!!!!                            ForTas:PostURL          = Clip(Sit:URL) & '/' &
QFFiles:FolderName
!!!!                            ForTas:InstructionLine  = ''
!Clip(ForTas:FunctionName) & '(' & Clip(Sit:URL) & Clip(ForTas:FileName) & ',' & DRIVE &
':\Proxy\' & Clip(ForTas:Folder) & '\' & Clip(ForTas:FileName) & ')'
!!!!                            Add(Forum_Tasks)
!!!!                            Cycle
!!!!                        End
!!!!                        Flush(Forum_Tasks)
!!!!                        Message('done')
!!!!
!!!!
!
!
!
!                        End
!                    Else
!                        Cycle
!                    End
!                End
!            End
!
!            Close(Dos64kFile)
!        End
!    End
!
!



and to save the image to disk

SaveDC      Routine



            TBar_DIBitsSize                 = Int((TBar_BIH.TBar_BIHWidth + 3)/4) * 4 *
TBar_BIH.TBar_BIHHeight * 4
            TBar_DIBits                    &= New( String(TBar_DIBitsSize) )
            TBar_DIBitsPointer              = Address(TBar_DIBits)

            TBar_BMPSize                    = Size(TBar_BFH) + Size(TBar_BIH) +
TBar_DIBitsSize
            TBar_BMPFile                   &= NEW(String(TBar_BMPSize))
            TBar_BMPPointer                 = Address(TBar_BMPFile)
            R# =
GetDIBits(TBar_BkGndDCHnd,TBar_DIBSectionHnd,0,TBar_BIH.TBar_BIHHeight,TBar_DIBitsPointer,Address(TBar_BIH),0)
            TBar_BMPFile[1 : Size(TBar_BFH)] = TBar_BFH
            TBar_BMPFile[Size(TBar_BFH) + 1 : Size(TBar_BFH) + Size(TBar_BIH)] = TBar_BIH
            TBar_BMPFile[Size(TBar_BFH) + 1 + Size(TBar_BIH) : Size(TBar_BFH) +
Size(TBar_BIH) + TBar_DIBitsSize] = TBar_DIBits[1 : TBar_DIBitsSize]

            !?Img2{PROP:ImageBits}      = TBar_BMPFile[1 : TBar_BMPSize]

            TheGlobalFile   = DRIVE & ':\' & Clip(QSit:ProxyFolderName) & '\' &
Format(QSit:ProxyFoldersNumber,@N08) & '.Bmp'
            L# = Len(Clip(TheGlobalFile))
            P# = 1
            Loop L# Times
                If TheGlobalFile[P#] = '/'
                    TheGlobalFile[P#] = '\'
                End
                P# = P# + 1
            End

            Dos64kFileName = Clip(TheGlobalFile)
            Create(Dos64kFile)
            Share(Dos64kFile)
            !Send(Dos64kFile,'FILEBUFFERS=10000')
            k64s# = Int(((Size(TBar_BMPFile))/64000))
            P# = 1
            Loop k64s# Times
                Dos64kPre:Line = TBar_BMPFile[P# : P# + 63999]
                Add(Dos64kFile)
                P# = P# + 64000
            End
            Close(Dos64kFile)
            !TheGlobalFile = 'raar'

!            DF1bName = Dos64kFileName
!            Share(DF1b)
!            Send(DF1b,'FILEBUFFERS=10000')
!            T# = (Size(TBar_BMPFile))- k64s#
!            P = k64s# * 64000
!            Loop T# Times
!                P = P + 1
!                Dos1b:Line = Val(TBar_BMPFile[P])
!                Add(DF1b)
!                Cycle
!            End
!            Close(DF1b)

            R# = DeleteObject(TBar_LogBrushHnd)
            R# = DeleteObject(TBar_FontHandle)
            R# = DeleteObject(TBar_DIBSectionHnd)
            R# = DeleteDC(TBar_BkGndDCHnd)

            Dispose(TBar_BMPFile)
            Dispose(TBar_DIBits)



Printed November 21, 2024, 6:55 am
This article has been viewed/printed 35202 times.
Google search has resulted in 23 hits on this article since January 25, 2004.