Re: CreateDialog and sending a WM_NOTIFY from it
Woodrow Reece <[email protected]>
| Newsgroups | alt.comp.os.windows-xp,alt.windows7.general,comp.os.ms-windows.programmer.win32 |
|---|---|
| Message-ID | <[email protected]> |
R.Wieser wrote: > Hello all, > > Maybe a bit of an esoteric problem, but one I would want to have solved > nonetheless: > > I've got a program which puts up a settings dialog (using CreateDialog). > From this settings dialog I would like to send notifications (WM_NOTIFY) to > its parent. > > The problem is, the NMHDR structure expects the "idFrom" field (the control > ID) to be filled in, and I can't find it (IDD_SETTINGS, as provided to the > CreateDialog call) stored anywhere. :-| > > Question: > > Is it stored anywhere in the dialog, and if so, where ? > > Secondary question: > > Will using SetWindowLong with the GWL_ID argument on a Dialog window create > any problems (does anything else use that field) ? The WM_NOTIFY message is for a control on a dialog to send to the dialog. Not for a dialog to send to its parent. If your settings dialog is a control on another dialog, it must have the styles WS_CHILD and DS_CONTROL. Only then can it have a control ID. If your settings dialog is not a control on another dialog, you are misusing the WM_NOTIFY message. You will be on your own.