Discussion:
HOWTO Create a WebBrowser with a customize menu
(too old to reply)
ADX Dev
2004-04-18 09:56:02 UTC
Permalink
I'd like to display an HTML page on a WebBrowser with just three commands on the File menu: Save, Print and Close

Is there an easy and fast way in doing it

Could you point me to any examples or APIs that I can refer to

I looked into iexplorer.exe or ShellExecute(), but nothing there

Thanks
ADX Dev
Tian Min Huang
2004-04-19 07:39:07 UTC
Permalink
Hello,

Thanks for your post. As I understand, you want to remove part of built-in
menu items in IE programmatically. Please correct me if there is any
misunderstanding.

Based on my experience and research, I am afraid that you cannot do it.
Would you please tell me your purpose so that I can check to see if there
is any work around?

I look forward to hearing from you.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
ADX Dev
2004-04-20 00:16:03 UTC
Permalink
This is what I want to do programatically I want to display an HTML page on a window. From this window, it has two commands to save and print this HTML page. Of course, I should be able to close the window

Is there is an easy way to accomplish this with minimum coding

I might have to turn this html page into an HTA so that I'm allow to save it programatically

What I'm using now is ShellExecute(). It'd be nice if I can add save and print to the system menu. However, that's not possible

BTW, my programming environment is: Visual Studio C++ 6.0 & MFC

I guess I need to create a WebBrowser Control to display an HTA. I need to provide DHTML and javascript command for save and print

Thanks
ADX De
Tian Min Huang
2004-04-20 06:39:18 UTC
Permalink
Hello,

Thanks for your prompt reply. It seems that I misunderstood your original
post. Now that you want to host/open/print/save HTML page in your MFC
applicaiton. If so, I strongly recommend you use WebBrowser Control which
expose the interface IWebBrowser2. You can call IWebBrowser2::ExecWB to do
what you want. Please refer to the following articles and a sample:

IWebBrowser2::ExecWB Method
http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/webbrows
er/reference/ifaces/iwebbrowser2/execwb.asp

OLECMDID
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/com/htm/oen
_a2z_22sk.asp

Using the WebBrowser control, simplified.
http://www.codeproject.com/miscctrl/simplebrowserformfc.asp?print=true

Hope this helps.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
ADX Dev
2004-04-26 21:11:02 UTC
Permalink
Thank you for your help.

Loading...