禁止开始菜单的时钟

  • 主题发起人 主题发起人 import
  • 开始时间 开始时间
I

import

Unregistered / Unconfirmed
GUEST, unregistred user!
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;
 
后退
顶部