1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
Function fnWndProc_OnCreate(wea As WndEventArgs) As Long
Local lpCreateStruct As CREATESTRUCT Ptr
Local pStream,ppUnkContainer As IUnknown
Local hContainer,hCtrl As Dword
Local szCtrl As ZStr*32
Local hr As Long
lpCreateStruct=Wea.lParam
Wea.hInst=@lpCreateStruct.hInstance
Call AtlAxWinInit()
hContainer=CreateWindowEx(0,"static","",%WS_CHILD OR %WS_VISIBLE,0,0,975,750,Wea.hWnd,%ID_CONTAINER,Wea.hInst,Byval %NULL)
szCtrl="Shell.Explorer" 'Program ID
hr=AtlAxCreateControl(szCtrl,hContainer,pStream,ppUnkContainer)
If SUCCEEDED(hr) Then
pEvents=Class "Class_DWebBrowserEvents"
pWebBrowser=AtlAxGetDispatch(hContainer)
If IsObject(pWebBrowser) Then
Events From pWebBrowser Call pEvents
End If
hCtrl=CreateWindowEx(0,"button","Navigate",%WS_CHILD OR %WS_VISIBLE,20,760,150,30,Wea.hWnd,%ID_NAVIGATE,Wea.hInst,Byval %NULL)
hCtrl=CreateWindowEx(%WS_EX_CLIENTEDGE,"edit","",%WS_CHILD OR %WS_VISIBLE,200,760,400,30,Wea.hWnd,%ID_URL,Wea.hInst,Byval %NULL)
hCtrl=CreateWindowEx(0,"button","Close",%WS_CHILD OR %WS_VISIBLE,700,760,80,30,Wea.hWnd,%ID_CLOSE,Wea.hInst,Byval %NULL)
End If
Print #fp, "Leaving fnWndProc_OnCreate()"
fnWndProc_OnCreate=0
End Function
|