In fact, the app has single instance pattern. So, the issue occur when app is already started, and when user try to start another instance and a system tray balloon is shown, and user click on this volume, and then is fired code from the first post. And didn't work ok, instead of MDI get focus, I saw the app flash the task bar icon few times. So, I have tried this code too:
Code:
ShowWindow(SW_RESTORE);
HWND hForegdWnd = ::GetForegroundWindow();
DWORD dwCurID = ::GetCurrentThreadId();
DWORD dwForeID = ::GetWindowThreadProcessId(hForegdWnd, NULL);
::AttachThreadInput(dwCurID, dwForeID, TRUE);
::SetForegroundWindow(m_hWnd);
::SetFocus(m_hWnd);
::AttachThreadInput(dwCurID, dwForeID, FALSE);
with the same result.