some times, the "Application"s main window handle is not the handle of the "Logical" main window, (which you want to set focus to), and most of these times, the main window is even hidden, so Set focus does not make any difference.
try itterating the Process's windows and find the one that you need to set forground.
You can use Process Explorer in order to investigate your app. (if it is a specific app you want to take action on.)
use: How to enumerate all windows within a process? to assist in getting the child windows.