|
-
May 2nd, 1999, 11:38 PM
#1
How to make a window immovable?!?
Hi All,
Is there any way to make a Dialog Based Application immovable?? i.e., I dont want the user to move the application window.
%
-
May 3rd, 1999, 12:52 AM
#2
Re: How to make a window immovable?!?
Hi,
I di not try that but I think simply overriding WM_MOVE should work.
Regards,
Bernd
-
May 3rd, 1999, 03:53 AM
#3
Re: How to make a window immovable?!?
Capture WM_NCHITTEST. If you call DefWindowProc() when you capture WM_NCHITTEST you will get HT_CAPTION if the mouse is in the caption bar. If you then return HT_NOWHERE, the window will not move.
switch(msg) {...
case WM_NCHITTEST:
UINT nPos = DefWindowProc(...);
if ( nPos == HT_CAPTION ) return HT_NOWHERE;
return nPos;
...
}
You may also have to check for WM_SYSCOMMAND and check if SC_MOVE is selected, or make sure that your app does not have a system command menu, since the user can also move the window using the keyboard.
I don't think that capturing WM_MOVE will work, since this is called *after* the user has attempted to move the window. The user will still be able to use the mouse to start the movement, and if they have full screen drag on, they will still see the window
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|