Image retrieval in IE's browser cache (Win32)

A

addicted2rpg

For background on this problem, see:
http://support.microsoft.com/kb/q249232/

I essentially get a IHTMLWindow2 object, IHTMLDocument2 object, etc..
from an HWND of an internet explorer process. You can think of it as
"hooking", but it probably isn't true hooking since I'm not altering
any normal calls with my own.

Now, I got some image recognition code I want to use with some browser
input. I don't want to use URLDownloadToFile(); because of a nasty
little server protection I'm faced with: The webserver deletes the
image after its downloaded!

This means I only get ONE shot at the file, and URLDownloadToFile()
generates a separate access attempt (after Internet Explorer's access
attempt) -- which won't work for my .... very specializationed
situation. The image will be gone.

However, IE should still have the image in cache, or in RAM, or
wherever it is when it blits to the screen in my browser frame. :) I
searched my Temporary Internet Files and didn't find it there...

What I need to do is find the name of a function to fetch that little
image out of IE and save it to disk.

The closest I came to was something like this:

CComPtr<IHTMLDocument2> spDoc2;
VARIANT sVar;
VARIANT_BOOL bUnused;
BSTR bstrCommand;

sVar.vt = VT_BSTR;
sVar.bstrVal = ::SysAllocString(L"C:\\file.test");
bstrCommand = ::SysAllocString(L"SaveAs");
spWin2->get_document(&spDoc2);
spDoc2->execCommand(bstrCommand, VARIANT_FALSE, sVar, &bUnused);
::SysFreeString(sVar.bstrVal);
::SysFreeString(sCmd.bstrVal);
--

However, god bless Microsoft, SaveAs.... doesn't work =-) They admit
it so in MSDN KB244757.

I am willing to try orthodox or unorthodox solutions alike. Some
function names or DLL names of things I could use are proably what I'm
looking for.

However, if anyone knows if I could make a memory pointer and start
walking up the address space to umm... grab... the data from IE's,
memory, that should work as well :)
 
R

red floyd

[completely OT redacted]

Standard C++ knows nothing about IHTMLWindow, HWND, CComPtr, VARIANT,
or IE.

Please ask in a newsgroup topical to Microsoft Windows.

The group microsoft.public.vc.language comes to mind.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,525
Members
44,997
Latest member
mileyka

Latest Threads

Top