windows - Hook to Win32 API event to get notified when Desktop fully loads -


When a user logs in and visualizes the scenario without switching out to any other user. Then switch back while switching back (because we have never signed out), Windows will first show a black desktop, then flick some window (especially with 2 monitors), then finally, whatever we left off , Arranged everything in that situation. This playful and rearrangement takes some time (about 1 second).

What would be the most effective way to get information about the complete loading of the desktop? I need this because I want to call my specific function when the desktop is fully loaded.

One option is to hook up to WM_PAINT , but I use Spy ++ and I get 12 WM_PAINT events on the desktop, So anyone is aware of any other way?

Here is a sample code that I have tested and it has actually worked with fast user switching in Windows 8.1:

  while (true) {HRESULT hr = DwmFlush (); If (hr == s_ok) {std :: cout & lt; & Lt; "True" & lt; & Lt; Std :: endl; } And {std :: cout & lt; & Lt; "Incorrect" & lt; & Lt; Std :: endl; } Sleep (1000); }  

Comments