Avoid a Dlg Box from being drag? How?

Started by
9 comments, last by Extrarius 18 years, 9 months ago
Hi, that it, how can i avoid a dlg box from being drag???
Advertisement
Why do you want this behavior? Anything that deviates from what is expected will piss off users, so an immobile dialog box is probably not something you should stive for without a real good reason.

CM
No, for this special case, i just want to know how to do it.
That's it!
Move it to a certain position every few milliseconds maybe
Windows send a WM_MOVE message when they are moved. Just move the window to the deisred position whenever it gets moved.
- I don't pretend to know anything.Snowsoft
I would suggest a slight alteration to smack0007's idea. Instead of moving back just return that you handled the move and dont' do anything. Making sure not to pass on the move message of course.

You'll also want to do something similar for the sizeing messages.

Cheers
Chris
CheersChris
I think WM_MOVE is sent after the Window has been moved.
- I don't pretend to know anything.Snowsoft
You want the WM_MOVING message. You can set the coordinates of the drag box in that message, so just set it to the current location of the dialog and they should just see an undraggable outline (if they have the 'show contents while dragging' turned of, otherwise the window just won't move I think).
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
You could do all those things with WM_MOVE, or create a Dialog box without a title bar... just as a POPUPWINDOW.
my_life:          nop          jmp my_life
[ Keep track of your TDD cycle using "The Death Star" ] [ Verge Video Editor Support Forums ] [ Principles of Verg-o-nomics ] [ "t00t-orials" ]
I like the no title bar idea better than my original idea. That way you couldn't drag it period.
- I don't pretend to know anything.Snowsoft

This topic is closed to new replies.

Advertisement