Home > Back-end >  How C builder programming simulation F5 to refresh the desktop?
How C builder programming simulation F5 to refresh the desktop?

Time:10-12

To remove a software generated on the desktop icon, after deleting the registry, must F5 to refresh, desktop ICONS will disappear, how c + + BUILDER programming?

CodePudding user response:

SHChangeNotify
http://blog.csdn.net/wowolook/article/details/8263001

CodePudding user response:

Thanks, try tomorrow! In addition to see have personal say use SHChangeNotify (SHCNE_ASSOCCHANGED SHCNF_IDLIST, NULL, NULL); To refresh icon, but always work under Windows XP, Windows 7, normally

CodePudding user response:

 : : SHChangeNotify (SHCNE_ASSOCCHANGED, SHCNF_IDLIST | SHCNF_FLUSH, NULL, NULL); 

CodePudding user response:

Studied the

CodePudding user response:

The simulation button "F5" success:
HWND HWND=: : GetDesktopWindow ();
HWnd=: : FindWindowEx (hWnd, 0, "Progman", 0).
HWnd=: : FindWindowEx (hWnd, 0, "SHELLDLL_DefView", 0).
HWnd=: : FindWindowEx (hWnd, 0, "SysListView32", 0).//when the hWnd is that you need
//InvalidateRect (hWnd, TRUE);
//hWnd - & gt; Invalidate (false);
//: : InvalidateRect (hWnd, 0, TRUE);
//: : InvalidateRect (NULL, NULL, TRUE);
: : PostMessage (hWnd, WM_KEYDOWN, VK_F5, 0);
: : PostMessage (hWnd, WM_KEYUP, VK_F5, 0);
  • Related