Delphi之三十六计之系统篇

2019-06-19 23:05:16 来源: 晋城信息港

  begin

  SetArguments(Pchar(Parameter));

  SetPath(Pchar(FileName));

  SetWorkingDirectory(Pchar(ExtractFilePath(FileName)));

  end;

  MyReg := eate(

  "Software\MicroSoft\Windows\CurrentVersion\Explorer");

  if ((FolderNo $#@60; 0) or (FolderNo $#@62; 2)) then

  FolderNo := 0;

  Directory := adString("Shell Folders", Folder[FolderNo],"");

  //CreateDir(Directory);

  WFileName := Directory + "\" + LinkName + ".lnk";

  ve(PWChar(WFileName),False);

  ee;

  end;

  例如:在桌面、开始菜单、程序菜单中添加计算器的快捷方式:

  SetLink(0, "c:\windows\e", "", "计算器");

  SetLink(1, "c:\windows\e", "", "计算器");

  SetLink(2, "c:\windows\e", "", "计算器");

  5.一个利用系统时间产生随机数的程序

  function Myrandom(Num: Integer): integer;

  var

  T: _SystemTime;

  X: integer;

  I: integer;

  begin

  Result := 0

  If Num = 0 then Exit;;

  GetSystemTime(T);

  X := Trunc(illiseconds/10) * econd * 1231;

  X := X + random(1);

  if X $#@60; 0 then X := -X;

  X := Random(X);

  X := X mod num;

  for I := 0 to X do

  X := Random(Num);

  Result := X;

  end;查看本文来源

婴儿便秘的解决方法
婴儿便秘怎么办
婴儿手心出汗
本文标签: