Hi all,

i Have SDI type application,I m creating a Mutex to avoid multiple instance of application. and use system tray icon feature.

for creating mutex i m using this code:

<pre>
HANDLE hMutex = ::CreateMutex(NULL, TRUE, _T("GlobalMainMutex"));

switch(::GetLastError())
{
case ERROR_SUCCESS:
// Mutex created successfully. There is no instance running
break;

case ERROR_ALREADY_EXISTS:

// Mutex already exists so there is a running instance of our app.
return FALSE;

default:
// Failed to create mutex by unknown reason
return FALSE;
}
</pre>

for system tray icon i m taking help of this article.

<a href=""></a><a href="http://www.codeproject.com/KB/shell/systemtray.aspx">http://www.codeproject.com/KB/shell/systemtray.aspx</a>[<a href="http://www.codeproject.com/KB/shell/systemtray.aspx" target="_blank" title="New Window">^</a>]

My problem is that is application is already running and its in hide mode and icon present in system tray,now when i click on my exe than its not open becoz of mutex.

i what when application is already running or its hide than if i click on exe icon than the hide application can show.

please tell me how can i do this.

thanks in advance.