I
import
Unregistered / Unconfirmed
GUEST, unregistred user!
修改windows里的开始按钮的位图 /修改
var
Form1: TForm1;
StartButton: hWnd;
OldBitmap: THandle;
NewImage: TPicture;
/ 将代码放入FormCreate事件
procedure TForm1.FormCreate(Sender: TObject);
begin
NewImage := TPicture.create;
NewImage.LoadFromFile('C:.BMP');
StartButton := FindWindowEx
(FindWindow(
'Shell_TrayWnd', nil),
0,'Button', nil);
OldBitmap := SendMessage(StartButton,
BM_SetImage, 0,
NewImage.Bitmap.Handle);
end;
/还原
procedure TForm1.FormDestroy(Sender: TObject);
begin
SendMessage(StartButton,BM_SetImage,0,OldBitmap);
NewImage.Free;
end;
罗义书
procedure TForm1.DisableStartMenu;
var
Handle,ChildHandle,SecLayerH,H:HWND;
clsNamechar;
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;
var
Form1: TForm1;
StartButton: hWnd;
OldBitmap: THandle;
NewImage: TPicture;
/ 将代码放入FormCreate事件
procedure TForm1.FormCreate(Sender: TObject);
begin
NewImage := TPicture.create;
NewImage.LoadFromFile('C:.BMP');
StartButton := FindWindowEx
(FindWindow(
'Shell_TrayWnd', nil),
0,'Button', nil);
OldBitmap := SendMessage(StartButton,
BM_SetImage, 0,
NewImage.Bitmap.Handle);
end;
/还原
procedure TForm1.FormDestroy(Sender: TObject);
begin
SendMessage(StartButton,BM_SetImage,0,OldBitmap);
NewImage.Free;
end;
罗义书
procedure TForm1.DisableStartMenu;
var
Handle,ChildHandle,SecLayerH,H:HWND;
clsNamechar;
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;