Solved

Windows Forms Apps with Task Bar Icons / Shortcut Linking

Posted on 2011-09-25
4
380 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 500 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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
No single Antivirus application (despite claims by manufacturers) will catch or protect you from all Virus / Malware or Spyware threats. That doesn't stop you from further protecting yourself however - and this article is to show you how.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…

737 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