• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

windows API & background processes

CTho9305

Elite Member
I'm running a GUI app as SYSTEM user from a web server script, and I'm trying to get a screenshot. My code for the screenshot taker is here (note that it takes the shot on WM_SIZE, which occurs right after the app launches... a hack, but it will be adequate for now). When I run the app interactively, it takes a screenshot and saves it properly. However, as a SYSTEM process in the background, it does the following:

if hWND=GetDesktopWindow(), produces an ERROR_INVALID_HANDLE in BitBlt

if hWND = GetForegroundWindow/FindWindow, produces an ERROR_INVALID_WINDOW_HANDLE in GetWindowRect

Is there a way to do what I'm trying to do?
 
Back
Top