Re: Catching window move
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Fri, 11 May 2007 00:16:08 -0400
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!Joseph M. Newcomer [MVP]
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,Joseph M. Newcomer [MVP]
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
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- Follow-Ups:
- Re: Catching window move
- From: Victor
- Re: Catching window move
- References:
- Catching window move
- From: Manu
- Re: Catching window move
- From: Joseph M . Newcomer
- Re: Catching window move
- From: Victor
- Catching window move
- Prev by Date: Re: CStdioFile::ReadString not working with correctly with UNICODE
- Next by Date: Re: DbgHelp help
- Previous by thread: Re: Catching window move
- Next by thread: Re: Catching window move
- Index(es):
Relevant Pages
|