Code : Tout sélectionner
;-********************
;-Author : Heis Spiter
;-Date : 02/01/06
;-ID : 200201065101
;-PB Version : 3.94
; Forum Fr : http://purebasic.hmt-forum.com/viewtopic.php?t=4214
;
; This example shows how to use Internet Explorer deamon and Gecko in the same application.
;-********************
; To use this be sure that you have these dll into your app dir :
; - Atl.dll (For IE deamon)
; - xpcom.dll (For Gecko)
If FileSize("Atl.dll") = -1 Or FileSize("xpcom.dll") = -1
MessageRequester("Error", "You should have Atl.dll and xpcom.dll into your dir !", #MB_ICONERROR)
End
EndIf
If OpenWindow(0,0,0,800,600,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"WebGadget") And CreateGadgetList(WindowID(0))
OptionGadget(1, 10, 10, 150, 15, "Internet Explorer")
OptionGadget(2, 390, 10, 150, 15, "Gecko")
WebGadget(3, 10, 25, 780, 565,"http://www.purebasic.com", #PB_Web_Mozilla)
WebGadget(0, 10, 25, 780, 565,"http://www.purebasic.com")
HideGadget(3, 1)
SetGadgetState(1, 1)
Id = 0
Repeat
Event = WindowEvent()
If Event = #PB_Event_Gadget
If GetGadgetState(1) And Id = 3
HideGadget(Id, 1)
Id = 0
HideGadget(Id, 0)
ElseIf GetGadgetState(2) And Id = 0
HideGadget(Id, 1)
Id = 3
HideGadget(Id, 0)
EndIf
EndIf
Delay(1)
Until Event = #PB_Event_CloseWindow
EndIf
End