Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / September 2005

Tip: Looking for answers? Try searching our database.

Capturing a panel when its form is minimized

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Carsten Klotz - 30 Sep 2005 21:25 GMT
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.
Pete Davis - 30 Sep 2005 23:18 GMT
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

> Hi,
>
[quoted text clipped - 16 lines]
> Thanks in advance,
> Carsten.
Carsten Klotz - 01 Oct 2005 00:24 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.