 |
|
|
 |
|
 |
The code seems to work perfect adding some loglines... but still 2 of my processes are started...
|
|
|
|
 |
|
 |
I can help you further, if you can share your code.
Manish Agarwal
manish.k.agarwal @ gmail DOT com
|
|
|
|
 |
|
 |
Thanks for this easy to use code! Your name is on my credit list!
|
|
|
|
 |
|
 |
Thanks
Manish Agarwal
manish.k.agarwal @ gmail DOT com
|
|
|
|
 |
|
 |
Thanks a lot. This code is very helpful with me
|
|
|
|
 |
|
 |
hi
I am using smartclient application.
i have checked in processes if the application is opened then it will not open another instance.
When an application is opened and i try to open another instance it does not allow to open it. Till here it works fine. but when i close the already opened application and then again try to open it, the application crashes saying the Shell has encountered a problem. Then i have to unistall and again reinstall the application.
Please provide a solution for it.
thx
|
|
|
|
 |
|
 |
Please check your application code how you are closing it. I never tested this on a smart client so no comments.
Manish Agarwal
manish.k.agarwal @ gmail DOT com
|
|
|
|
 |
|
 |
Hi Manish,
I found that the Single Instance Application you run as single instance actually is based on the process name.
I launched the same application binary by renaming it and it launched perfectly. Can you look into this matter and provide necessary comments.
With Best Regards,
Abhishek Dey
|
|
|
|
 |
|
 |
yes, you can easily resolve this issue by a minor change in IsAlreadyRunning() function. Just change the following line
string sExeName = fileInfo.Name;
to
string sExeName = "someuniquestring";
Manish Agarwal
manish.k.agarwal @ gmail DOT com
|
|
|
|
 |
|
 |
hey thanks manish!
modified on Thursday, May 27, 2010 6:18 AM
|
|
|
|
 |
|
 |
Thanks for that been a great help.
Have you any idea how to apply this to a Windows CE program
Chris
|
|
|
|
 |
|
 |
I think, it shld simply work on Compact framework too but I never tried the same.
Manish Agarwal
manish.k.agarwal @ gmail DOT com
|
|
|
|
 |
|
 |
Thanks for the code. It helped me.
|
|
|
|
 |
|
|
 |
|
 |
| Your solution seems difficult to use. Manish Agarwal
manish.k.agarwal @ gmail DOT com
|
|
|
|
 |
|
 |
It saved me quite a bit of time. Thanks for the post!
|
|
|
|
 |
|
 |
For sure, it's amazing how little code can be used to accomplish this. I had thought it would be much more complicated.
Martin of teva flip flops
|
|
|
|
 |
|
 |
My code looks like this:
.....
if(myAppIsNotRunningYet) {
MyTray = new MyTray();
Application.Run();
}
else {
}
.....
public MyTray()
{
notifyIcon = new NotifyIcon();
....
notifyIcon.Visible = true;
}
private void notifyIcon_DoubleClick(object sender, EventArgs e)
{
MainForm mainForm = new MainForm();
mainForm.ShowDialog();
}
|
|
|
|
 |
|
 |
You can do something like:
if(!SingleInstance.SingleApplication.Run())
{
return;
}
else
{
MyTray = new MyTray();
Application.Run();
}
Manish Agarwal
manish.k.agarwal @ gmail DOT com
|
|
|
|
 |
|
 |
how can i restore a hidden form ?
pls help me..
|
|
|
|
 |
|
 |
Can you elaborate your problem little bit more. Is it related my posted code or a general problem.
Manish Agarwal
manish.k.agarwal @ gmail DOT com
|
|
|
|
 |
|
 |
Thank you for reply.
sorry for my poor English.
if i hide my form like
this.Hide();
how can i show my running applications main form when user double click the application again.
i really need this ..
|
|
|
|
 |
|
 |
You can refer the code uploaded with this article.
Manish Agarwal
manish.k.agarwal @ gmail DOT com
|
|
|
|
 |
|
 |
i have this problem too,
are there any solutions, i want create a listener, where the original instance start if a file or somethins is created....
|
|
|
|
 |