I encountered a weird issue with XE2:
I’m using HWND_TOPMOST with SetWindowPos to set my form on top, but if I switch VCL styles at runtime, the window isn’t topmost anymore, and unsetting/re-setting it doesn’t fix it either.
Any way to fix this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your problem is that the form is being recreated because of a style change and loosing its top most style since the VCL have no knowledge of this. Either use:
or override
CreateWindowHandleso thatSetWindowPosis called each time the form is recreated:BTW, I couldn’t duplicate “unsetting/re-setting doesn’t fix it”. With my tests, calling
SetWindowPosagain fixed it.