⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 u00403.pas

📁 Delphi编程五大妙招源程序
💻 PAS
字号:
unit U00403;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, registry;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
  private
    { Private declarations }
    function GetDefBrower:string;
    function GetBrowerPath(AValue:String):string;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
  SendMessage(HWND_BROADCAST,WM_SYSCOMMAND,SC_SCREENSAVE,0);
end;

procedure TForm1.Button2Click(Sender: TObject);
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); {添加/删除程序 属性-安装/卸载}
    x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Appwiz.cpl,,2',9); {添加/删除程序 属性-Windows安装程序}
    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); {显示 属性-设置}
    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 属性-内容}
    x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Inetcpl.cpl,,3',9); {Internet 属性-连接}
    x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Inetcpl.cpl,,4',9); {Internet 属性-程序}
    x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Inetcpl.cpl,,5',9); {Internet 属性-高级}
    x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Intl.cpl,,0',9); {区域设置 属性-区域设置}
    x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Intl.cpl,,1',9); {区域设置 属性-数字}
    x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Intl.cpl,,2',9); {区域设置 属性-货币}
    x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Intl.cpl,,3',9); {区域设置 属性-时间}
    x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Intl.cpl,,4',9); {区域设置 属性-日期}
    x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Joy.cpl,,0',9); {游戏控制器-一般}
    x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Joy.cpl,,1',9); {游戏控制器-高级}
    x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Main.cpl',9); {鼠标 属性}
    x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Mmsys.cpl,,0',9); {多媒体 属性- 音频}
    x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Mmsys.cpl,,1',9); {多媒体 属性- 视频}
    x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Mmsys.cpl,,2',9); {多媒体 属性  -MIDI}
    x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Mmsys.cpl,,3',9); {多媒体 属性  -CD音乐}
    x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Mmsys.cpl,,4',9); {多媒体 属性- 设备}
    x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Modem.cpl',9); {调制解调器 属性}
    x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Netcpl.cpl',9); {网络}
    x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Password.cpl',9); {密码 属性}
    x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Sticpl.cpl',9); {扫描仪与数字相机属性}
    x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Sysdm.cpl,,0',9); {系统 属性-常  规}
    x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Sysdm.cpl,,1',9); {系统 属性-设  备管理器}
    x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Sysdm.cpl,,2',9); {系统 属性-硬  件配置文件}
    x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Sysdm.cpl,,3',9); {系统 属性-性  能}
    x:=winexec('rundll32.exe shell32.dll,Control_RunDLL timedate.cpl',9); {日期/时间 属  性}
    x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Powercfg.cpl',9); {电源管理 属性 }
    x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Telephon.cpl',9); {拨号属性}
    {----------------------调用错误----------------------}
    if x=0 then messagebox(0,'程序超出内存','错误',0);
    if x=ERROR_BAD_FORMAT then messagebox(0,'该程序非一个合法的Win32.EXE程序).','错误',0);
    if x=ERROR_FILE_NOT_FOUND then messagebox(0,'指定文件没找到','错误',0);
    if x=ERROR_PATH_NOT_FOUND then messagebox(0,'指定路径没找到','错误',0);
end;

function TForm1.GetBrowerPath(AValue: String): string;
var
  X:integer;
  tmpstr:string;
begin
  Result:='没有默认的浏览器';
  if AValue='' then exit;
  for X:=2 to Length(AValue) do
  begin
    if AValue[X]='''' then break;
    tmpstr:=tmpstr+AValue[X];
  end;
  Result:=tmpStr;
end;

function TForm1.GetDefBrower: string;
var
  Reg:TRegistry;
begin
  Result:='';
  Reg:=TRegistry.Create;
  try
    reg.RootKey:=HKEY_CLASSES_ROOT;
    if Reg.OpenKey('\http\shell\open\command',false)then
      if Reg.ValueExists('')then Result:=Reg.ReadString('');
    Reg.Closekey;
  finally
  Reg.Free;
  end;
end;

procedure TForm1.Button3Click(Sender: TObject);
var
  tmpstr:string;
begin
  tmpstr:=GetDefbrower;
  tmpstr:=GetBrowerpath(tmpstr);
  showMessage(tmpstr);
end;


end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -