0
Answer

Subclassing a control who's parent has to be the Desktop

ldragos

ldragos

20y
1.4k
1
Hello, I am trying to subclass a control which has to be floating over the form's boundaries. I found that this kind of behaviour can be achieved by setting the control's parent the Desktop. I did that, however, the control even if responds to mouse events, doesn't have focus (ie. for a ListViewControl, I can click, doubleclick an Item and it responds to that, however, the Item is never focused - I mean never has a FocusRectangle; or considering a ComboBox control, I can never type into it's EditArea, even if the mouse Cursor changes whenever moving over it). Also, I noticed that the Control is shown in the taskbar, which I also am not satisfied with, and recieves proper focus only when I click on it's taskbar tab. So, my problem is that I cannot activate the control without clicking on it's tab (I tried using every WinAPI function I could think of such as SetActiveWindow, Set Focus, BringWindowToFront etc - none helped). Thanks for the help!