mhammond / pywin32

Python for Windows (pywin32) Extensions
5.06k stars 798 forks source link

PyCWnd.SetActiveWindow raises invalid error #578

Open ghost opened 12 years ago

ghost commented 12 years ago

PyCWnd.SetActiveWindow() sometimes fails with "The window was created in a different thread and can not be mapped.", though the function did its job.

Thats obviously (just) because it tries to convert the return value (previous window / CWnd* may be temporary according MSDN) with "return PyCWnd::make( UITypeFromCObject(pRel), pRel)->GetGoodRet();" which uses FromHandlePermanent and some thread check or so. Perhaps it needs a less rigid converter or return Non instead of failure.

Reported by: kxroberto

Original Ticket: pywin32/bugs/578

Avasam commented 8 months ago

@kxrob Is this issue still relevant?