You was actually onto something. The problem was you were expecting that final step to actually hide desktop icons on the spot. It would toggle the "Show Desktop Icons" menu item state. This also uses registry item ' HideIcons ' which it toggled with. If you would have re-booted the computer, it would have been obvious it worked the way it was intended to.
I originally thought SHChangeNotify could bring us with that final step. While it refreshed the desktop, it would not consider the Show or Hidden states.
Therefore adding the following, would suffice.
Code: Select all
ShowWindow_(FindWindow_(0, "Program Manager"), #SW_HIDE)