Click here to Skip to main content
15,907,392 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Dear all,

I have an application and this application will run every Windows start (autostart). I want that if application autostart, it will be hidden SW_HIDE and if application start by user click on its icon, it will show (SW_SHOW)
So, How to detect if the applicaion start by click or autostart?

Thank you!
Posted
Updated 1-Dec-11 15:10pm
v2
Comments
[no name] 1-Dec-11 21:10pm    
EDIT: added "code" tag

1 solution

An easy solution is to simply use an command line parameter when you autostart the application. In the registry windows\currentversion\run you just add it to the command, something like: '...\application.exe /hide' and set the style of your window to SW_HIDE) when you find '/hide' in args. This is how most applications do this by the way.

Good luck!
 
Share this answer
 
Comments
Mohibur Rashid 2-Dec-11 0:18am    
I should be here first, I was going to answer same:)

My 5
E.F. Nijboer 2-Dec-11 5:56am    
:)
Albert Holguin 2-Dec-11 0:58am    
Great suggestion, +5
SVPro 2-Dec-11 6:37am    
Thank you E.F.Nijboer
Good solution, thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900