OSDN Git Service

・間違えてコミットしたので修正。
[gikonavigoeson/gikonavi.git] / gikoNavi.dpr
1 program gikoNavi;
2
3 {%ToDo 'gikoNavi.todo'}
4
5 uses
6   //MemCheck in 'MemCheck.pas', {'MemCheckStackTrace'\82ð\8fð\8c\8f\82É\92Ç\89Á\81B}
7   Windows,
8   SysUtils,
9   Forms,
10   Messages,
11   MainForm in 'MainForm.pas' {MainWindow},
12   Giko in 'Giko.pas' {GikoForm},
13   Splash in 'Splash.pas' {SplashWindow},
14   About in 'About.pas' {AboutDialog},
15   Option in 'Option.pas' {OptionDialog},
16   Editor in 'Editor.pas' {EditorForm},
17   Round in 'Round.pas' {RoundDialog},
18   ListSelect in 'ListSelect.pas' {ListSelectDialog},
19   Search in 'Search.pas' {SearchDialog},
20   GikoSystem in 'GikoSystem.pas',
21   Setting in 'Setting.pas',
22   BoardGroup in 'BoardGroup.pas',
23   SaveFile in 'SaveFile.pas',
24   Sort in 'Sort.pas',
25   ThreadControl in 'ThreadControl.pas',
26   ItemDownload in 'ItemDownload.pas',
27   RoundData in 'RoundData.pas',
28   RoundName in 'RoundName.pas' {RoundNameDialog},
29   NewBoard in 'NewBoard.pas' {NewBoardDialog},
30   Dolib in 'Dolib.pas',
31   UBase64 in 'Encrypt\UBase64.pas',
32   UCryptAuto in 'Encrypt\UCryptAuto.pas',
33   KeySetting in 'KeySetting.pas' {KeySettingForm},
34   FavoriteAdd in 'FavoriteAdd.pas' {FavoriteAddDialog},
35   NewFavoriteFolder in 'NewFavoriteFolder.pas' {NewFavoriteFolderDialog},
36   FavoriteArrange in 'FavoriteArrange.pas' {FavoriteArrangeDialog},
37   Favorite in 'Favorite.pas' {FavoriteDM: TDataModule},
38   AddressHistory in 'AddressHistory.pas' {AddressHistoryDM: TDataModule},
39   Preview in 'Preview.pas',
40   HTMLDocumentEvent in 'HTMLDocumentEvent.pas',
41   Kotehan in 'Kotehan.pas' {KotehanDialog},
42   MonaUtils in 'MonaUtils.pas',
43   HintWindow in 'HintWindow.pas',
44   GikoUtil in 'GikoUtil.pas',
45   ToolBarSetting in 'ToolBarSetting.pas' {ToolBarSettingDialog},
46   ToolBarUtil in 'ToolBarUtil.pas',
47   YofUtils in 'YofUtils.pas',
48   AbonUnit in 'AbonUnit.pas',
49   IndividualAbon in 'IndividualAbon.pas' {IndividualAbonForm},
50   Trip in 'Trip.pas',
51   GikoXMLDoc in 'GikoXMLDoc.pas',
52   ExternalBoardManager in 'ExternalBoardManager.pas',
53   ExternalThreadItem in 'ExternalThreadItem.pas',
54   ExternalBoardItem in 'ExternalBoardItem.pas',
55   ExternalBoardPlugInMain in 'ExternalBoardPlugInMain.pas',
56   ExternalFilePath in 'ExternalFilePath.pas';
57
58 {$R *.RES}
59 {$R gikoResource.res}
60
61 var
62         hMutex: THandle;
63         Wnd{, AppWnd}: HWnd;
64         i: Integer;
65         CDS: TCopyDataStruct;
66 const
67         MutexString: string = 'gikoNaviInstance';
68 begin
69         hMutex := OpenMutex(MUTEX_ALL_ACCESS, False, PChar(MutexString));
70         if hMutex <> 0 then begin
71                 //\83~\83\85\81[\83e\83b\83N\83X\82ª\91\8dÝ\82µ\82½\8fê\8d\87\82Í\8bN\93®\92\86\8e~
72                 Wnd := FindWindow('TGikoForm', nil);
73                 if Wnd <> 0 then begin
74                         //\8aù\82É\8bN\93®\8dÏ\82Ý\83M\83R\83i\83r\82Ì\83A\83N\83e\83B\83u\89»\81\95\83A\83C\83R\83\93\89»\82³\82ê\82Ä\82½\82ç\95\9c\8c³
75                         SetForegroundWindow(Wnd);
76                         if IsIconic(Wnd) then
77                                 SendMessage(Wnd, WM_SYSCOMMAND, SC_RESTORE, -1);
78 //                      AppWnd := GetWindowLong(Wnd, GWL_HWNDPARENT);
79 //                      if (AppWnd <> 0) and (IsIconic(AppWnd)) then
80 //                              SendMessage(AppWnd, WM_SYSCOMMAND, SC_RESTORE, -1);
81
82                         //\82Å\81A\88ø\90\94\82ª\82 \82Á\82½\82ç\8bN\93®\8dÏ\82Ý\83M\83R\83i\83r\82É\91\97\82é
83                         for i := 1 to ParamCount do     begin
84                                 CDS.dwData := 0;
85                                 CDS.cbData := Length(ParamStr(i)) + 1;
86                                 GetMem(CDS.lpData, CDS.cbData);
87                                 try
88                                         StrPCopy(CDS.lpData, ParamStr(i));
89                                         SendMessage(Wnd, WM_COPYDATA, 0, LParam(@CDS));
90                                 finally
91                                         FreeMem(CDS.lpData);
92                                 end;
93                         end;
94                 end;
95
96                 CloseHandle(hMutex);
97         end else begin
98                 //\83~\83\85\81[\83e\83b\83N\83X\82ª\91\8dÝ\82µ\82È\82¢\8fê\8d\87\82Í\83A\83v\83\8a\83P\81[\83V\83\87\83\93\8bN\93®\91±\8ds
99                 hMutex := CreateMutex(nil, False, PChar(MutexString));
100                 Application.Initialize;
101                 Application.Title := '\83M\83R\83i\83r';
102                 Application.ShowMainForm := False;
103                 Application.CreateForm(TMainWindow, MainWindow);
104   Application.CreateForm(TFavoriteDM, FavoriteDM);
105   Application.CreateForm(TAddressHistoryDM, AddressHistoryDM);
106   Application.CreateForm(TGikoForm, GikoForm);
107   Application.Run;
108                 ReleaseMutex(hMutex);
109         end;
110 end.
111