How do I replace dnserror.htm in ieframe.dll with custom page
-
16 марта 2012 г. 13:00
I have a need to replace the dnserror.htm page with a custom page. I need this for a tablet that will operate in Kiosk mode and have a specific web site on it. I have edited the ieframe.dll.mui file using resource hacker and have confirmed that the changes are there. However, whenever I test it by turning off my computers internet connection and requesting a web page in IE, I get the original page. If I look at ieframe.dll.mui using Visual Studio it has an old page. I found a way to get the full path to the page but the page doesn't exist where the path suggests. (Under user/myname/appdata...)
I really need to resolve this and all help is greatly appreciated.
John
Все ответы
-
16 марта 2012 г. 15:59
I suspect what you're seeing is the dll cache noticing that you've tampered with a protected file and it restores the original.
You've correctly divined that the pages are resources in IE dlls. The proper way to handle this, I think, would be to implement a BHO that handles onBeforeNavigate. In your handler check to see if you're being navigated to the error page (you could use IDocObjectService::IsErrorUrl() to verify, but I think just looking for dnserror.htm is good enough) and then cancel the navigation and instead navigate to your page, which would be a resource packaged as part of your BHO (either in the DLL via res:// or just a local file).
-
16 марта 2012 г. 18:39Thanks jeffdav. I'll look into this.
-
19 марта 2012 г. 17:42
I just worked through Microsoft's sample code on building a BHO and have a little bit of an idea of what you are talking about. Could you provide a sample of the onBeforeNavigate?
Here is something I found elsewhere that suggests something similar:
void Explorer_BeforeNavigate2(object pDisp, ref object URL, ref object Flags, ref object TargetFrameName, ref object PostData, ref object Headers, ref bool Cancel){
if(URL.ToString().Equals(@"res://C:\WINDOWS\SYSTEM32\shdoclc.DLL/dnSerror.htm"))
{
Cancel = true;
//navigate to my custom page
}
}
All help is greatly appreciated.

