473,320 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

C# - How to "detect" the way of program execution?

beaver
6
Hello!

I want to detect the way of program startup/execution..

There are several possibilities:
  • After logon/at startup
  • After the user clicked at the program icon (Desktop, Quick Launch, Start Menu)

This is very important, 'cause with that information i can "tell" the app in what mode to run (set the window state to minimized or normal, or send the app to sys tray).

Thanks
Sep 13 '07 #1
2 1592
Shashi Sadasivan
1,435 Expert 1GB
1. change your Main to take in arguments

2. Create 2 shortcuts which execute your program from commnad line (a. with minimzed param, b. with maximized param)

cheers
Sep 13 '07 #2
beaver
6
1. change your Main to take in arguments

2. Create 2 shortcuts which execute your program from commnad line (a. with minimzed param, b. with maximized param)

cheers
I don't wan't two shortcuts! Suppose that i have one checkbox where checked state means that the shortcut to the program should be created in the Startup folder, and when user unchecked it then the shortcut is removed from the Startup folder (Shell links).

When shortcut to the program is created in the Startup the program execute itself immediately after logon, and program goes to System Tray.
Otherwise, if shortcut isn't there it should run normally.

The problem is, what if shortcut is in the Startup folder, user has closed the program, but wan't to run it again, in the same session - and, user don't wan't that program hide itself to the SysTray when he execute it on that way!

Do you copy?!
Sep 14 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Kamus of Kadizhar | last post by:
I have the following function which generates MD5 hashes for files on a local and remote server. The remote server has a little applet that runs from inetd and generates an MD5 hash given the file...
25
by: Nitin Bhardwaj | last post by:
Well, i'm a relatively new into C( strictly speaking : well i'm a student and have been doing & studying C programming for the last 4 years).....and also a regular reader of "comp.lang.c" I...
134
by: jacob navia | last post by:
Hi Suppose you have somewhere #define BOOL int and somewhere else typedef BOOL int;
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
8
by: David Thielen | last post by:
Hi; In our setup program how do I determine if I need to run "aspnet_regiis –i" and if so, is there an API I can calll rather than finding that program on the user's disk and calling it? --...
6
by: Kevin Blount | last post by:
I've seen some sites that have URLs like this: blahblah.com/page.aspx?option i.e. there's no 'value' for the 'name' option. I'd like to find out how to detect if the name' is part of the URL...
4
by: sid | last post by:
Can someone tell me how to detect "Action Cancelled" page with out polling. I have a frame set and I want to make sure the other frame is displaying what it is supposed to without polling. For...
4
by: e-Ricc | last post by:
Hi guys! Im trying to detect when a user "kills" my c# app using windows task manager, i've tried with the form events _closing and _closed managing for example putting an if inside to detect...
4
by: ShadowLocke | last post by:
Hi, Im not very experienced with XSL, this is my first run in with it. I found an XSL file that converts a dataset to an excel readable format. The problem I have is when the dataset has a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.