The users of my app can choose if they want (or not) launch my app at their session startup.
To do this, I use LSSharedFileListRef as described here : How do you make your App open at login?
What I want now is to know if my app has been launched automatically at session startup or via a click on the icon in the dock. Indeed, I have to do different actions in these two cases.
I have got the feeling that it is not possible to use the parameters of the notification in the following delegate method to do this:
- (void)applicationDidFinishLaunching:(NSNotification *)notification
I have seen the following posts but they do not help:
How can I know how my app was launched on Mac OS? => NO ANSWER except some links to other posts which do not help more...
Know if the user launched an app => I don't see how to set/get the "Y" parameter defined in this post
Mac OS X: open application at login, without showing the main window => deals with the fact to hide or not the main window at startup ; what I want is more general: how to know how the app has been launched?
Anybody can help me ?
Thanks !