隐藏系统tray:
showwindow(findwindow('Shell_TrayWnd',nil),SW_HIDE); // 隐藏
showwindow(findwindow('Shell_TrayWnd',nil),SW_NORMAL); // 恢复
procedure TForm1.DisableStartMenu;
var
Handle,ChildHandle,SecLayerH,H:HWND;
clsName:pchar;
begin
h:=findwindow('progman',nil);
if h<>0 then
showwindow(h,sw_hide);
//
getmem(clsName,255);
Handle:=FindWindow('Shell_TrayWnd',nil);
if Handle<>0 then
begin
ChildHandle:=GetWindow(Handle,GW_Child);
while ChildHandle<>0 do
begin
GetClassName(ChildHandle,clsName,255);
if string(clsName)='Button' then
begin
PostMessage(ChildHandle,WM_SYSCOMMAND,SC_CLOSE,0);
end;
if string(clsName)='TrayNotifyWnd' then
begin
SecLayerH:=GetWindow(ChildHandle,GW_CHILD);
while SecLayerH<>0 do
begin
GetClassName(SecLayerH,clsName,255);
if string(clsName)='TrayClockWClass' then
begin
PostMessage(SecLayerH,WM_SYSCOMMAND,SC_CLOSE,0);
end;
SecLayerH:=GetWindow(SecLayerH,GW_HWNDNEXT);
end;
end;
ChildHandle:=GetWindow(ChildHandle,GW_HWNDNEXT);
end;
end;
freemem(clsName,255);
end;