问题
Is it possible to repaint a window when there are no active users logged on to a windows machine using c sharp? And will that window be available to screen capture program? Or is it not possible at all and a user must be logged into the machine.
I make use of the below:
SetForegroundWindow(handle);
InvalidateRect(IntPtr.Zero, IntPtr.Zero, true);
UpdateWindow(handle);
Thanks all for any help
回答1:
Since there is no user logged in, there is no UI running.
So, no, you can't repaint under such circumstances (there is no window to repaint).
回答2:
Yes it is, the logon screen is a special desktop (Windows can have several desktops). A smilar question (but not identical): WPF Window on Winlogon Desktop
More information on desktops and the winlogon desktop: http://msdn.microsoft.com/en-us/library/ms682573(v=vs.85).aspx
来源:https://stackoverflow.com/questions/5695235/repaint-window-when-no-users-are-logged-in