• Advertisement
Sign in to follow this  

[Windows API] resize parent, notify childs

This topic is 3402 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I have 2 window: A and B. A is parent of B. In my case, I do not have access to the window message procedure of A. So in the window message procedure of B, how to know when the parent is resizing ? (which messages are sent to the childs when a parent is resizing ?) Thx

Share this post


Link to post
Share on other sites
Advertisement
If no messages are sent to the childs, I am thinking to use hooks.
Maybe I could use something like:

HHOOK hHook = SetWindowsHookEx (WH_CALLWNDPROCRET, (HOOKPROC) hook_proc, GetModuleHandle (NULL), 0);


LRESULT CALLBACK hook_proc (int nCode, WPARAM wParam, LPARAM lParam)
{

if (nCode == HC_ACTION)
{
PCWPSTRUCT wps = (PCWPSTRUCT) lParam;
if (wps->hwnd == parent_win_id && wps->message == WM_SIZE)
{
g_debug ("the parent was resized\n");
}
}

return CallNextHookEx (hHook, nCode, wParam, lParam);
}

But I am not sure if it's really appropriate.

So?

Thx

Share this post


Link to post
Share on other sites
Thx a lot. That's solve my problem: "subclassing"

Then I have read: http://msdn.microsoft.com/en-us/library/ms997565.aspx

++

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement