【Windows Message】MFC 通过F5,刷新桌面

 

    //通过F5,刷新桌面
    HWND hWndProgram = ::FindWindow( _T("Progman"), NULL);
    HWND hWndDefView = ::FindWindowEx( hWndProgram, NULL, _T("SHELLDLL_DefView"), NULL);
    HWND hWndListView= ::FindWindowEx( hWndDefView, NULL, _T("SysListView32"), NULL);
    ::PostMessage( hWndListView, WM_KEYDOWN, VK_F5, 0);
    ::PostMessage( hWndListView, WM_KEYUP, VK_F5, 0);

 

posted @ 2017-08-29 17:24  ~小小鸟~  阅读(363)  评论(0编辑  收藏  举报