Click to See Complete Forum and Search --> : Moving Window with Mine
WadeD
May 24th, 2000, 12:26 AM
Is there a way to process code while a window's being dragged without stopping the user's drag movement?
I need to keep a foreign window (App B) in the same position relative to my window (App A). So when I move App A, App B needs to move at the same time. I'm subclassing my app and using SetWindowPos to move App B. This works, but this processing within App A kills the drag movement, so I have to click App A and start dragging again, which isn't user-friendly.
Thanks for any help.
Sam Finch
May 24th, 2000, 05:12 PM
I'm sure I replied to this last night, maybe I forgot to hit submit or something
From your previous posts you say that you have successfully subclassed foreign windows with some C Dlls, so we'll be doing that.
set up your own message and trap it in the foreign window you want to move, something like WM_MoveMe = -100 (-ve numbers arn't used for message constants so you won't get a conflict) when you recieve this message move the window to the position specified.
in your window moving code use postmessage to move the window (postmessage doesn't wait for a return value)
that way all the legwork will be done in the foreign window process and you should be alright.
Hope his helps
WadeD
May 24th, 2000, 08:51 PM
Sam, thanks for the response, but I've removed the title bar from the foreign window so it doesn't move unless I tell it to from my window. This is triggered based on a message (WM_MOVE) from my window. I guess I could set up a separate executable to process it without interrupting my window, but I didn't want the extra overhead. I'm using SetWindowPos -- didn't think you could move a window using PostMessage.
p.s. I'm subclassing using Spyworks (http://www.desaware.com).
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.