Sign in to follow this  
jhondoe

[Windows API] resize parent, notify childs

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this