المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : "Screenshot" from handle?



C# Programming
08-06-2009, 11:56 PM
Given a window handle (IWin32Window), it is possible to get a "screenshot" of what this window currently looks like?

For example, if I have a form that is in some error state, I'd normally call some generic error handler function to display a message and/or log it...this function could be provided with the window handle of the caller...and I'd like this function to take a "screenshot" of the window that made the call, wired up in such a way that anybody could call it in some generic fashion.

I must admit I haven't yet fully thought this through...does this even make sense?

(or, I suppose I could use a Form parameter instead of an IWin32Window, if it would make things easier...)