Suthy67

Our Sybase Powerbuilder application contains an embedded Microsoft Web Browser control, accessing web pages on a local webserver.

After installing IE7, dropdown controls within embedded web pages are no longer selectable. The options appear, but none are clickable.

I have stripped the html code to a bare minimum, so it does not appear to be related to this.

I have also tried noddy apps in various versions of Powerbuilder with the same results. On a machine with IE6 however, all is fine.

Our customers have recently installed IE7 with the same result in the deployed application, and have had to revert to IE6 to resolve the problem.

I have seen various issues with the IE7 install affecting VB6 apps, relating to shdocvw.dll and ieframe.dll, and there is a difference in the registry entries for the Microsoft Web Browser class between IE6 installs and IE7, however nothing I try seems to make a difference.

Additionally, the simple test web page works fine within a newly created VB6 application.

Can anyone help

Thanks in advance

Andy



Re: Internet Explorer Extension Development Powerbuilder IE7 embedded webbrowser control

Sheng Jiang

I don't have powerbuilder, but I think you can have change the behavior of the webbrowser control by implementing IDocHostUIHandler::GetHostInfo in your webbrowser (probably in your form class).

There are two flags introduced in the DOCHOSTUIFLAG Enumerated Type that are related to select control. One is DOCHOSTUIFLAG_USE_WINDOWLESS_SELECTCONTROL, and the other is DOCHOSTUIFLAG_USE_WINDOWED_SELECTCONTROL. Implement IDocHostUIHandler::GetHostInfo in your webbrwoser host and set DOCHOSTUIFLAG_USE_WINDOWED_SELECTCONTROL flag in the structure passed in the parameter, then see what happens. If you don't know how to implement this in powerbuilder (nor do I), try the ActiveX control documented in www.codeproject.com/atl/vbmhwb.asp.






Re: Internet Explorer Extension Development Powerbuilder IE7 embedded webbrowser control

Suthy67

Thanks!

Your info lead me to the article at http://support.microsoft.com/kb/927377

After adding a new registry entry for our executable, the select controls reverted to their pre IE7 operation.

Cheers

Andy





Re: Internet Explorer Extension Development Powerbuilder IE7 embedded webbrowser control

Sheng Jiang

You can also use the CoInternetSetFeatureEnabled function to change it at runtime.




Re: Internet Explorer Extension Development Powerbuilder IE7 embedded webbrowser control

Tadwick

Sheng, how would I code that function in c#

Thanks, Tad





Re: Internet Explorer Extension Development Powerbuilder IE7 embedded webbrowser control


Re: Internet Explorer Extension Development Powerbuilder IE7 embedded webbrowser control

Tadwick

Sheng and others,

Thanks for the link. I'd seen that page but not known how to implement it. Anyhow I had a go and this is the result. (My form is hosted in Outlook.exe.) Seems to run ok. You will see that I created three buttons to test the lock down features. What I found was

a) SET_FEATURE_ON_THREAD and SET_FEATURE_ON_THREAD_LOCALMACHINE do not seem to have any effect on my VSTO managed code inside Outlook.

b) SET_FEATURE_ON_PROCESS seemed to work (almost too well - once SET_FEATURE_ON_PROCESS was turned off by setting it to false it seemed to be in effect until I closed the app (in this case my form is in Outlook). Even after I turned it on again once the page was loaded with the DocumentCompleted event it still stayed in effect).

Any thoughts on this

Thanks, Tad

***********************************************

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace TestLockDown
{
public partial class TestForm : Form
{
public enum INTERNETFEATURELIST{
FEATURE_OBJECT_CACHING = 0,
FEATURE_LOCALMACHINE_LOCKDOWN = 8,
FEATURE_SECURITYBAND = 9,
FEATURE_RESTRICT_ACTIVEXINSTALL = 10,
FEATURE_VALIDATE_NAVIGATE_URL = 11,
FEATURE_RESTRICT_FILEDOWNLOAD = 12,
FEATURE_ADDON_MANAGEMENT = 13,
FEATURE_PROTOCOL_LOCKDOWN = 14,
FEATURE_HTTP_USERNAME_PASSWORD_DISABLE = 15,
FEATURE_SAFE_BINDTOOBJECT = 16,
FEATURE_UNC_SAVEDFILECHECK = 17,
FEATURE_GET_URL_DOM_FILEPATH_UNENCODED = 18,
FEATURE_ENTRY_COUNT = 19
}

private const int SET_FEATURE_ON_THREAD = 0x00000001;
private const int SET_FEATURE_ON_PROCESS = 0x00000002;
private const int SET_FEATURE_IN_REGISTRY = 0x00000004;
private const int SET_FEATURE_ON_THREAD_LOCALMACHINE = 0x00000008;
private const int SET_FEATURE_ON_THREAD_INTRANET = 0x00000010;
private const int SET_FEATURE_ON_THREAD_TRUSTED = 0x00000020;
private const int SET_FEATURE_ON_THREAD_INTERNET = 0x00000040;
private const int SET_FEATURE_ON_THREAD_RESTRICTED = 0x00000080;

[DllImport("urlmon.dll")]
[PreserveSig]
[return: MarshalAs(UnmanagedType.Error)]
static extern int CoInternetSetFeatureEnabled(
INTERNETFEATURELIST FeatureEntry,
[MarshalAs(UnmanagedType.U4)] int dwFlags,
bool fEnable);


public TestForm()
{
InitializeComponent();
}

private void btnProcess_Click(object sender, EventArgs e)
{
CoInternetSetFeatureEnabled(INTERNETFEATURELIST.FEATURE_LOCALMACHINE_LOCKDOWN, SET_FEATURE_ON_PROCESS, false);
MessageBox.Show("process opened");
this.webBrowser1.Navigate(textBox1.Text);
}

private void btnThread_Click(object sender, EventArgs e)
{
CoInternetSetFeatureEnabled(INTERNETFEATURELIST.FEATURE_LOCALMACHINE_LOCKDOWN, SET_FEATURE_ON_THREAD, false);
this.webBrowser1.Navigate(textBox1.Text);
}

private void btnThreadLocal_Click(object sender, EventArgs e)
{
CoInternetSetFeatureEnabled(INTERNETFEATURELIST.FEATURE_LOCALMACHINE_LOCKDOWN, SET_FEATURE_ON_THREAD_LOCALMACHINE, false);
this.webBrowser1.Navigate(textBox1.Text);

}


private void TestForm_Load(object sender, EventArgs e)
{

CoInternetSetFeatureEnabled(INTERNETFEATURELIST.FEATURE_LOCALMACHINE_LOCKDOWN, SET_FEATURE_ON_PROCESS, true);
MessageBox.Show("process locked as form loaded");

}

private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{

CoInternetSetFeatureEnabled(INTERNETFEATURELIST.FEATURE_LOCALMACHINE_LOCKDOWN, SET_FEATURE_ON_PROCESS, true);
MessageBox.Show("process locked down again");
}

}
}





Re: Internet Explorer Extension Development Powerbuilder IE7 embedded webbrowser control

nehem

Hi Sheng Jiang,

It seems to be a good solution, but when I have tried to use CoInternetFeatureEnabled(), I got the message that this functuion is not included in the urlmon.dll .

Can you help

Nehem





Re: Internet Explorer Extension Development Powerbuilder IE7 embedded webbrowser control

Sheng Jiang

CoInternetSetFeatureEnabled requires Windows XP SP2 or Windows 2003 SP1