FUNC.PAS in pedump192(2).zip


err...Original Link
    Sponsored links

			
unit func;

interface

uses
  Sysutils, Windows, Controls, Registry, Inifiles, Forms;

function MyPath:String;
function DirectoryExists(const Name: String): Boolean;
procedure AssocExeDllFile(Add_Del:Boolean);

implementation

function MyPath:String;
begin
  Result:=ExtractFilePath(ParamStr(0));
  if Result[Length(Result)]<>'\' then
    Result:=Result+'\';
end;

function DirectoryExists(const Name: String): Boolean;
var
  Code: Integer;
begin
  Code := GetFileAttributes(PChar(Name));
  Result := (Code <> -1) and (FILE_ATTRIBUTE_DIRECTORY and Code <> 0);
end;

procedure AssocExeDllFile(Add_Del:Boolean);
var
  Reg:TRegistry;
  Key1,Key2:String;
begin
  Reg:=TRegistry.Create;
  try
    Reg.RootKey:=HKEY_CLASSES_ROOT;
    Key1:='\exefile\Shell\用 PEDUMP 分析';
    Key2:='\dllfile\Shell\用 PEDUMP 分析';
    if Add_Del then
    begin{Add}
      Reg.OpenKey(Key1+'\Command',True);
      Reg.WriteString('',Application.ExeName+' "%1"');
      Reg.OpenKey(Key2+'\Command',True);
      Reg.WriteString('',Application.ExeName+' "%1"');
    end else
    begin{Delete}
      Reg.OpenKey(Key1+'\Command',True);
      Reg.DeleteKey(Key1);
      Reg.OpenKey(Key2+'\Command',True);
      Reg.DeleteKey(Key2);
    end;
    Reg.CloseKey;
  finally
    Reg.Free;
  end;
end;

procedure SetWinPos(WinForm:TForm);
var
  StrPos,StrScr:String;
begin
  {left,top,width,height}
  StrPos:=Format('%d,%d,%d,%d',[WinForm.Left,WinForm.Top,WinForm.Width,WinForm.Height]);
  StrScr:=Format('WinPos(%d,%d)',[Screen.Width,Screen.Height]);
  with TInifile.Create(MyPath+'pedump.ini') do
  begin
    WriteString('pedump',StrScr,StrPos);
  end;
end;

procedure GetWinPos(WinForm:TForm);
const
  SEP=',';
var
  i:Integer;
  StrPos,StrScr:String;
begin
  StrScr:=Format('WinPos(%d,%d)',[Screen.Width,Screen.Height]);
  with TInifile.Create(MyPath+'pedump.ini') do
  begin
    StrPos:=ReadString('pedump',StrScr,'0,0,0,0');
  end;
  {left}
  i:=Pos(SEP,StrPos);
//  if i=0 then raise Er			

			...
			...
			... to be continued.

  This is a preview. To get the complete source file, 
  please click here to download the whole source code package.

			
			


Project Files

    Sponsored links
NameSizeDate
 pedump.exe711.00 kB06-15-02 09:11
 readme.txt126.00 B06-13-03 15:24
 06.00 B
 FUNC.DCU4.66 kB11-12-01 04:15
 FUNC.PAS4.58 kB05-12-01 16:46
 PEDump.txt10.01 kB05-02-01 16:47
 Project1.cfg1.03 kB06-15-02 09:11
 Project1.dof1.83 kB06-15-02 09:11
 Project1.dpr284.00 B05-04-01 15:45
 Project1.res1.58 kB06-15-02 09:11
 README.TXT1.43 kB11-12-01 04:20
 06.00 B
 FILTER.BMP238.00 B05-25-98 00:00
 HOMEPAGE.JPG21.24 kB04-19-01 17:03
 OPEN.BMP1.29 kB05-25-98 00:00
 OUT.BMP1.30 kB04-23-01 10:47
 SAVE.BMP1.29 kB05-25-98 00:00
 TITLE.ICO766.00 B04-19-01 16:49
 06.00 B
 06.00 B
 PEDUMP.EXE36.00 kB04-08-01 19:08
 Unit1.dcu65.77 kB06-15-02 09:10
 Unit1.ddp51.00 B06-15-02 09:10
 Unit1.dfm66.95 kB06-15-02 09:10
 Unit1.pas63.86 kB06-15-02 09:10
 Unit2.dcu14.25 kB11-12-01 04:15
 Unit2.dfm4.22 kB05-06-01 09:51
 Unit2.pas8.95 kB05-06-01 10:34
 06.00 B
 +++22.00 kB06-14-02 12:58
 -359.50 kB06-14-02 16:50
 -23.00 kB06-14-02 12:51
 711686.00 B
...

Related Items

    Sponsored links