@@ -23,14 +23,22 @@ TMain = class(TForm)
2323 CheckAppClosedTimer: TTimer;
2424 XPManifest1: TXPManifest;
2525 N4: TMenuItem;
26- ProfilesBtn : TMenuItem;
26+ KMProfilesBtn : TMenuItem;
2727 HidHideBtn: TMenuItem;
2828 N3: TMenuItem;
2929 UtilitiesBtn: TMenuItem;
3030 Utility1Btn: TMenuItem;
3131 Utility2Btn: TMenuItem;
3232 Utility3Btn: TMenuItem;
3333 Utility4Btn: TMenuItem;
34+ Utility5Btn: TMenuItem;
35+ Utility6Btn: TMenuItem;
36+ Utility7Btn: TMenuItem;
37+ Utility8Btn: TMenuItem;
38+ Utility9Btn: TMenuItem;
39+ Utility10Btn: TMenuItem;
40+ AutostartBtn: TMenuItem;
41+ XboxProfilesBtn: TMenuItem;
3442 procedure FormCreate (Sender: TObject);
3543 procedure CloseBtnClick (Sender: TObject);
3644 procedure FormClose (Sender: TObject; var Action: TCloseAction);
@@ -40,15 +48,23 @@ TMain = class(TForm)
4048 procedure GamepadTestBtnClick (Sender: TObject);
4149 procedure ShowHideAppBtnClick (Sender: TObject);
4250 procedure CheckAppClosedTimerTimer (Sender: TObject);
43- procedure ProfilesBtnClick (Sender: TObject);
51+ procedure KMProfilesBtnClick (Sender: TObject);
4452 procedure HidHideBtnClick (Sender: TObject);
4553 procedure Utility1BtnClick (Sender: TObject);
4654 procedure Utility2BtnClick (Sender: TObject);
4755 procedure Utility3BtnClick (Sender: TObject);
4856 procedure Utility4BtnClick (Sender: TObject);
57+ procedure Utility5BtnClick (Sender: TObject);
58+ procedure Utility6BtnClick (Sender: TObject);
59+ procedure Utility7BtnClick (Sender: TObject);
60+ procedure Utility8BtnClick (Sender: TObject);
61+ procedure Utility9BtnClick (Sender: TObject);
62+ procedure Utility10BtnClick (Sender: TObject);
63+ procedure AutostartBtnClick (Sender: TObject);
64+ procedure XboxProfilesBtnClick (Sender: TObject);
4965 private
5066 procedure DefaultHandler (var Message); override;
51- procedure OpenUtility (FileName : string);
67+ procedure OpenUtilityOrFolder (FilePath : string);
5268 protected
5369 procedure IconMouse (var Msg: TMessage); message WM_USER + 1 ;
5470 { Private declarations }
@@ -67,9 +83,10 @@ TMain = class(TForm)
6783 SleepTimeOut: integer;
6884 DSAdvanceApp: HWND;
6985
70- IDS_RUN, IDS_STOP, IDS_SHOW, IDS_HIDE, IDS_UTILITY_NOT_FOUND , IDS_LAST_UPDATE: string;
86+ IDS_RUN, IDS_STOP, IDS_SHOW, IDS_HIDE, IDS_UTILITY_OR_FOLDER_NOT_FOUND , IDS_LAST_UPDATE: string;
7187
72- Utility1Path, Utility2Path, Utility3Path, Utility4Path: string;
88+ Utility1Path, Utility2Path, Utility3Path, Utility4Path, Utility5Path,
89+ Utility6Path, Utility7Path, Utility8Path, Utility9Path, Utility10Path: string;
7390
7491implementation
7592
@@ -121,7 +138,8 @@ procedure TMain.FormCreate(Sender: TObject);
121138 Ini: TIniFile;
122139begin
123140 Ini:=TIniFile.Create(ExtractFilePath(ParamStr(0 )) + ' Config.ini' );
124- if Ini.ReadBool(' Launcher' , ' RunInBackground' , false) then RunInBgBtn.Click;
141+ RunInBgBtn.Checked:=Ini.ReadBool(' Launcher' , ' RunInBackground' , false);
142+ AutostartBtn.Checked:=Ini.ReadBool(' Launcher' , ' Autostart' , false);
125143 DSAdvanceTitle:=Ini.ReadString(' Launcher' , ' DSAdvanceTitle' , ' DSAdvance' );
126144 HidHidePath:=Ini.ReadString(' Launcher' , ' HidHidePath' , ' ' );
127145 if not FileExists(HidHidePath) then
@@ -136,13 +154,32 @@ procedure TMain.FormCreate(Sender: TObject);
136154 Utility3Btn.Caption:=Ini.ReadString(' Launcher' , ' UtilityTitle3' , ' ' );
137155 Utility4Path:=Ini.ReadString(' Launcher' , ' UtilityPath4' , ' ' );
138156 Utility4Btn.Caption:=Ini.ReadString(' Launcher' , ' UtilityTitle4' , ' ' );
139-
140- UtilitiesBtn.Visible:=(Utility1Path <> ' ' ) or (Utility2Path <> ' ' ) or (Utility3Path <> ' ' ) or (Utility4Path <> ' ' );
157+ Utility5Path:=Ini.ReadString(' Launcher' , ' UtilityPath5' , ' ' );
158+ Utility5Btn.Caption:=Ini.ReadString(' Launcher' , ' UtilityTitle5' , ' ' );
159+ Utility6Path:=Ini.ReadString(' Launcher' , ' UtilityPath6' , ' ' );
160+ Utility6Btn.Caption:=Ini.ReadString(' Launcher' , ' UtilityTitle6' , ' ' );
161+ Utility7Path:=Ini.ReadString(' Launcher' , ' UtilityPath7' , ' ' );
162+ Utility7Btn.Caption:=Ini.ReadString(' Launcher' , ' UtilityTitle7' , ' ' );
163+ Utility8Path:=Ini.ReadString(' Launcher' , ' UtilityPath8' , ' ' );
164+ Utility8Btn.Caption:=Ini.ReadString(' Launcher' , ' UtilityTitle8' , ' ' );
165+ Utility9Path:=Ini.ReadString(' Launcher' , ' UtilityPath9' , ' ' );
166+ Utility9Btn.Caption:=Ini.ReadString(' Launcher' , ' UtilityTitle9' , ' ' );
167+ Utility10Path:=Ini.ReadString(' Launcher' , ' UtilityPath10' , ' ' );
168+ Utility10Btn.Caption:=Ini.ReadString(' Launcher' , ' UtilityTitle10' , ' ' );
169+
170+ UtilitiesBtn.Visible:=(Utility1Path <> ' ' ) or (Utility2Path <> ' ' ) or (Utility3Path <> ' ' ) or (Utility4Path <> ' ' ) or (Utility5Path <> ' ' ) or
171+ (Utility6Path <> ' ' ) or (Utility7Path <> ' ' ) or (Utility8Path <> ' ' ) or (Utility9Path <> ' ' ) or (Utility10Path <> ' ' );
141172 N3.Visible:=UtilitiesBtn.Visible;
142173 Utility1Btn.Visible:=Utility1Path <> ' ' ;
143174 Utility2Btn.Visible:=Utility2Path <> ' ' ;
144175 Utility3Btn.Visible:=Utility3Path <> ' ' ;
145176 Utility4Btn.Visible:=Utility4Path <> ' ' ;
177+ Utility5Btn.Visible:=Utility5Path <> ' ' ;
178+ Utility6Btn.Visible:=Utility6Path <> ' ' ;
179+ Utility7Btn.Visible:=Utility7Path <> ' ' ;
180+ Utility8Btn.Visible:=Utility8Path <> ' ' ;
181+ Utility9Btn.Visible:=Utility9Path <> ' ' ;
182+ Utility10Btn.Visible:=Utility10Path <> ' ' ;
146183 Ini.Free;
147184
148185 Application.Title:=Caption;
@@ -160,7 +197,7 @@ procedure TMain.FormCreate(Sender: TObject);
160197 IDS_STOP:=' Îñòàíîâèòü' ;
161198 IDS_SHOW:=' Ïîêàçàòü' ;
162199 IDS_HIDE:=' Ñêðûòü' ;
163- IDS_UTILITY_NOT_FOUND :=' Óòèëèòà íå íàéäåíà. Èçìåíèòå ïóòü â êîíôèãóðàöèîííîì ôàéëå.' ;
200+ IDS_UTILITY_OR_FOLDER_NOT_FOUND :=' Óòèëèòà èëè ïàïêà íå íàéäåíà. Èçìåíèòå ïóòü â êîíôèãóðàöèîííîì ôàéëå.' ;
164201 if Utility1Btn.Caption = ' ' then
165202 Utility1Btn.Caption:=' Óòèëèòà 1' ;
166203 if Utility2Btn.Caption = ' ' then
@@ -169,18 +206,33 @@ procedure TMain.FormCreate(Sender: TObject);
169206 Utility3Btn.Caption:=' Óòèëèòà 3' ;
170207 if Utility4Btn.Caption = ' ' then
171208 Utility4Btn.Caption:=' Óòèëèòà 4' ;
209+ if Utility5Btn.Caption = ' ' then
210+ Utility5Btn.Caption:=' Óòèëèòà 5' ;
211+ if Utility6Btn.Caption = ' ' then
212+ Utility6Btn.Caption:=' Óòèëèòà 6' ;
213+ if Utility7Btn.Caption = ' ' then
214+ Utility7Btn.Caption:=' Óòèëèòà 7' ;
215+ if Utility8Btn.Caption = ' ' then
216+ Utility8Btn.Caption:=' Óòèëèòà 8' ;
217+ if Utility9Btn.Caption = ' ' then
218+ Utility9Btn.Caption:=' Óòèëèòà 9' ;
219+ if Utility10Btn.Caption = ' ' then
220+ Utility10Btn.Caption:=' Óòèëèòà 10' ;
172221 end else begin
173222 IDS_RUN:=' Run' ;
174223 IDS_STOP:=' Stop' ;
175224 RunStopBtn.Caption:=IDS_RUN;
176225 IDS_SHOW:=' Show' ;
177226 IDS_HIDE:=' Hide' ;
178- IDS_UTILITY_NOT_FOUND :=' The utility was not found. Change the path in the configuration file.' ;
227+ IDS_UTILITY_OR_FOLDER_NOT_FOUND :=' The utility or folder was not found. Change the path in the configuration file.' ;
179228 SetupBtn.Caption:=' Setup' ;
180229 ConfigBtn.Caption:=' Options' ;
181- ProfilesBtn.Caption:=' Profiles' ;
230+ KMProfilesBtn.Caption:=' Keyboard && Mouse Profiles' ;
231+ XboxProfilesBtn.Caption:=' Xbox Gamepad Profiles' ;
182232 RunInBgBtn.Caption:=' Run in background' ;
183233 GamepadTestBtn.Caption:=' Gamepad test' ;
234+ AutostartBtn.Caption:=' Autostart' ;
235+ CloseBtn.Caption:=' Exit' ;
184236 UtilitiesBtn.Caption:=' Utilities' ;
185237 if Utility1Btn.Caption = ' ' then
186238 Utility1Btn.Caption:=' Utility 1' ;
@@ -190,8 +242,22 @@ procedure TMain.FormCreate(Sender: TObject);
190242 Utility3Btn.Caption:=' Utility 3' ;
191243 if Utility4Btn.Caption = ' ' then
192244 Utility4Btn.Caption:=' Utility 4' ;
193- CloseBtn.Caption:=' Exit' ;
245+ if Utility5Btn.Caption = ' ' then
246+ Utility5Btn.Caption:=' Utility 5' ;
247+ if Utility6Btn.Caption = ' ' then
248+ Utility6Btn.Caption:=' Utility 6' ;
249+ if Utility7Btn.Caption = ' ' then
250+ Utility7Btn.Caption:=' Utility 7' ;
251+ if Utility8Btn.Caption = ' ' then
252+ Utility8Btn.Caption:=' Utility 8' ;
253+ if Utility9Btn.Caption = ' ' then
254+ Utility9Btn.Caption:=' Utility 9' ;
255+ if Utility10Btn.Caption = ' ' then
256+ Utility10Btn.Caption:=' Utility 10' ;
194257 end ;
258+
259+ if AutostartBtn.Checked then
260+ RunStopBtn.Click;
195261end ;
196262
197263procedure TMain.IconMouse (var Msg: TMessage);
@@ -303,43 +369,87 @@ procedure TMain.CheckAppClosedTimerTimer(Sender: TObject);
303369 end ;
304370end ;
305371
306- procedure TMain.ProfilesBtnClick (Sender: TObject);
372+ procedure TMain.KMProfilesBtnClick (Sender: TObject);
307373begin
308- ShellExecute(Handle, ' open' , PChar(ExtractFilePath(ParamStr(0 )) + ' Profiles \' ), nil , nil , SW_SHOWNORMAL);
374+ ShellExecute(Handle, ' open' , PChar(ExtractFilePath(ParamStr(0 )) + ' KMProfiles \' ), nil , nil , SW_SHOWNORMAL);
309375end ;
310376
311377procedure TMain.HidHideBtnClick (Sender: TObject);
312378begin
313- OpenUtility (HidHidePath);
379+ OpenUtilityOrFolder (HidHidePath);
314380end ;
315381
316- procedure TMain.OpenUtility (FileName : string);
382+ procedure TMain.OpenUtilityOrFolder (FilePath : string);
317383begin
318- if (FileName = ' ' ) or (FileExists(FileName) = false) then begin
319- Application.MessageBox(PChar(IDS_UTILITY_NOT_FOUND), PChar(Caption), MB_ICONWARNING);
320- Exit;
321- end ;
322- ShellExecute(Handle, ' open' , PChar(FileName), nil , nil , SW_SHOWNORMAL);
384+ if (FilePath = ' ' ) or (not (FileExists(FilePath) or DirectoryExists(FilePath))) then
385+ Application.MessageBox(PChar(IDS_UTILITY_OR_FOLDER_NOT_FOUND), PChar(Caption), MB_ICONWARNING)
386+ else
387+ ShellExecute(Handle, ' open' , PChar(FilePath), nil , nil , SW_SHOWNORMAL);
323388end ;
324389
325390procedure TMain.Utility1BtnClick (Sender: TObject);
326391begin
327- OpenUtility (Utility1Path);
392+ OpenUtilityOrFolder (Utility1Path);
328393end ;
329394
330395procedure TMain.Utility2BtnClick (Sender: TObject);
331396begin
332- OpenUtility (Utility2Path);
397+ OpenUtilityOrFolder (Utility2Path);
333398end ;
334399
335400procedure TMain.Utility3BtnClick (Sender: TObject);
336401begin
337- OpenUtility (Utility3Path);
402+ OpenUtilityOrFolder (Utility3Path);
338403end ;
339404
340405procedure TMain.Utility4BtnClick (Sender: TObject);
341406begin
342- OpenUtility(Utility4Path);
407+ OpenUtilityOrFolder(Utility4Path);
408+ end ;
409+
410+ procedure TMain.Utility5BtnClick (Sender: TObject);
411+ begin
412+ OpenUtilityOrFolder(Utility5Path);
413+ end ;
414+
415+ procedure TMain.Utility6BtnClick (Sender: TObject);
416+ begin
417+ OpenUtilityOrFolder(Utility6Path);
418+ end ;
419+
420+ procedure TMain.Utility7BtnClick (Sender: TObject);
421+ begin
422+ OpenUtilityOrFolder(Utility7Path);
423+ end ;
424+
425+ procedure TMain.Utility8BtnClick (Sender: TObject);
426+ begin
427+ OpenUtilityOrFolder(Utility8Path);
428+ end ;
429+
430+ procedure TMain.Utility9BtnClick (Sender: TObject);
431+ begin
432+ OpenUtilityOrFolder(Utility9Path);
433+ end ;
434+
435+ procedure TMain.Utility10BtnClick (Sender: TObject);
436+ begin
437+ OpenUtilityOrFolder(Utility10Path);
438+ end ;
439+
440+ procedure TMain.AutostartBtnClick (Sender: TObject);
441+ var
442+ Ini: TIniFile;
443+ begin
444+ AutostartBtn.Checked:=not AutostartBtn.Checked;
445+ Ini:=TIniFile.Create(ExtractFilePath(ParamStr(0 )) + ' Config.ini' );
446+ Ini.WriteBool(' Launcher' , ' Autostart' , AutostartBtn.Checked);
447+ Ini.Free;
448+ end ;
449+
450+ procedure TMain.XboxProfilesBtnClick (Sender: TObject);
451+ begin
452+ ShellExecute(Handle, ' open' , PChar(ExtractFilePath(ParamStr(0 )) + ' XboxProfiles\' ), nil , nil , SW_SHOWNORMAL);
343453end ;
344454
345455end .
0 commit comments