Napíšeme
si dvě procedury. Jedna bude mít za úkol měnit nastavení barev podle chuti, druhá vrátí vše do původního stavu. Připomínám, že nesmíte zapomenout přidat do Uses knihovnu CommCtrl.
.
.
.
uses CommCtrl;
.
.
.
procedure SetDesktopIconColor(BarvaTextu, BarvaPozadi: TColor; Trans: Boolean);
var Window: HWND;
begin
Window := FindWindow('Progman', 'Program Manager');
Window := FindWindowEx(Window, HWND(nil), 'SHELLDLL_DefView', '');
Window := FindWindowEx(Window, HWND(nil), 'SysListView32', '');
if Trans then ListView_SetTextBkColor(Window, $ffffffff)
else ListView_SetTextBkColor(Window, BarvaPozadi);
ListView_SetTextColor(Window, BarvaTextu);
ListView_RedrawItems(Window, 0, ListView_GetItemCount(Window) - 1);
UpdateWindow(Window);
end;
.
.
.
uses CommCtrl;
.
.
.
procedure SetDesktopIconColor(BarvaTextu, BarvaPozadi: TColor; Trans: Boolean);
var Window: HWND;
begin
Window := FindWindow('Progman', 'Program Manager');
Window := FindWindowEx(Window, HWND(nil), 'SHELLDLL_DefView', '');
Window := FindWindowEx(Window, HWND(nil), 'SysListView32', '');
if Trans then ListView_SetTextBkColor(Window, $ffffffff)
else ListView_SetTextBkColor(Window, BarvaPozadi);
ListView_SetTextColor(Window, BarvaTextu);
ListView_RedrawItems(Window, 0, ListView_GetItemCount(Window) - 1);
UpdateWindow(Window);
end;
<< Home