Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Windows Forms Apps with Task Bar Icons / Shortcut Linking

Posted on 2011-09-25
4
Medium Priority
?
410 Views
Last Modified: 2012-05-12
Hello all.

I have a C# Windows Forms application that I've developed. The program is launcher with a launcher, which does some updating, etc.

My current issue is that once the program starts running, the user can pin the Application to the Windows Task Bar, which would then allow them to run the program directly, bypassing the Launcher.

Is it possible for me to some how make it so that no matter what, the launcher is always run first?
0
Comment
Question by:Dragonseer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 40
ID: 36597325
The launcher could create a temporary file or an entry in the Windows registry.

When the application starts, it would check for the presence of that file or registry entry.

If found, the application would delete it and start normally.

If not found, it would mean that the application was started directly. You could then display a message telling the user to start from the launcher and abort the application.
0
 
LVL 8

Expert Comment

by:jagrut_patel
ID: 36598126
Please explain how pinning a program to the taskbar can affect lifecycle events of a Forms application.

As I understand if a program is pinned to the taskbar, the program's icon stays there in the taskbar even after application is closed. Thus, user can easily restart the same application just by clicking that icon in the taskbar. It is like a shorcut link to the application.
0
 
LVL 40
ID: 36599587
@jagrut_patel

This is exactly the question. He does not want a user to be able to start the application from a shortcut link.

He want the user to always use a launcher application, that will set up a few things before launching the application.
0
 
LVL 8

Accepted Solution

by:
jagrut_patel earned 2000 total points
ID: 36708443
Thanks @JamesBurger for explaination. I could have never understood actual problem from the original description of the question.

"My current issue is that once the program starts running, the user can pin the Application to the Windows Task Bar, which would then allow them to run the program directly, bypassing the Launcher. "

That was a cryptic statement for me to understand without your explaination! Thanks again.

======================================================

So here we have two separate programs: One is Launcher and another one is a WinForm Application. Problem is to ensure that Launcher is always executed no matter how the WinForm Application is started.

How about starting the Launcher program from the Form Load event of the WinForm application. If Launcher is an executable then one can use Process class to launch it. To ensure that no action is possible in WinForm app until Launcher has completed its task we keep UI of WinForm application disabled. Periodically check (may be using Timer) whether Launcher is done. If so then enable the UI of WinForm application.

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Configuring Remote Assistance for use with SCCM
A small collection of useful tips and tricks for Windows 10 users that I decided to write as a result of recent questions that were asked and answered at Experts Exchange. Two short video tutorials included. Enjoy..
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question