Thanks four your response Linda,
The problem may be related to how I chose to start the program.
( using HKey LocalMachine Run registry key).
I don't see the same problem when using the Start | All Programs | Startup
folder.
This leads me to a different question -- how can I tell if the program
started from the All Programs Startup folder?
(When using the registry key, I made a registry entry that included the
startup path plus program parameters) --
My goal is that our customer has the choice of running on startup or not,
and that when run normally (not on startup) - the main windows form starts
visible, and when run based on their "run on startup" selection, - the main
window form starts minimized, leaving the tray notifyicon as the primary
interface.
Thanks again,
Jim
> Hi Jim,
>
[quoted text clipped - 10 lines]
> Linda Liu
> Microsoft Online Community Support
Jeffrey Tan[MSFT] - 18 Feb 2007 12:42 GMT
Hi Jim,
Thanks for your feedback!
Since my colleague Linda is taking vacation next week, I will continue to
work with you. Thanks.
>> How can I tell if the program started from the All Programs Startup
folder?
Can you tell me why you want to tell if your application is started from
"All Programs Startup folder"? Since Linda's and your test both reveal that
placing the application path in "All Programs Startup folder" will resolve
this problem. I think you may implement your application's "run on startup"
function by adding your application shortcut in "All Programs Startup
folder". Does this meet your need? More specific, the
%ALLUSERSPROFILE%\Start Menu\Programs\Startup folder.
Additionally, based on my review to the .Net Winform source code,
NotifyIcon class did not check the return value of shell_notifyIcon API, so
there is no way to check the return value through NotifyIcon class. A
workaround is calling Shell_NotifyIcon API directly through P/invoke
instead of using NotifyIcon.Visible property, so that you can check the
return value explicitly.
Hope this helps
Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.