I have a custom control, lets call him Jack, that is part of a dialog called Jill.
how would Jack go about sending messages to Jill?
Custom Controls and their dialogs.
- MehYam
- DBB Head Flapper
- Posts: 2184
- Joined: Thu Nov 05, 1998 12:01 pm
- Location: Mountain View, CA, USA
- Contact:
I'm not an expert at custom controls, but I imagine you have a few options available to you. What does your control do? If it's a custom button, for instance, then it kinda makes sense to just subclass the button proc and pretend you're really just like a button. The WM_PARENTNOTIFY mechanism also comes to mind.
I guess another thing to consider is that the Treeview and Listview controls are really just custom controls that come from Microsoft. Check out their command/event API in the MSDN for some ideas.
Is this C++, VB, or .NET?
I guess another thing to consider is that the Treeview and Listview controls are really just custom controls that come from Microsoft. Check out their command/event API in the MSDN for some ideas.
Is this C++, VB, or .NET?
Important question: are you using MFC or plain old WinAPI?
Using WinAPI:
Get the HWND of Jack's parent using hWndJill = (HWND)(GetWindowLong(hWndJack, GWL_HWNDPARENT)); and use either PostMessage to post the message in Jill's queue and keep on moving, or SendMessage to wait until Jill is done processing Jack's message.
MehYam, WM_PARENTNOTIFY is sent by Windows to a parent window for create, destroy, and mouse-related events.
Using WinAPI:
Get the HWND of Jack's parent using hWndJill = (HWND)(GetWindowLong(hWndJack, GWL_HWNDPARENT)); and use either PostMessage to post the message in Jill's queue and keep on moving, or SendMessage to wait until Jill is done processing Jack's message.
MehYam, WM_PARENTNOTIFY is sent by Windows to a parent window for create, destroy, and mouse-related events.