Challenge folks!!! This can't really be that hard!?!?? :(
-
Hi everybody, I've asked lots of people to help me out here but apparently this seems hard to do. ALL suggestions are more than welcome! If this thing gets solved rapidly I will consider paying a small amount for a solution. The problem description: I have a BHO (Browser Helper Object) in a dll. The BHO is loaded when Internet Explorer (iexplore.exe) starts and unloaded when it closes. It performs dynamic dictionary lookups on web pages. In the loading part of the dll
///////////////////////////////////////////////////////////////////////////// // DLL Entry Point extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/) { if (dwReason == DLL_PROCESS_ATTACH) { /* TCHAR pszLoader[MAX_PATH]; GetModuleFileName(NULL, pszLoader, MAX_PATH); _tcslwr(pszLoader); if (_tcsstr(pszLoader, _T("explorer.exe"))) return FALSE; */ _Module.Init(ObjectMap, hInstance); DisableThreadLibraryCalls(hInstance); } else if (dwReason == DLL_PROCESS_DETACH) _Module.Term(); return TRUE; // ok }
I have commented out a code section which makes the loading stop if it discovers the caller as the process explorer.exe. This piece of code does everything I want IF it wasn't for the fact that Internet Explorer (iexplore.exe) sometimes runs under the explorer.exe process. So the problem is, how do I get the dll/BHO to load ONLY ONLY ONLY when Internet Explorer is started and NOT NOT NOT every time when a folder (resides in explorer.exe process) is opened. As you probably know, we all use folders every day and my BHO loads a heavy dictionary every time it is opened. Now, some of you clever guys out there might say: Why not delay the heavy part loading until you really need it? That is, load it only when you discover you have a web page (and not a folder). That would almost be fair enough if it, among other things, wasn't for a copy protection mechanism that I have in my dll. When the copy protection mechanism sees that there are no more, let's say, evaluation days left for the BHO dll, then a message pops, informing this to the user. And naturally it does this with every opened folder too, not only with Internet Explorer. This is definitely not ok! And another problem is that the BHO dll sort of hooks on to the operating system since explorer.exe is an important process. For this reason only one would want to get rid of the folder/explorer.exe dependency. Also at installation and uninstallation things become complicated becau -
Hi everybody, I've asked lots of people to help me out here but apparently this seems hard to do. ALL suggestions are more than welcome! If this thing gets solved rapidly I will consider paying a small amount for a solution. The problem description: I have a BHO (Browser Helper Object) in a dll. The BHO is loaded when Internet Explorer (iexplore.exe) starts and unloaded when it closes. It performs dynamic dictionary lookups on web pages. In the loading part of the dll
///////////////////////////////////////////////////////////////////////////// // DLL Entry Point extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/) { if (dwReason == DLL_PROCESS_ATTACH) { /* TCHAR pszLoader[MAX_PATH]; GetModuleFileName(NULL, pszLoader, MAX_PATH); _tcslwr(pszLoader); if (_tcsstr(pszLoader, _T("explorer.exe"))) return FALSE; */ _Module.Init(ObjectMap, hInstance); DisableThreadLibraryCalls(hInstance); } else if (dwReason == DLL_PROCESS_DETACH) _Module.Term(); return TRUE; // ok }
I have commented out a code section which makes the loading stop if it discovers the caller as the process explorer.exe. This piece of code does everything I want IF it wasn't for the fact that Internet Explorer (iexplore.exe) sometimes runs under the explorer.exe process. So the problem is, how do I get the dll/BHO to load ONLY ONLY ONLY when Internet Explorer is started and NOT NOT NOT every time when a folder (resides in explorer.exe process) is opened. As you probably know, we all use folders every day and my BHO loads a heavy dictionary every time it is opened. Now, some of you clever guys out there might say: Why not delay the heavy part loading until you really need it? That is, load it only when you discover you have a web page (and not a folder). That would almost be fair enough if it, among other things, wasn't for a copy protection mechanism that I have in my dll. When the copy protection mechanism sees that there are no more, let's say, evaluation days left for the BHO dll, then a message pops, informing this to the user. And naturally it does this with every opened folder too, not only with Internet Explorer. This is definitely not ok! And another problem is that the BHO dll sort of hooks on to the operating system since explorer.exe is an important process. For this reason only one would want to get rid of the folder/explorer.exe dependency. Also at installation and uninstallation things become complicated becauThe trouble is that there really isn't a difference anymore between "IE" and "Explorer" If you run "Explorer" and enter http://www.foo.com into the address bar, suddenly it looks like IE and you can view that web page. If you run "IE" and enter C:\windows in the address bar, suddenly it looks like Explorer and shows that directory. What I do to tell the difference is try to get an IHTMLDocument interface on whatever is being shown in the view. If that QI fails, then a web page is not being displayed, so you can assume the file system is. --Mike-- Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--= NO CARRIER
-
The trouble is that there really isn't a difference anymore between "IE" and "Explorer" If you run "Explorer" and enter http://www.foo.com into the address bar, suddenly it looks like IE and you can view that web page. If you run "IE" and enter C:\windows in the address bar, suddenly it looks like Explorer and shows that directory. What I do to tell the difference is try to get an IHTMLDocument interface on whatever is being shown in the view. If that QI fails, then a web page is not being displayed, so you can assume the file system is. --Mike-- Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--= NO CARRIER
Michael Dunn wrote: What I do to tell the difference is try to get an IHTMLDocument interface on whatever is being shown in the view. If that QI fails, then a web page is not being displayed, so you can assume the file system is. I'm assuming you're not doing this from the DllAttach function. (If that's the case, please tell me how!) If not, well, I've tried that too (after SetSite call) but what that really does is only to relieve me [or the folders] from my heavy dll dictionary loading; still the folders and all that are under the influence of explorer.exe are loading the BHO when opened. Is there no way to test for differences between the callers other than the process name?! Sounds weird... Well, well, the solution is still to be found I guess. Thx Mike, /Tommy
-
The trouble is that there really isn't a difference anymore between "IE" and "Explorer" If you run "Explorer" and enter http://www.foo.com into the address bar, suddenly it looks like IE and you can view that web page. If you run "IE" and enter C:\windows in the address bar, suddenly it looks like Explorer and shows that directory. What I do to tell the difference is try to get an IHTMLDocument interface on whatever is being shown in the view. If that QI fails, then a web page is not being displayed, so you can assume the file system is. --Mike-- Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--= NO CARRIER
Michael Dunn wrote: What I do to tell the difference is try to get an IHTMLDocument interface on whatever is being shown in the view. If that QI fails, then a web page is not being displayed, so you can assume the file system is. When can I check for the displayed web page...? I tried in SetSite but I think the document wasn't finished loading. How to know when to test the IHTMLDocument pointer? /Tommy