I developing a small program that I want working as a widget, and would like to display it only when no window has focus - or when the desktop window has focus.

My best chance now is finding whether GetFocus() returns NULL but this is not working as suspected. I've also tried with GetForegroundWindow() and the windows returned with GetGUIThreadInfo().

Thank you.

Nevermind, I finally managed to figure it out. For those wondering:

if(GetShellWindow() == GetForegroundWindow())
   //Then the desktop is in focus
commented: nice one :) +27