你要代码我要分,注意关闭之后,必须重新启动系统才能重新打开时钟!
procedure DisableStartMenu;
var
Handle, ChildHandle, SecLayerH: HWND;
clsName: pchar;
begin
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) = '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;