Posted October 3, 200915 yr When I paint a window with a picture and set its Style to None I can't move it.I use mouse events to move it but it is using a lot of resources(proc) because my window actually move with the cursor.How can I move my window just like a normal one?(with that rectangle surrounding it)
October 3, 200915 yr When you paint a window, you don't paint the window actually. You're just using a static window controllinked with a picture. And since by default you can't move window controls just by dragging them withthe mouse... forget it. nowai
October 3, 200915 yr switch(uMsg) { // ... case WM_LBUTTONDOWN: SendMessage(hWnd, WM_NCLBUTTONDOWN, HTCAPTION, NULL); break; // ... }^ That's what you mean?
October 3, 200915 yr Author Thanks RaMMicHaeL ! I tried to change WM_LBUTTONDOWN to WM_RBUTTONDOWN but it doesn't work any more.Do you know why?P.S. I work in c++ builder 2007 and I use message handlers for this.Maybe this is why it doesn't work if I want to move the window with right button.
October 3, 200915 yr Are you painting onto a control or onto the window itself? If you are creating a control that is the full size of the window, you will need to subclass the control and handle the WM_LBUTTONDOWN event for the specific control instead of the form in order to move it that way.
October 3, 200915 yr wyrdaafaik, this SendMessage call makes Windows think you actually left click on the caption bar.That's why right click doesn't work - you cannot drag a window using the caption bar with the right mouse button.Google for the defines WM_NCLBUTTONDOWN, HTCAPTION, it'll probably explain it better.atom0sIf I got him right, it's just a borderless window with a picture.
Create an account or sign in to comment