I have written a desktop application that will take a screenshot of a running application based on the selected window's handle (saved to variable intHandle) and it works fine. It only takes a screenshot of that specific application's window. It takes the screenshot and analyzes the image every second and continues to run fine even when the PC is locked or the application is not the active window.
Problem 1: When I log on through remote desktop, it appears to ignore the passed in Window Handle and now takes a screenshot of the active remote desktop window and not the specific application window.
Dim sc As New ScreenShot.ScreenCapture
Dim Screenshot As Image = sc.CaptureWindow(intHandle)
I have confirmed that that intHandle has not changed between logging on locally, switching to remotely and then back to locally. How do I get it to only take the screenshot of only the window with the intHandle when logged on through remote desktop?
Problem 2: When I disconnect from the remote desktop with the screenshot app running, It just creates black screenshots with no image but the size is still the correct size. Once I logon locally again it resumes capturing the specific application window based on the intHandle. How do I get it to continue to take screenshots of the window with the intHandle and not just create a blank, black image?