Delphi XE2, vcl styles recreating window handle

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 06:45:32

There is no way to avoid re-creating the window handles. Instead, override your window's CreateWnd and DestroyWnd methods so that you're notified when a window is re-created.

Also, avoid keeping persistent references to handles of windows that might get destroyed. Instead, read the Handle property each time you need it. Then you won't have to watch for notifications.

Beware of reading Handle from a different thread, though, since it may cause the window to become associated with the wrong thread. Wrap any code that needs to interact with a VCL window into a method that you call via Synchronize or Queue.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!