The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Tam on August 22, 2007, 03:06:10 PM

Title: How to get the owner hwnd of a dialogbox
Post by: Tam on August 22, 2007, 03:06:10 PM
INT_PTR DialogBox(          HINSTANCE hInstance,
    LPCTSTR lpTemplate,
    HWND hWndParent,
    DLGPROC lpDialogFunc
);

a process call DialogBox("xxx", hwndParent, DlgProc), and soon a dialogbox popup(It's hwnd is hwndChild)
Now, I know hwndChild, how can I get hwndParent?
Thank you.
Title: Re: How to get the owner hwnd of a dialogbox
Post by: hutch-- on August 22, 2007, 11:52:11 PM
Try the simple API GeParent() for the parent handle.
Title: Re: How to get the owner hwnd of a dialogbox
Post by: Tedd on August 23, 2007, 01:27:56 PM
If you're the one creating the dialog box, then the hWndParent parameter will be the handle of your main application window.