Capturing a panel when its form is minimized

C

Carsten Klotz

Hi,

does someone know, if it's possible capturing the content of a panel, when
its form has state "minimized"?

Details:
A panel contains a Webbrowser object (AxSHDocVw.AxWebBrowser). My actual
application automatically navigates to some websites, makes a screenshot
and transforms them into small thumbnails. At the moment I'm using the
imported function BitBlt from gdi32.dll. This solutions only works, if the
form has state "normal" and is visible in the front of the screen.

But what I want, is an "invisible" solution, because the user should be not
constricted, while he's working.

Any ideas?

Thanks in advance,
Carsten.
 
P

Pete Davis

I've never actually done this, but you may want to look at using virtual
desktops. I don't know exactly how this works, but my understanding is you
can have a virtual (invisible) desktop where the app runs and then you would
be able to do this stuff "off screen" in a sense.

But you can't do it minimized at all. If the app is minimized, then there's
no web browser window (there is, but not a visible one, and therefore the
window isn't actually getting painted) and if there's no web browser window,
there's nothing to get a screenshot of, which is basically what you're doing
with BitBlt.

Pete
 
C

Carsten Klotz

Am Fri, 30 Sep 2005 17:18:10 -0500 schrieb Pete Davis:
I've never actually done this, but you may want to look at using virtual
desktops. I don't know exactly how this works, but my understanding is you
can have a virtual (invisible) desktop where the app runs and then you would
be able to do this stuff "off screen" in a sense.

Thank you, Pete.

Due to the fact, that the final application should be a console based
application, I'm virtually forced dealing with virtual controls.
But you can't do it minimized at all. If the app is minimized, then there's
no web browser window (there is, but not a visible one, and therefore the
window isn't actually getting painted) and if there's no web browser window,
there's nothing to get a screenshot of, which is basically what you're doing
with BitBlt.

That could be the main reason, why it's not possible getting a working HWND
reference of that AX control (casting to IntPtr results in an unknown
error). I've tested PrintWindow() and WM_Print - also without success.
Anyway PrintWindow() was able capturing the blank, underlying panel on a
minimized form / window.

Maybe someone knows, if it's possible printing the page content like with a
"send to printer"-command, catching the output and converting that data to
a valid bitmap object...

I'm new in C# and thought "Give it a try" and realized quickly, that C# is
a serious alternative. Especially PInvoke seems to be a walk in the park
for an old hand at Java programming...

Best regards,

Carsten
 

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

Top