BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

find out when a window is changing its pos or size

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Native API)
View previous topic :: View next topic  
Author Message
Jeff Kish
Guest





PostPosted: Wed Dec 14, 2005 3:07 pm    Post subject: find out when a window is changing its pos or size Reply with quote



I need to know if it is possible to have windows tell me (register my
interest somehow) in when a window is changing its size or pos, being
min or maxed.

Is there an api call or something I can do from within a dll? I'm
trying to figure out a way to keep a form filling up exactly the space
in an arbitrary window selected by the calling non borland
application.

thanks
Jeff Kish
Back to top
Sam S. Firouz
Guest





PostPosted: Wed Dec 14, 2005 6:04 pm    Post subject: Re: find out when a window is changing its pos or size Reply with quote



to detect change of window pos you have to trap WM_MOVE message.
for size you can use the unresize event.
for minimize you have to use the Application's OnMinimize and OnRestore
event.

sam



"Jeff Kish" <jeff.kish (AT) mro (DOT) com> wrote

Quote:
I need to know if it is possible to have windows tell me (register my
interest somehow) in when a window is changing its size or pos, being
min or maxed.

Is there an api call or something I can do from within a dll? I'm
trying to figure out a way to keep a form filling up exactly the space
in an arbitrary window selected by the calling non borland
application.

thanks
Jeff Kish



Back to top
Jeff Kish
Guest





PostPosted: Wed Dec 14, 2005 7:12 pm    Post subject: Re: find out when a window is changing its pos or size Reply with quote



On Wed, 14 Dec 2005 13:04:51 -0500, "Sam S. Firouz"
<sfirouz (AT) Hotmail (DOT) com> wrote:

Quote:
to detect change of window pos you have to trap WM_MOVE message.
for size you can use the unresize event.
for minimize you have to use the Application's OnMinimize and OnRestore
event.

sam



"Jeff Kish" <jeff.kish (AT) mro (DOT) com> wrote in message
news:86d0q1puc7faipt9t10s9d4dd1vot4vfki (AT) 4ax (DOT) com...
I need to know if it is possible to have windows tell me (register my
interest somehow) in when a window is changing its size or pos, being
min or maxed.

Is there an api call or something I can do from within a dll? I'm
trying to figure out a way to keep a form filling up exactly the space
in an arbitrary window selected by the calling non borland
application.

thanks
Jeff Kish

I kind of knew that.

But I was hoping the code in the dll could somehow register interest
in WM_MOVE/WM_SIZE messages for another window, and whenever that
window changed positions, the code in the dll would be notified so it
could take some action.

I.E. Even if I did not control the calling code. I can, certainly,
tell the 'user' that they need to pass on Message receipts, but I was
wondering if I could 'automagically' do that.



Thanks
Jeff Kish

Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Wed Dec 14, 2005 8:11 pm    Post subject: Re: find out when a window is changing its pos or size Reply with quote


"Jeff Kish" <jeff.kish (AT) mro (DOT) com> wrote


Quote:
I need to know if it is possible to have windows tell me (register
my interest somehow) in when a window is changing its size or
pos, being min or maxed.

Of course it is possible But how you do that exactly depends on whether the
window you are interested in belongs to your application or not.

If it does, then you can simply subclass the window directly to intercept
the WM_MOVE, WM_MOVING, WM_SIZE, WM_SIZING, WM_WINDOWPOSCHANGING and/or
WM_WINDOWPOSCHANGED message.

If it does not, then you need to use SetWindowsHookEx() to install a global
hook. The hook must be in a DLL so that it can be injected into all running
processes. If you set a WH_CBT hook, you can receive HCBT_MINMAX and
HCBT_MOVESIZE notifications. Or if you set a WH_CALLWNDPROC or
WH_CALLWNDPROCRET hook to intercept the above window messages.


Gambit



Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Wed Dec 14, 2005 8:12 pm    Post subject: Re: find out when a window is changing its pos or size Reply with quote


"Jeff Kish" <jeff.kish (AT) mro (DOT) com> wrote


Quote:
But I was hoping the code in the dll could somehow register interest in
WM_MOVE/WM_SIZE messages for another window, and whenever
that window changed positions, the code in the dll would be notified so
it could take some action.

It can. See my other reply.


Gambit



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Native API) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.