Archived

This topic is now archived and is closed to further replies.

Fresh

Make somebody else's window dock...

Recommended Posts

Hello. Is it possible, given the handle to a window which already has been created, to make it dockable ? Simple question, although I''m not sure of the answer... r. "The mere thought hadn''t even begun to speculate about the slightest possibility of traversing the eternal wasteland that is my mind..."

Share this post


Link to post
Share on other sites
Long answer, yes.

Create a hook in windows that traps a threads messages using the setwindowshookex function. Get the right thread by using the GetWindowThreadProcessId function.

Use the WH_CALLWNDPROC parameter to grab the messages sent with SendMessage (should include WM_MOVE I think) or WH_GETMESSAGE if it is PostMessage. One of them will trap the message. Probably WH_CALLWNDPRO.

Check to see if the window is in a position that docks. If so, send another message telling it to move to the new, docked, locatoin. Careful not to get into a recursive loop though...

Edited by - ludemann8 on October 18, 2001 8:11:17 AM

Share this post


Link to post
Share on other sites