There's a program called WinDowse that does that and more:
http://www.greatis.com/delphicb/windowse/
I just modified it a bit, so that internet explorer is opened automatiically. now all you have to do is run the program. Which means: It works much better now :)
Still a bit clumsy because it first requires that the browser be openned in a seperate window, but, on my computer at least, it's loaded into the Blitz window so quickly that most people would hardly realize it was ever out.
For this example with ExecFile, I have removed the check for Firefox. The execFile thing actually does work with Firefox, but I have decided that IE is more compatible with the demo (and everybody has it).
I have also made some obvious changes to the window style for IE, which is now resizeable. (It was only Firefox that messed up the resizing... I think it also stole my window close button event).
http://www.greatis.com/delphicb/windowse/
I just modified it a bit, so that internet explorer is opened automatiically. now all you have to do is run the program. Which means: It works much better now :)
Still a bit clumsy because it first requires that the browser be openned in a seperate window, but, on my computer at least, it's loaded into the Blitz window so quickly that most people would hardly realize it was ever out.
For this example with ExecFile, I have removed the check for Firefox. The execFile thing actually does work with Firefox, but I have decided that IE is more compatible with the demo (and everybody has it).
I have also made some obvious changes to the window style for IE, which is now resizeable. (It was only Firefox that messed up the resizing... I think it also stole my window close button event).
;Force-Embedded Web Browser Demonstration ;By Dylan McCall ;June 23, 2005 ;Win32 Consts: Const GWL_STYLE = (-16) Const WS_CLIPSIBLINGS = $04000000 Const WS_CLIPCHILDREN = $02000000 Const WS_CAPTION = $00C00000 Const GWL_EXSTYLE = (-20) Const WS_EX_TOOLWINDOW = $00000080 Const SWP_NOZORDER = $0004 Const SWP_FRAMECHANGED = $0020 Const SWP_SHOWWINDOW = $0040 Const SW_SHOW = 5 ;Known window Classes Const FireFoxClass$="MozillaWindowClass" Const FireFoxTitle$="The Official Blitz Website - Mozilla Firefox" Const IEClass$="IEFrame" Const IETitle$="http://www.blitzbasic.com/ - Microsoft Internet Explorer" Const IETitle2$="The Official Blitz Website - Microsoft Internet Explorer" Graphics 800,600,0,2 hWnd=SystemProperty("apphWnd") style=api_GetWindowLong(hWnd,GWL_STYLE) style=style Or WS_CLIPCHILDREN api_SetWindowLong hWnd,GWL_STYLE,style .findParent ;parent=api_FindWindow(FireFoxClass,FireFoxTitle) ;You may add any other web browsers to this list by ;If parent=0 Then parent=api_FindWindow(IEClass,IETitle) ;copying that same line and changing the variables ExecFile "iexplore.exe "+"http://www.blitzbasic.com/" Local parent;,loops Repeat ; Print "Looping" parent=api_FindWindow(IEClass,IETitle) ;IE displays this title when loading the web site If parent = 0 Then parent= api_FindWindow(IEClass,IETitle2) ;If the web site has already been loaded, this title is displayed ;loops = loops+1 Until parent <> 0 ;Or loops>10000 ;Print "Will embed window with handle: "+Hex$(parent) ;Print "Press any key to continue" ;WaitKey ;If parent=0 Then Goto findParent api_SetParent parent,hWnd SetGadgetShape parent,5,50,790,540 ;Making the embedded window fit nicely ;styleEx=api_GetWindowLong(parent,GWL_EXSTYLE) ;styleEx=styleEx Or WS_EX_TOOLWINDOW ;Looks cooler this way... ;api_SetWindowLong parent,GWL_EXSTYLE,styleEx style=api_GetWindowLong(parent,GWL_STYLE) style=style Xor WS_CAPTION ;Looks more a part of the window now api_SetWindowLong parent,GWL_STYLE,style api_UpdateWindow parent Cls Text 2,2, "Below is a Force-Embedded Window!" Repeat Until KeyDown(1) api_DestroyWindow(parent) End ;WinBlitz3d extract. To resize embedded window. Function SetGadgetShape(gadget,x,y,width,height) r = api_BeginDeferWindowPos(1); t = api_DeferWindowPos(r,gadget,0,x,y,width,height,SWP_FRAMECHANGED Or SWP_SHOWWINDOW Or SWP_NOZORDER); api_EndDeferWindowPos(r); api_ShowWindow(gadget,SW_SHOW); ;api_SetActiveWindow(gadget); End Function