I don't want to be rude, but have you tried the debugger?
If a program doesn't work, a debugging session is the best way to find out why.
Just single-step the code and see what happens. (That's especially easy when it's a small program like this).
You have been struggling with this problem for about a week, if you had done a couple of debugging sessions, the the problem should have been solved several days ago.
It's well worth the time it takes to learn how to use the debugger.
I have a child control in my dialog app. I changed it to popup by using ModifyStyle. The style is changed, but its behaviour is still as child. I mean, it is not getting top of the other controls, like popup dialogs do.
I'm a little confused about what you want to get changin' the control style from Child to Popup.
A child window apears in the client area of the parent window, as opposed to the popup windows that appears outside.
mean, it is not getting top of the other controls, like popup dialogs do.
Reading your question i think you want to put your control over another child control inside the client area of your application's window. To do this you simply call the API function SetWindowPos(HWND Window, HWND IsertAfter, ...., int flags). On successful completion, Window gets over InsertAfter. Remember, if you don't want to move nor resize the control you can pass as flags (SWP_NOMOVE|SWP_NOSIZE).
Consider There is an edit control and a staic control in the dialog.. Using the SetwindowPos I moved the staic control over the edit control( only half overlapped). But now if I clicked in the edit control, it will paint over staic control..