Re: Catching window move



If the call is done from another app, all you can do is respond to WM_MOVE and PostMessage
a request to put it back where it was.
joe

On Thu, 10 May 2007 16:28:28 +0200, "Victor" <no_address> wrote:

Hi, Joe!
But what about preventing moving using code, such MoveWindow or
SetWindowPos? Note, such calls might be done also from some other
application!

Victor

"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:f6a643duphefk3ri2ht37mg7k12q6pcq3i@xxxxxxxxxx
First, handle WM_NCCHITTEST. If the superclass returns HTCAPTION, return
HTNOWHERE. This
will disable mouse dragging (also double-clicking on the caption bar to
maximize it). Then
handle the OnSysCommand (there's already a handler for this) and if the
case is SC_MOVE
(you need to add this) return without calling the superclass.
joe

On 9 May 2007 21:02:21 -0700, Manu <manoharbasireddy@xxxxxxxxx> wrote:

Hello,
I have created a sample dialog based MFC application. I
wanted to make it unable to move the dialog window. For that in that
dialog calss the have defined PreTranslateMessage() to catch WM_MOVE
or WM_MOVING, but when i run the apllication and move the dialog by
puttin g focus on title bar, these messages are not fired by
windows. what should i need to do to disable dialog(with titlebar)
move?

Regards,
Manohar
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm

Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: Catching window move
    ... will disable mouse dragging (also double-clicking on the caption bar to ... wanted to make it unable to move the dialog window. ... MVP Tips: http://www.flounder.com/mvp_tips.htm ...
    (microsoft.public.vc.mfc)
  • Re: DISP_E_MEMBERNOTFOUND
    ... "Joseph M. Newcomer" wrote: ... I understand your solution of checking if the window is ... MVP Tips: http://www.flounder.com/mvp_tips.htm ...
    (microsoft.public.vc.mfc)
  • Re: Custom CRect Question
    ... the session, the session number, and total number of sessions. ... I already have a "wallpaper" for the main window. ... MVP Tips: http://www.flounder.com/mvp_tips.htm ...
    (microsoft.public.vc.mfc)
  • Re: why the window created in UI thread cant recive message?
    ... i use AfxBeginThread to creates a UI thread,and creates a window in the ... MVP Tips: http://www.flounder.com/mvp_tips.htm ...
    (microsoft.public.vc.mfc)
  • Re: Drawing the iconic window
    ... >It is possible to add a system menu to a window without caption bar as ... >void MyDialog::PreSubclassWindow ... MVP Tips: http://www.flounder.com/mvp_tips.htm ...
    (microsoft.public.vc.mfc)