© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
13 replies
VerpinZal

Is there a way to determine if a Winforms .exe is run by double clicking on it on Windows explorer?

What I wish to achieve is nothing too fancy. I just want to determine if my winforms exe is run from within windows, or through another .exe. A bool like isLaunchedFromWinExplorer or isLaunchedFromAnotherApplication would suffice. I will show Form1 if the former, show Form2 if the latter. Thanks!
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Is there a way to determine the free space on a drive by using a text file ?
C#CC# / help
4y ago
✅ is there a Winforms API reference?
C#CC# / help
11mo ago
✅ vscode c# dev tools is there a way to run faster
C#CC# / help
9mo ago
✅ best way to snooze winforms
C#CC# / help
3y ago