Click here to Skip to main content
15,908,776 members
Home / Discussions / C#
   

C#

 
GeneralRe: debugger on a clean machine Pin
Dennis C. Dietrich3-Jan-05 10:18
Dennis C. Dietrich3-Jan-05 10:18 
QuestionHow to get a Shell32 PDIL from a filename Pin
Chris Richner3-Jan-05 9:49
Chris Richner3-Jan-05 9:49 
AnswerRe: How to get a Shell32 PDIL from a filename Pin
Dave Kreskowiak3-Jan-05 11:13
mveDave Kreskowiak3-Jan-05 11:13 
GeneralRe: How to get a Shell32 PDIL from a filename Pin
Chris Richner3-Jan-05 19:57
Chris Richner3-Jan-05 19:57 
GeneralRe: How to get a Shell32 PDIL from a filename Pin
Nick Parker4-Jan-05 5:42
protectorNick Parker4-Jan-05 5:42 
GeneralFieldTypes Pin
TyronX3-Jan-05 9:32
TyronX3-Jan-05 9:32 
GeneralRe: FieldTypes Pin
TyronX3-Jan-05 9:50
TyronX3-Jan-05 9:50 
GeneralSingleton with a twist Pin
bigals3-Jan-05 9:24
bigals3-Jan-05 9:24 
Hello everyone

I have a singleton application which works fine, sets focus to it's self if executed while still open.

Now the client wishes for this application to also be executed by a scheduled task.

Now I have the singleton working fine, and it recognises multiple instances, easy.

What I cannot get to work, is if the application is already loaded, I want to execute a public function within the main form.

This is what I have, but this fails on .Show()

private static Mutex AppMutex = new Mutex(true, "Form1");

[STAThread]

static void Main()

{

if(AppMutex.WaitOne(0, false))

{

Application.Run(new Form1());

AppMutex.ReleaseMutex();

}

else

{

Form1 _form = new Form1();

_form = (Form1) Form1.FromHandle(AppMutex.Handle);

_form.Show();

_form.Start(); // My Own Function I wish To Execute

MessageBox.Show("Already Loaded");

}

}



Thanks in advance

Smile | :)
GeneralRe: Singleton with a twist Pin
Matt Gerrans4-Jan-05 8:08
Matt Gerrans4-Jan-05 8:08 
GeneralRe: Singleton with a twist Pin
bigals4-Jan-05 9:59
bigals4-Jan-05 9:59 
GeneralRe: Singleton with a twist Pin
Matt Gerrans7-Jan-05 20:42
Matt Gerrans7-Jan-05 20:42 
GeneralRe: Singleton with a twist Pin
bigals8-Jan-05 11:25
bigals8-Jan-05 11:25 
GeneralRe: Singleton with a twist Pin
Matt Gerrans9-Jan-05 19:51
Matt Gerrans9-Jan-05 19:51 
GeneralRe: Singleton with a twist Pin
bigals9-Jan-05 19:57
bigals9-Jan-05 19:57 
Question"How Get Type of File ? Pin
WDI3-Jan-05 6:14
WDI3-Jan-05 6:14 
AnswerRe: "How Get Type of File ? Pin
Bahadir Cambel3-Jan-05 9:05
Bahadir Cambel3-Jan-05 9:05 
AnswerRe: "How Get Type of File ? Pin
DavidNohejl3-Jan-05 10:11
DavidNohejl3-Jan-05 10:11 
GeneralRe: "How Get Type of File ? Pin
Bahadir Cambel3-Jan-05 10:22
Bahadir Cambel3-Jan-05 10:22 
GeneralRe: "How Get Type of File ? Pin
DavidNohejl3-Jan-05 10:51
DavidNohejl3-Jan-05 10:51 
GeneralRe: "How Get Type of File ? Pin
Bahadir Cambel3-Jan-05 11:42
Bahadir Cambel3-Jan-05 11:42 
General.NET Remote - Activator.GetObject Pin
Wender Oliveira3-Jan-05 5:21
Wender Oliveira3-Jan-05 5:21 
GeneralRe: .NET Remote - Activator.GetObject Pin
Adam Goossens9-Jan-05 23:48
Adam Goossens9-Jan-05 23:48 
GeneralFile to byte[ ] Pin
WDI3-Jan-05 4:43
WDI3-Jan-05 4:43 
GeneralRe: File to byte[ ] Pin
Wender Oliveira3-Jan-05 5:15
Wender Oliveira3-Jan-05 5:15 
GeneralRe: File to byte[ ] Pin
Dennis C. Dietrich3-Jan-05 7:40
Dennis C. Dietrich3-Jan-05 7:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.