This displays an html page in a window. It has minimal code, using atl.dll.
With a little bit more work it could do all sorts of tricks!
dougiem
[attachment deleted by admin]
Doug,
It works fine on my win2k box. :U
Thanks for the code! Doug :)
you havn't by chance created a browser plugin as yet?
Thx, B
Thanks! I've been looking for this! Thanks again!
brad,
there's a few button commands you can use to make a simple browser,
ole32 pIweb2obj,offset IWebBrowser2_GoBack
ole32 pIweb2obj,offset IWebBrowser2_GoForward
ole32 pIweb2obj,offset IWebBrowser2_Navigate
I just liked the idea of having a fancy looking window for my apps. I'm glad it's of some use.
dougiem
brad,
I was surprised to see that this lite browser supports JAVA. Other implimentations did not. I can use this browser to make applets look like applications. I put one together for others to see. Attached is Mahjongg.
Paul
[attachment deleted by admin]
PBrennick,
I was dlighted to see the use you put to the masm app. (How do i play it ?)
I hope you domt mind, i have introduced a 'resource to file' module, which makes the application a
stand alone. Although in the examples we both have shown, I think it should be pointed out that if you go
web wise, you should be aware of your security. great stuff
ps your site - great!
dougiem
attach:mahjongg2.zip
sorry attachment !!!!
[attachment deleted by admin]
dougiem,
Here is the original html file that I wrote for the game. Scroll down to see the directions. Get the attachment.
Paul
[attachment deleted by admin]
Dougiem,
Loading them as resources is a good idea. It did not occur to me because they are so small. I moved the program to a separate directory and when I ran it, I noticed that you unbundle the jar into the html directory but not the html file. Why is that?
Paul
ah ! Paul,
The paths were not meant to be relative. In my prog, it assumes "THIS DIR"
to point to : change: lline : pHtml db "/html/Mahjongg.html",0 to yours
dougiem cheers!
Dougiem,
There is no difference between the two lines.
Paul
sorry, I had spelt the file wrong in : WM_CLOSE
invoke DeleteFile,SADD("html/mahjongg.jar")
so it cannot subsequently delete the dir
ahhh. That will be a lot cleaner.
Paul
thanks for the code! I had actually had just started working on doing the same thing yesterday so you saved me a lot of time :)
Perhaps a simple proc can help ?
It's a translation of a sdk sample
http://www.masm32.com/board/index.php?topic=10864.msg79597#msg79597
Thank you, I was looking for something like that to show the Sudoku Worksheets.
Paul
hi dougiem, that's a great app! :U
But when I pass SADD("C:\") to MultiByteToWideChar, the Windows' Form appear.
Sorry, but I think this is embarrass.
When I type C:\ on address bar of Mozilla firefox or Google Chrome it also show file' list in directory C:\. but they not open it with Windows' Form.
How can we make your app to become like that?
or maybe would you like to give me some clue or other link?
here is other link:
http://www.masm32.com/board/index.php?topic=10904.msg80033#msg80033
thank you
sorry for my bad english.
;CREATE WEBBROWSER1
;load com libs
invoke CoInitialize,0
;initialize the Active Template Library classes: invoke AtlAxWinInit
invoke LoadLibrary,SADD("atl.dll")
mov hATLlib,eax
invoke GetProcAddress,hATLlib,SADD("AtlAxWinInit")
call eax
;Create the WebBrowser window
invoke CreateWindowEx,
NULL,
SADD("AtlAxWin"),
NULL,
WS_CHILD or WS_VISIBLE or WS_BORDER or WS_VSCROLL or WS_HSCROLL,
0,25,500,472,hWin,NULL,
400000h,NULL
mov hATLweb,eax
invoke ShowWindow,hATLweb,SW_HIDE
invoke RegisterWindowMessage,SADD("WM_ATLGETHOST")
mov WMhost,eax
invoke SendMessage,hATLweb,WMhost,0,0 ;get the host object [window]
mov HostObject,eax
ole32 HostObject,0,offset IID_IAxWinHostWindow,offset pIwebHost ;QueryInterface
;to IAxWinHostWindow vtable
;create page
;get html page address then pass it to MultiByteToWideChar
invoke MultiByteToWideChar,CP_ACP,0,SADD("C:\"),-1,addr uHtml,MAX_PATH*2
ole32 pIwebHost,IAxWinHostWindow_CreateControl,offset uHtml,hATLweb,0
invoke RegisterWindowMessage,SADD("WM_ATLGETCONTROL")
invoke SendMessage,hATLweb,eax,0,0 ;get loaded object [htmlpage]
mov browserObject,eax
ole32 browserObject,0,offset IID_IWebBrowser2,offset pIweb2obj ;QueryInterface
;to IWebBrowser2 vtable this-> to set pages
Hi elmo,
The IWebBrowser interface simply loads a Microsoft Internet Explorer control into an ATL window in this case. The control will act exactly as IE does and that will always open an Explorer window when you type a local path (without a filename) into the address bar. The way its displayed is a result of how it handles the FILE: protocol when dealing with folders, which is different between the Gecko engine (which generates an XHTML file) and the IE engine.