Changeset 353
- Timestamp:
- Jun 12, 2009, 8:24:30 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NewView/ViewStub.pas
r256 r353 57 57 Function FindExistingWindow(aCmdLineParameters : TCmdLineParameters) : HWND; 58 58 var 59 tmpFileItems: TStringList;60 59 tmpFilenames: TStringList; 61 60 tmpFullFilePath: string; 62 61 i: longint; 63 64 FileWindow: HWND; 62 tmpFileWindow: HWND; 63 65 64 begin 66 65 result := NULLHANDLE; 67 66 68 if aCmdLineParameters.getFileNames(false) = '' then 67 if aCmdLineParameters.getFileNames(true) = '' then 68 begin 69 69 // not loading files; nothing to check 70 70 exit; 71 72 tmpFileItems := TStringList.Create; 71 end; 72 73 73 tmpFilenames := TStringList.Create; 74 74 75 StrExtractStrings(tmpFileItems, aCmdLineParameters.getFileNames(false), [HELP_FILE_DELIMITER], #0); 76 TranslateIPFEnvironmentVars(tmpFileItems, tmpFileNames ); 75 ParseAndExpandFileNames(aCmdLineParameters.getFileNames(true), tmpFilenames); 77 76 78 77 for i := 0 to tmpFileNames.Count - 1 do 79 78 begin 80 tmpFullFilePath := FindHelpFile( tmpFilenames[ i ] ); 79 LogEvent(LogStartup, 'Search in GlobalFileList for ''' + tmpFilenames[i] + ''''); 80 81 tmpFullFilePath := FindHelpFile( tmpFilenames[i] ); 81 82 if tmpFullFilePath <> '' then 82 83 begin 83 FileWindow := GlobalFilelist.FindFile(tmpFullFilePath);84 85 if FileWindow = NULLHANDLE then84 tmpFileWindow := GlobalFilelist.FindFile(tmpFullFilePath); 85 86 if tmpFileWindow = NULLHANDLE then 86 87 begin 87 88 // not found - stop searching. … … 91 92 92 93 // found it 94 LogEvent(LogStartup, 'Found in GlobalFileList for ''' + tmpFullFilePath + ''''); 93 95 94 96 // is it the same as any previous match? 95 97 if Result <> NULLHANDLE then 96 98 begin 97 if FileWindow <> Result then99 if tmpFileWindow <> Result then 98 100 begin 99 101 // no, so we don't have a match. … … 107 109 begin 108 110 // no match yet - store this one 109 result := FileWindow;111 result := tmpFileWindow; 110 112 end; 111 113 end; … … 113 115 114 116 tmpFilenames.Destroy; 115 tmpFileItems.Destroy;116 117 end; 117 118
Note:
See TracChangeset
for help on using the changeset viewer.