更改Windows95的墙纸。
在Delphi中你可以很方便地更改墙纸,请参考以下的程序。
procedureChangeIt;
var
Reg:TregIniFile;
begin
Reg:ΚTRegIniFile.Create(′ControlPanel′);
Reg.WriteString(′desktop′,′Wallpaper′,′c:ιpwin95ιforest.bmp′);
Reg.WriteString(′desktop′,′TileWallpaper′,′1′);
Reg.Free;
SystemParametersInfo(SPI—SETDESKWALLPAPER,0,nil,SPIF—SENDWININICHANGE);
end;
屏蔽系统按键
也许您希望您的程序在运行时不想让用户按系统按键 Alt-Tab 或 Ctrl-Alt-Del,那么可以通过以下的程序段屏蔽这些按键。
procedure TForm1.FormCreate(Sender: TObject);
begin
var
tmp : integer;
begin
tmp := 0;
//屏蔽 Alt-Tab
SystemParametersInfo( SPI_SETFASTTASKSWITCH
1
@tmp
0);
//屏蔽 Ctrl-Alt-Del
SystemParametersInfo( SPI_SCREENSAVERRUNNING
1
@tmp
0); end; end;
更换墙纸
SystemParametersInfo(SPI_SETDESKWALLPAPER
0
PChar(''WallPaper.BMP''
0);
设置系统日期和时间:
例如:
var
MyST:TSystemTime;
begin
with MyST do
begin
wYear:=1998;
wMonth:=12;
wDay:=7;
wHour:=8;
wMinute:=9;
wSecond:=10;
end;
SetSystemTime(MyST);
end;
s
如果隐藏和显示Windows的任务条?(Delphi 3 and 2.0)
如果隐藏和显示Windows的任务条?仅仅调用以下的函数就可以.
procedure hideTaskbar; //隐藏
var
wndHandle : THandle;
wndClass : array[0..50] of Char;
begin
StrPCopy(@wndClass[0]
''Shell_TrayWnd'');
wndHandle := FindWindow(@wndClass[0]
nil);
ShowWindow(wndHandle
SW_HIDE);
End;
procedure showTaskbar;
var
wndHandle : THandle;
wndClass : array[0..50] of Char;
begin
StrPCopy(@wndClass[0]
''Shell_TrayWnd'');
wndHandle := FindWindow(@wndClass[0]
nil);
ShowWindow(wndHandle
SW_RESTORE);
end;
控制面板大全
在程序运行过程中启动控制面板的各个设置功能:
var x:cardinal;
begin
{启动控制面板}
x:=winexec(''rundll32.exe shell32.dll
Control_RunDLL''
9);
{辅助选项 属性-键盘}
x:=winexec(''rundll32.exe shell32.dll
Control_RunDLL access.cpl
1''
9);
{辅助选项 属性-声音}
x:=winexec(''rundll32.exe shell32.dll
Control_RunDLL access.cpl
2''
9);
{辅助选项 属性-显示}
x:=winexec(''rundll32.exe shell32.dll
Control_RunDLL access.cpl
3''
9);
{辅助选项 属性-鼠标}
x:=winexec(''rundll32.exe shell32.dll
Control_RunDLL access.cpl
4''
9);
{辅助选项 属性-常规}
x:=winexec(''rundll32.exe shell32.dll
Control_RunDLL access.cpl
5''
9);
{添加/删除程序 属性-安装/卸载}
x:=winexec(''rundll32.exe shell32.dll
Control_RunDLL Appwiz.cpl
1''
9);
{添加/删除程序 属性-Windows安装程序}
x:=winexec(''rundll32.exe shell32.dll
Control_RunDLL Appwiz.cpl
2''
9);
{添加/删除程序 属性-启动盘}
x:=winexec(''rundll32.exe shell32.dll
Control_RunDLL Appwiz.cpl
3''
9);
{显示 属性-背景}
x:=winexec(''rundll32.exe shell32.dll
Control_RunDLL desk.cpl
0''
9);
{显示 属性-屏幕保护程序}
x:=winexec(''rundll32.exe shell32.dll
Control_RunDLL desk.cpl
1''
9);
{显示 属性-外观}
x:=winexec(''rundll32.exe shell32.dll
Control_RunDLL desk.cpl
2''
9);
{显示 属性-设置}
x:=winexec(''rundll32.exe shell32.dll
Control_RunDLL desk.cpl
3''
9);
{Internet 属性-常规}
x:=winexec(''rundll32.exe shell32.dll
Control_RunDLL Inetcpl.cpl
0''
9);
{Internet 属性-安全}
x:=winexec(''rundll32.exe shell32.dll
Control_RunDLL Inetcpl.cpl
1''
9);
{Internet 属性-内容}
x:=winexec(''rundll32.exe shell32.dll
Control_RunDLL Inetcpl.cpl
2''
9);
{Internet 属性-