Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

run app with an outer link?

Post Reply
coater
Posts: 210
Joined: Sat Sep 29, 2018 1:51 pm

run app with an outer link?

Post by coater »

How to click a outer link, and it will open the application to open the link.
How to deliver a url string to the application and it will be opened by the app ?
Thank you!
User avatar
salvadordf
Posts: 4620
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: run app with an outer link?

Post by salvadordf »

If you click on a HTTP/HTTPS link then you need to set your application as the default web browser in that computer.

Then get URL from the parameter using ParamStr :
https://www.delphibasics.co.uk/RTL.php?Name=ParamStr
coater
Posts: 210
Joined: Sat Sep 29, 2018 1:51 pm

Re: run app with an outer link?

Post by coater »

If the appliccation is running, how to get the clicked url outside, thank you!
coater
Posts: 210
Joined: Sat Sep 29, 2018 1:51 pm

Re: run app with an outer link?

Post by coater »

There is another problem, I cannot use single app. May be because the CreateGlobalCEFApp?

var
hMutex: THandle;
begin

hMutex := CreateMutex(nil, False, 'TheStandard');
if GetLastError = ERROR_ALREADY_EXISTS then
begin
CloseHandle(hMutex);
MessageBox(0,'You can not run a second copy of this App','',mb_OK);
application.Terminate;
end;
User avatar
salvadordf
Posts: 4620
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: run app with an outer link?

Post by salvadordf »

coater wrote: Fri Nov 22, 2024 1:43 pm If the appliccation is running, how to get the clicked url outside, thank you!
If your app is the default web browser it will be executed by windows and the URL will be in ParamStr.
User avatar
salvadordf
Posts: 4620
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: run app with an outer link?

Post by salvadordf »

coater wrote: Sat Nov 23, 2024 10:16 am There is another problem, I cannot use single app. May be because the CreateGlobalCEFApp?

var
hMutex: THandle;
begin

hMutex := CreateMutex(nil, False, 'TheStandard');
if GetLastError = ERROR_ALREADY_EXISTS then
begin
CloseHandle(hMutex);
MessageBox(0,'You can not run a second copy of this App','',mb_OK);
application.Terminate;
end;
Read the information in these links for all the details and how to fix it :
https://www.briskbard.com/forum/viewtopic.php?t=2208
https://stackoverflow.com/questions/78652092/cef4delphi-application-cant-run-two-instances/78652679#78652679
coater
Posts: 210
Joined: Sat Sep 29, 2018 1:51 pm

Re: run app with an outer link?

Post by coater »

salvadordf wrote: Mon Nov 25, 2024 8:06 am
coater wrote: Sat Nov 23, 2024 10:16 am There is another problem, I cannot use single app. May be because the CreateGlobalCEFApp?

var
hMutex: THandle;
begin

hMutex := CreateMutex(nil, False, 'TheStandard');
if GetLastError = ERROR_ALREADY_EXISTS then
begin
CloseHandle(hMutex);
MessageBox(0,'You can not run a second copy of this App','',mb_OK);
application.Terminate;
end;
Read the information in these links for all the details and how to fix it :
https://www.briskbard.com/forum/viewtopic.php?t=2208
https://stackoverflow.com/questions/78652092/cef4delphi-application-cant-run-two-instances/78652679#78652679
Thank you!
Thank you!
Post Reply