1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68:
| procedure TFRM_MAIN.ApplicationEvents1Message(var Msg: tagMSG; var Handled: Boolean); var Str:String; i,j,x:integer; IstStringWithSpace,SimpleMode:Boolean; Files:TStringList; CurFile:String; CorrectFiles:TStringList; begin
if (Msg.message = ActivationMessage) then begin Str:=(ReadStringFromMMF(MyGUID + 'MMF')); Str:=StringReplace(Str,'"','',[]);
Files:=TStringlist.Create; CorrectFiles:=TStringlist.Create; IstStringWithSpace:=false; SimpleMode:=true; CurFile:='';
for i:=1 to length(Str) do begin CurFile:=CurFile+Str[i]; if not (i+1 > length(Str) ) then begin if (Str[i] = ' ') and (Str[i+1] = ' ') then begin Files.Add(CurFile); CurFile:=''; end; end else begin Files.Add(CurFile); CurFile:=''; end; end;
for i:=0 to Files.Count-1 do begin CurFile:=Files.Strings[i]; if (Copy(CurFile,0,1) = '"') or (Copy(CurFile,0,1) = ' ') then Delete(CurFile,1,1); if (Copy(CurFile,0,1) = '"') or (Copy(CurFile,0,1) = ' ') then Delete(CurFile,1,1);
if (Copy(CurFile,length(CurFile),length(CurFile)) = '"') or (Copy(CurFile,length(CurFile),length(CurFile)) = ' ') then Delete(CurFile,length(CurFile),length(CurFile));
if (Copy(CurFile,length(CurFile),length(CurFile)) = '"') or (Copy(CurFile,length(CurFile),length(CurFile)) = ' ') then Delete(CurFile,length(CurFile),length(CurFile));
if not (lowercase(CurFile) = lowercase(ParamStr(0))) and (FileExists(CurFile) or DirectoryExists(CurFile)) then begin if not CorrectFiles.Find(CurFile,x) then begin CorrectFiles.Add(CurFile); end; end; end; ProceedInstanceParameters(CorrectFiles); Handled := True; end; end; |