Results 1 to 3 of 3

Thread: [RESOLVED] [2005] How to tell if an app was started from a shortcut?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2005
    Location
    Sector 001
    Posts
    1,577

    Resolved [RESOLVED] [2005] How to tell if an app was started from a shortcut?

    I am trying to get my program to start minimized when set to load when windows loads. Is there a way to find out if it started from a shortcut?

    There aren't any additional arguments when starting through a .lnk to look for as tested with Environment.GetCommandLineArgs()

    ------------------------
    EDIT: Or is there an easy way to know if Windows is just starting?
    VB 2005, Win Xp Pro sp2

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] How to tell if an app was started from a shortcut?

    If you're starting your app form a shortcut in the Startup folder then you can set a property of the shortcut to start normal, maximised or minimised. If you want your app to do it specifically then YOU have to add a commandline argument.

    I had an application that had CheckBoxes in the Options dialogue for "Start with Windows" and "Minimise at Windows Startup". Obviously the second option was not available if the first wasn't checked. If the first option was selected I'd add a value to the Run registry key containing Application.ExecutablePath. If the second option was selected too I'd add "-min" to the commandline. When my app started up I'd then check the commandline arguments and if I found "-min" I'd minimise my startup form.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2005
    Location
    Sector 001
    Posts
    1,577

    Re: [2005] How to tell if an app was started from a shortcut?

    I want to be like you.

    Thanks again!
    VB 2005, Win Xp Pro sp2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width