I have been trying to do a GUI test with DUnit which includes interacting with modal windows via a message loop timer system by @tomazy (see my earlier question for more details: (How) Can I use FutureWindows with standard file open dialogs? ).
My solution in the other question works fine when I run the tests manually, but when I run this within a continuous build system in TeamCity, it hangs when the dialog's OK message should be handled. The service that runs the tests has the permission "interact with desktop" set, and I have verified that the hanging happens ONLY if the OK is pressed (i.e. the CDN_FILEOK notification happens). I can close the dialog using WM_CLOSE, but this naturally does not cause the dialog to return an OK modal result, and thus is not usable.
If I can't get this to work, I'll probably have to modify the production code (target of test) to publish an event to give the filename and have the test hook into it and give it without a dialog, but I'd like to know what is causing this problem and preferably of course solve it without modifying the production code.