— Jim Kinghorn, Taylor Technology Services
Hi Jim. You are running into one of the peculiarities of Session 0 — where user interface elements do not seem to be refreshed consistently. Unfortunately it is a “Windows thing” and is outside the control of AlwaysUp.
But all is not lost! Our development team took a look at your situation and concluded that calling the Windows RedrawWindow API function in Session 0 might fix the problem.
You have a couple of options:
Option #1: Update your code to refresh all windows periodically
Specifically, your code should:
Refresh the desktop window, by calling the VB6 equivalent of:
RedrawWindow(NULL, NULL, NULL, RDW_INVALIDATE | RDW_ALLCHILDREN)
Enumerate all top-level windows (using the EnumWindows API function) and call RedrawWindows on each visible window.
Performing those operations every few seconds should eliminate the black windows in Session 0.
Option #2: Setup our “RefreshWindows” utility to run in Session 0
If updating the code is not a viable option, you can:
Download our free RefreshWindows command line utility and save it to a folder of your choice. When run, the utility refreshes all windows every 5 seconds (using the RedrawWindows and EnumWindows functions as recommended above):
Set it up as a Windows Service with AlwaysUp. All you should have to provide is the full path to the executable file on the “General” tab:
When your machine boots, AlwaysUp will launch RefreshWindows.exe to ensure that all windows in Session 0 are periodically refreshed and properly drawn.
Enjoy!