June 29, 2011
Ok I did found one workaround:

HWND mainWindow = FindWindow(appName.toUTF16z, windowName.toUTF16z);

But then the work thread has to know the exact class and window name in order to get the window handle. (HWND is a HANDLE type in disguise).
June 29, 2011
On 6/30/11, Andrej Mitrovic <andrej.mitrovich@gmail.com> wrote:
> Ok I did found one workaround:
>
> HWND mainWindow = FindWindow(appName.toUTF16z, windowName.toUTF16z);
>

Sorry that should be:
HWND mainWindow = FindWindow(className.toUTF16z, windowName.toUTF16z);

It just so happens that I've named the class name for the main window the same as the application name.