Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6870027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:37:55+00:00 2026-05-27T03:37:55+00:00

How can I identify if my Application was launched by the user? For example,

  • 0

How can I identify if my Application was launched by the user? For example, if the Exe was double clicked, or right click > open from Windows Explorer.

I need a function to determine the above, something like:

function AppWasExecutedByUser: Boolean;
begin
  //
end;

procedure TForm1.OnCreate(Sender: TObject);
begin
  if AppWasExecutedByUser then
    ShowMessage('User opened the exe by double clicking in Windows')
  else
    ShowMessage('Application was opened some other way');
end;

Appreciate your thoughts.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:37:55+00:00Added an answer on May 27, 2026 at 3:37 am

    If you associated your application with a file extension, you can have paramcount=1 and you can read the opened file in paramstr(1).

    If you open the application itself, a double click or Open on the executable will have the same effect: paramcount=0. In fact, the windows explorer is calling the ShellApi with the same parameters. So there is no way to identify it.

    And paramstr(0) will always contain the full executable path, in both case.

    Even if you create a shortcut link, and add a parameter, double click or right click + Open will have the same result.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can we identify an application is how much bit ie 16/32/64 bit from its
In my connection strings I add Application Name=XX so I can identify from the
How to uniquely identify computer (mainboard) using C#(.Net/Mono, local application)? Edition. We can identify
In a .NET application, how can I identify which network interface is used to
How can I identify if an application is using a custom UIWebView ? For
By using System.Deployment.Application.ApplicationDeployment.CurrentDeployment.CurrentVersion one can identify the publish version of an application in C#.
How in an ExtJS 4 MVC single web page application we can identify Views?
I wanna know that how we can identify whether a page is redirecting to
Is there a mechanism where I can identify a string in an email, say
I can't identify the object being deallocated, I run my app with Command+Y but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.