OSDN Git Service

remodelingブランチから、最新版をマージ
[gikonavigoeson/gikonavi.git] / gikoNavi.dpr
1 program gikoNavi;
2
3 {%ToDo 'gikoNavi.todo'}
4
5 uses
6   Windows,
7   SysUtils,
8   Forms,
9   Messages,
10   MainForm in 'MainForm.pas' {MainWindow},
11   Giko in 'Giko.pas' {GikoForm},
12   Splash in 'Splash.pas' {SplashWindow},
13   About in 'About.pas' {AboutDialog},
14   Option in 'Option.pas' {OptionDialog},
15   Editor in 'Editor.pas' {EditorForm},
16   Round in 'Round.pas' {RoundDialog},
17   ListSelect in 'ListSelect.pas' {ListSelectDialog},
18   Search in 'Search.pas' {SearchDialog},
19   GikoSystem in 'GikoSystem.pas',
20   Setting in 'Setting.pas',
21   BoardGroup in 'BoardGroup.pas',
22   SaveFile in 'SaveFile.pas',
23   Sort in 'Sort.pas',
24   ThreadControl in 'ThreadControl.pas',
25   ItemDownload in 'ItemDownload.pas',
26   RoundData in 'RoundData.pas',
27   RoundName in 'RoundName.pas' {RoundNameDialog},
28   NewBoard in 'NewBoard.pas' {NewBoardDialog},
29   Dolib in 'Dolib.pas',
30   UBase64 in 'Encrypt\UBase64.pas',
31   UCryptAuto in 'Encrypt\UCryptAuto.pas',
32   KeySetting in 'KeySetting.pas' {KeySettingForm},
33   FavoriteAdd in 'FavoriteAdd.pas' {FavoriteAddDialog},
34   NewFavoriteFolder in 'NewFavoriteFolder.pas' {NewFavoriteFolderDialog},
35   FavoriteArrange in 'FavoriteArrange.pas' {FavoriteArrangeDialog},
36   Favorite in 'Favorite.pas' {FavoriteDM: TDataModule},
37   AddressHistory in 'AddressHistory.pas' {AddressHistoryDM: TDataModule},
38   Preview in 'Preview.pas',
39   HTMLDocumentEvent in 'HTMLDocumentEvent.pas',
40   Kotehan in 'Kotehan.pas' {KotehanDialog},
41   MonaUtils in 'MonaUtils.pas',
42   HintWindow in 'HintWindow.pas',
43   GikoUtil in 'GikoUtil.pas',
44   ToolBarSetting in 'ToolBarSetting.pas' {ToolBarSettingDialog},
45   ToolBarUtil in 'ToolBarUtil.pas',
46   YofUtils in 'YofUtils.pas',
47   AbonUnit in 'AbonUnit.pas',
48   IndividualAbon in 'IndividualAbon.pas' {IndividualAbonForm},
49   Trip in 'Trip.pas',
50   GikoXMLDoc in 'GikoXMLDoc.pas',
51   ExternalBoardManager in 'ExternalBoardManager.pas',
52   ExternalThreadItem in 'ExternalThreadItem.pas',
53   ExternalBoardItem in 'ExternalBoardItem.pas',
54   ExternalBoardPlugInMain in 'ExternalBoardPlugInMain.pas',
55   ExternalFilePath in 'ExternalFilePath.pas',
56   MojuUtils in 'MojuUtils.pas',
57   crc in 'gzip_delphi2\crc.pas',
58   gzip in 'gzip_delphi2\gzip.pas',
59   zlib in 'gzip_delphi2\zlib.pas',
60   bmRegExp in 'bmRegExp\bmregexp.pas',
61   GikoCoolBar in 'Component\GikoCoolBar.pas',
62   GikoListView in 'Component\GikoListView.pas',
63   GikoPanel in 'Component\GikoPanel.pas',
64   KuroutSetting in 'KuroutSetting.pas' {KuroutOption},
65   GikoDB in 'GikoDB.pas',
66   GestureModel in 'GestureModel.pas',
67   Gesture in 'Gesture.pas',
68   GikoBayesian in 'GikoBayesian.pas',
69   Y_TextConverter in 'res\ExternalBoardPlugIn\Y_TextConverter.pas';
70
71 {$R *.RES}
72 {$R gikoResource.res}
73
74 var
75         hMutex: THandle;
76         Wnd{, AppWnd}: HWnd;
77         i: Integer;
78         CDS: TCopyDataStruct;
79 const
80         MutexString: string = 'gikoNaviInstance';
81 begin
82         hMutex := OpenMutex(MUTEX_ALL_ACCESS, False, PChar(MutexString));
83         if hMutex <> 0 then begin
84                 //\83~\83\85\81[\83e\83b\83N\83X\82ª\91\8dÝ\82µ\82½\8fê\8d\87\82Í\8bN\93®\92\86\8e~
85                 Wnd := FindWindow('TGikoForm', nil);
86                 if Wnd <> 0 then begin
87                         //\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³
88                         SetForegroundWindow(Wnd);
89                         if IsIconic(Wnd) then
90                                 SendMessage(Wnd, WM_SYSCOMMAND, SC_RESTORE, -1);
91 //                      AppWnd := GetWindowLong(Wnd, GWL_HWNDPARENT);
92 //                      if (AppWnd <> 0) and (IsIconic(AppWnd)) then
93 //                              SendMessage(AppWnd, WM_SYSCOMMAND, SC_RESTORE, -1);
94
95                         //\82Å\81A\88ø\90\94\82ª\82 \82Á\82½\82ç\8bN\93®\8dÏ\82Ý\83M\83R\83i\83r\82É\91\97\82é
96                         for i := 1 to ParamCount do     begin
97                                 CDS.dwData := 0;
98                                 CDS.cbData := Length(ParamStr(i)) + 1;
99                                 GetMem(CDS.lpData, CDS.cbData);
100                                 try
101                                         StrPCopy(CDS.lpData, ParamStr(i));
102                                         SendMessage(Wnd, WM_COPYDATA, 0, LParam(@CDS));
103                                 finally
104                                         FreeMem(CDS.lpData);
105                                 end;
106                         end;
107                 end;
108
109                 CloseHandle(hMutex);
110         end else begin
111                 //\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
112                 hMutex := CreateMutex(nil, False, PChar(MutexString));
113                 Application.Initialize;
114                 Application.Title := '\83M\83R\83i\83r';
115                 Application.ShowMainForm := False;
116                 Application.CreateForm(TMainWindow, MainWindow);
117   Application.CreateForm(TFavoriteDM, FavoriteDM);
118   Application.CreateForm(TAddressHistoryDM, AddressHistoryDM);
119   Application.CreateForm(TGikoForm, GikoForm);
120   Application.Run;
121                 ReleaseMutex(hMutex);
122         end;
123 end.
124