}

Delphi.int.ru — Портал программистов

Вход Регистрация | Забыли пароль?

Просмотр кода

Идентификатор: 2b1ab809 Описание: Код загружен: 7 июля 2011, 15:11 (min@y™)

program SourceEditor;
 
{%ToDo 'SourceEditor.todo'}
 
uses
  Forms,
  Windows,
  Messages,
  SysUtils,
  Main in 'Main.pas' {SourceEditorMainForm},
  uPages in 'uPages.pas',
  uXmlUtils in 'uXmlUtils.pas',
  ECXMLParser in 'ECXMLParser.pas',
  ECXMLTokenizer in 'ECXMLTokenizer.pas',
  uRoutines in 'uRoutines.pas',
  uNodes in 'uNodes.pas',
  uConsts in 'uConsts.pas',
  uInputBox in 'uInputBox.pas' {InputBoxForm},
  uEncoding in 'uEncoding.pas',
  uProjectProperties in 'uProjectProperties.pas' {ProjectPropsForm},
  uHLManager in 'uHLManager.pas',
  SynHighlighterBasis in 'SynHighlighterBasis.pas',
  uHighlightForm in 'uHighlightForm.pas' {HighlightForm},
  uGotoLineForm in 'uGotoLineForm.pas' {GotoLineForm},
  uTypes in 'uTypes.pas',
  uLogForm in 'uLogForm.pas' {LogForm},
  uSearchReplaceForm in 'uSearchReplaceForm.pas' {SearchReplaceForm},
  uSettings in 'uSettings.pas',
  uParamsForm in 'uParamsForm.pas' {ParamsForm},
  uAutoComleteForm in 'uAutoComleteForm.pas' {AutocompleteForm},
  uNewKeyForm in 'uNewKeyForm.pas' {NewKeyForm},
  rpVersionInfo in 'rpVersionInfo.pas',
  uHtmlUtils in 'uHtmlUtils.pas',
  uToolBarsForm in 'uToolBarsForm.pas' {ToolBarsForm},
  uBasisUtils in 'uBasisUtils.pas',
  uDeviceAddressForm in 'uDeviceAddressForm.pas' {DeviceAddressForm},
  uCharsForm in 'uCharsForm.pas' {CharsForm},
  uEncodingForm in 'uEncodingForm.pas' {EncodingForm},
  uNewTableForm in 'uNewTableForm.pas' {CreateTableForm},
  uNewLinkForm in 'uNewLinkForm.pas' {CreateLinkForm},
  uTextFinder in 'uTextFinder.pas',
  uTagsForm in 'uTagsForm.pas' {TagsForm},
  uNewTagForm in 'uNewTagForm.pas' {NewTagForm},
  uPageSetupForm in 'uPageSetupForm.pas' {PageSetupForm},
  uPrintPreviewForm in 'uPrintPreviewForm.pas' {PrintPreviewForm},
  uFindInFilesForm in 'uFindInFilesForm.pas' {FindInFilesForm};
 
{$R *.res}
 
const
  // Запуск только одной копии программы
  OneInstMutexName    
  OneInstMutexName       = 'SourceEditorMOneInstanceMutex';
  OneInstActivateMessage = 'SourceEditorActivateMessage';
 
 
procedure HaltProgram;
begin
  try
    if MutexHandle <> 0
      then CloseHandle(MutexHandle);
  except
   //;
end;
 
function IsNextInstance: Bool
end;
 
function IsNextInstance: Boolean;
begin
  Result:= False;
  MutexHandle:= 0;
  MutexHandle:= CreateMutex(nil, True, OneInstMutexName);
 
  if MutexHandle <> 0
   then begin
          if GetLastError = ERROR_ALREADY_EXISTS
           then begin
                  Result:= True;
                  CloseHandle(MutexHandle);
                  MutexHandle:= 0;
                end;
        end;
end;
 
//mmandLine;
var
  PrevMainFormHandle: THandle; // Хэндл формы предыд. копии программы
  FileName: s
var
  PrevMainFormHandle: THandle; //taStruct; // Структура для передачи
  Buffer: array[0..MAX_PATH - 1] of Char; // Буфер для передачи
begin
  FileName:= ParamStr(1);
  Len:= Length(Fi
  Buffer: array[0..MAX_PATH - 1] of Char; //en > MAX_PATH)
    then Exit;
 
  PrevMainFormHandle:= FindWindow('TSourceEditorMainForm', nil);
 
  if PrevMainFormHandle = 0
   
    then Exit;
 
  PrevMainFormHandle:= FindWindow('TSourceEditorMainForm', nil);
 
  if PrevMainFormHandle = 0
    then Exit;
 
  //
  Data.cbData:= SizeOf(Buffer);
  Data.lpData:= @Buffer;
  SendMessage(PrevMainFormHandle, WM_COPYDATA, 0, Intege
  Data.cbData:= SizeOf(Buffer);
  Data.lpData:= @Buffer;
  SendMessage(PrevMainFormHandle, WM_COPYDATA, 0, Integer(@Data));
end;
 
begin
  Application.Initialize;
 
  //         PostMessage(HWND_BROADCAST, ActivateMessage, 0, 0);
           SendCommandLine();
           HaltProgram();
         end;
 
  GlobalInit();
  ProgramSettings:= TProgramSettings.Create
           SendCommandLine();
           HaltProgram();
         end;
 
  GlobalInit();
  ProgramSettings:= TProgramSettings.Create();
  HighlighterManager:= THighlighterManager.Create();
 
  Application.CreateForm(T

Ссылка на данный код:

На главную страницу сервиса обмена кодом »