SendMessage 刷新系统桌面

//方法1 

uses ShlObj; 
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, nil, nil);


//方法2
procedure
TForm1.Button1Click(Sender: TObject);
begin
    SendMessage(FindWindow( 'Progman', 'Program Manager'), WM_COMMAND, $A065, 0);
end;


//方法3
procedure
RefreshDesktop; 
var c1: THandle;
begin
  c1 :=FindWindowEx(FindWindowEx(FindWindow( 'Progman', 'Program Manager'), 0, 'SHELLDLL_DefView', ''), 0, 'SysListView32', '');
  PostMessage(c1,WM_KEYDOWN,VK_F5, 0);
  PostMessage(c1,WM_KEYUP,VK_F5, 1 shl 31);
end;





你可能感兴趣的:(message)