Try setting breakpoints at the main procedure, the point where the dialogbox is created, and where it is used. Then look at what thread(s) you actually are in. Also, check what the value of Thread.CurrentThread.GetApartmentState() is at those points.