Как обновить рабочий стол (Desktop)
Компилятор: Delphi
Способ 1:
procedure TForm1.Button1Click(Sender: TObject);
begin
SendMessage(FindWindow('Progman', 'Program Manager'),
WM_COMMAND,
$A065,
0);
end;
Способ 2:
procedure RefreshDesktop;
var
hDesktop: HWND;
begin
hDesktop := FindWindowEx(FindWindowEx(
FindWindow('Progman', 'Program Manager'), 0,
'SHELLDLL_DefView', ''), 0, 'SysListView32',
'');
PostMessage(hDesktop, WM_KEYDOWN, VK_F5, 0);
PostMessage(hDesktop, WM_KEYUP, VK_F5, 1 shl 31);
end;
|