Skip to main content

[archive] Problem with web-browser control

  • January 30, 2007
  • 9 replies
  • 0 views

[Migrated content. Thread originally posted on 30 January 2007]

I have an application in which I want to allow the user to access jpg files in a specified folder. I am trying to use the web-browser control so he sees the same viewer as if he was in windows explorer. The results are not the same. Please see the attachment which contains screen shots and sample code. Any suggestions would be appreciated.

9 replies

[Migrated content. Thread originally posted on 30 January 2007]

I have an application in which I want to allow the user to access jpg files in a specified folder. I am trying to use the web-browser control so he sees the same viewer as if he was in windows explorer. The results are not the same. Please see the attachment which contains screen shots and sample code. Any suggestions would be appreciated.
If you create a straight HTML page and include your jpeg image in that page you would see the same results as you do with the web browser control. The Windows image and fax viewer is a different Windows application that resizes the image for easier viewing. You may want to save your jpeg as thumbnails and see if the image resolves better when loading into the web browser.

[Migrated content. Thread originally posted on 30 January 2007]

I have an application in which I want to allow the user to access jpg files in a specified folder. I am trying to use the web-browser control so he sees the same viewer as if he was in windows explorer. The results are not the same. Please see the attachment which contains screen shots and sample code. Any suggestions would be appreciated.
Accompany your images with a corresponding html file, then display the html file instead of the image in the browser.
You should create te html file dynamically, all that need to be in there is:



The three parameters; src, width and height you can set to your desire. Typically you will try to match width and height with the size you designate the web control. src should be given the absolute path to the image file.

Doing this, the picture will be scaled to fit to your web control, provided the dimensions you provide are fitting.

[Migrated content. Thread originally posted on 30 January 2007]

I have an application in which I want to allow the user to access jpg files in a specified folder. I am trying to use the web-browser control so he sees the same viewer as if he was in windows explorer. The results are not the same. Please see the attachment which contains screen shots and sample code. Any suggestions would be appreciated.
I don't want to hijack the thread, but is there anyway to completely get rid of the vertical scroll bar on the web-browser control?

I see the horizontal only displays when the picture is too wide to display fully, but the vertical one is always there no matter what, just 'greyed out'.

[Migrated content. Thread originally posted on 30 January 2007]

I have an application in which I want to allow the user to access jpg files in a specified folder. I am trying to use the web-browser control so he sees the same viewer as if he was in windows explorer. The results are not the same. Please see the attachment which contains screen shots and sample code. Any suggestions would be appreciated.
I am not familiar with the

[Migrated content. Thread originally posted on 30 January 2007]

I have an application in which I want to allow the user to access jpg files in a specified folder. I am trying to use the web-browser control so he sees the same viewer as if he was in windows explorer. The results are not the same. Please see the attachment which contains screen shots and sample code. Any suggestions would be appreciated.
Ignore my previous post, I figured it out and your solution seems to be working great, thanks again,

[Migrated content. Thread originally posted on 30 January 2007]

I have an application in which I want to allow the user to access jpg files in a specified folder. I am trying to use the web-browser control so he sees the same viewer as if he was in windows explorer. The results are not the same. Please see the attachment which contains screen shots and sample code. Any suggestions would be appreciated.
One more question. Using your solution (creating the html file with the single line) works, but only displays the jpg file. I would like for the Windows and Fax viewer to be displayed with the picture so my user could use the tool bar that comes with it for emailing, etc. Is that possible?

[Migrated content. Thread originally posted on 30 January 2007]

I have an application in which I want to allow the user to access jpg files in a specified folder. I am trying to use the web-browser control so he sees the same viewer as if he was in windows explorer. The results are not the same. Please see the attachment which contains screen shots and sample code. Any suggestions would be appreciated.
If the Fax viewer is a generally available ActiveX component, I see no problem in this, unfortunately I have no expirence with this component, so I cannot give you an example right here and now.

May be someone else has already been down that path.

However, if the topic is about emailing the image, you do not need to use a fax component for that purpose. If you have an smtp server available, you can hook up with this.

Courtesy from Mr. Peter Doerrenbacher, Kiss personal Gmbh there is on this forum an example in plain COBOL that show how to send an email via smtp with attachment. You might want to look at that one.

[Migrated content. Thread originally posted on 30 January 2007]

I have an application in which I want to allow the user to access jpg files in a specified folder. I am trying to use the web-browser control so he sees the same viewer as if he was in windows explorer. The results are not the same. Please see the attachment which contains screen shots and sample code. Any suggestions would be appreciated.
My understanding from the AcuCorp webinar that the web browser control when launching a file would use the same program as Windows explorer does when you click on the file with the same suffix, Word, Acrobat, etc. This does not seem to hold true with the jpg files as Explorer uses whatever program you have assigned through windows, in this case, the Windows picture and fax viewer. If web-browser is doing this I'am not sure, because the tool bar from the viewer does not appear.

[Migrated content. Thread originally posted on 30 January 2007]

I have an application in which I want to allow the user to access jpg files in a specified folder. I am trying to use the web-browser control so he sees the same viewer as if he was in windows explorer. The results are not the same. Please see the attachment which contains screen shots and sample code. Any suggestions would be appreciated.
First, the web browser encapsulates the WebBrowser2 COM interface to Internet Explorer, not Windows Explorer.
To my knowledge, the preview facility of Windows Explorer is limited to just that, Windows explorer, and not Internet Explorer. The latter which use a different approach for associations.
Where Windows explorer will rely on associations to the extension of a file will Internet explorer depend on the MIME tag (as above is IMG) to identify how to show a file.
So, I suggest you try to figure out the MIME tag (if any) for the fax viewer, a good start is to look here in the windows registry (careful with modifications though) HKEY_CLASSES_ROOT\\MIME\\Database\\Content Type
As for the toolbar, a toolbar is usually application specific, as is in this case. If you want a toolbar, you have to provide and populate this yourself.