Re: Developpement d'utilitaires à la demande

Publié par Gerome le 14/01/2008 22:20:45
Bonsoir,

Pour celles et ceux qui ont installés FBSL sur leur PC ( c'est gratuit hein :) ), voici un GRATILOG 'embarqué'.
Ceci est une idée pratique, vous aurez juste à changer l'URL pour embarquer n'importe quelle URL ou encore n'importe quel fichier HTML (local ou distant)!
Comme par exemple pour faire des demos tournantes (je pensais à mageCollection qui génère des planches d'images que l'on peut animer...)

#Option Explicit

Static %hDisplay$URL "http://www.gratilog.net/xoops/"

ApiCall"AtlAxWinInit""ATL" )

Fbsl_SetText(ME"== E M B E D D E D  G R A T I L O G ==")
Resize(ME00800640)
Center(ME)

Const 
hURL Fbsl_Control("Edit"MEURL010336823_
            WS_CHILD 
WS_TABSTOP ES_AUTOHSCROLLWS_EX_CLIENTEDGE)

hDisplay Fbsl_Control("AtlAxWin"ME"MSHTML:<HTML></HTML>"_
            0
030800640WS_CHILD WS_VISIBLEWS_EX_CLIENTEDGE)
'========this eliminates flicker on window resize======
ApiCall( "SetClassLong", "user32", Me, -26, 8 )
EventGo()
PostMessage( Me, WM_SYSCOMMAND, SC_MAXIMIZE, NULL )
RefreshMe()
Show(Me)

Begin Events
    Select Case CBMSG
        Case WM_SIZE
            RefreshMe()
        Case WM_CLOSE
            ExitProgram(0)
    End Select
End Events

Sub EventGo()
    Fbsl_GetText(hURL, URL)
    If URL = "" Then Return
    If (hDisplay <> 0) Then Destroy(hDisplay)
    hDisplay = Fbsl_Control("AtlAxWin", ME, URL, 0, 0, 10, 800, 640, _
               WS_CHILD + WS_VISIBLE + WS_VSCROLL + WS_HSCROLL, WS_EX_CLIENTEDGE)
    RefreshMe()
End Sub

Sub RefreshMe()
    Static %Lefti, %Topi, %Righti, %Bottomi
    GetClientRect(ME, Lefti, Topi, Righti, Bottomi)
    Resize(hDisplay, 5, 5, Righti - 5, Bottomi - 10)
End Sub


Enjoy

Cette contribution était de : http://www.gratilog.net/xoops/newbb/viewtopic.php?forum=2&topic_id=3002&post_id=15688