I think you might be making assumptions about those BringToFront/Foreground
calls, that you can force some app window to be on top of everything else,
but you can't:
http://blogs.msdn.com/oldnewthing/ar...0/9435239.aspx
--
Phil Wilson
Definitive Guide to Windows Installer
http://www.apress.com/book/view/1590592972
"Vivek Waghmare" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thanks for your input
>
> But this is not my problem. I have acheived of maintaining single instance
> of application. I can create
>
> My issue is that our application is not getting activited when it starts.
> It stays minimize at taskbar blinking in orange.
> "Arto Viitanen" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Vivek Waghmare wrote:
>>> Hi
>>> My purpose to create an application which should not allowed to run more
>>> than one instance of it.
>>>
>>> I have acheived this by doing following steps
>>>
>>> 1. Created a class named SingleInstance inherhated from
>>> Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase
>>> 2. override method OnCreateMainForm
>>
>> You can use System.Threading.Mutex. Following code:
>>
>> bool createdNew;
>> string mutexName = "Ourprogramname";
>> Mutex mutex = new Mutex(false, mutexName, out createdNew);
>> if (!createdNew)
>> {
>> MessageBox.Show("There can be only one", "Oops");
>> Application.Exit();
>> return;
>> }
>>
>> lets only one intance of the program to be run; actually second instance
>> stops.
>>
>> --
>> Arto Viitanen
>
>