Simple Q about DialogBox(...)
when we need to display a dialog box, we could use this API:
DialogBox (hInst, "MYDLGBOX", hwnd, MyDlgBoxProc);
here i know the MyDlgBoxProc is distinct from WndProc, read on...
windows must has some kind of pre-defined wndclass for dialog box (say DefDlgClass), thus it''s must somewhere a DefDlgProc(), and i can image how it likes:
if ((*UserDlgProc)(...))
return;
switch (message) {
...
}
here our MyDlgBoxProc is known as UserDlgProc
all of the above is make sense.
my question is:
how does DefDlgProc() know the callback entry: UserDlgProc?
as i can understand, DefDlgProc is registered with DefDlgClass sometime the OS set itself up, and then there''s a CreateWindow(...) call in DialogBox(), there''s no way to tell DefDlgProc: "for this window, the UserDlgProc is MyDlgBoxProc..."
ok, please gimme some comments if you think i get something wrong, or you just know how it works
thanks in advanced!
------------------------------------------------------CCP is fascistic, they even banned www.sourceforge.net
yes i know it''s function pointer, look at what i post before:
((*UserDlgProc)(...))
i am asking: how DefDlgProc get this fuction pointer(which i give it as a argument when i call DialogBox(..))?
((*UserDlgProc)(...))
i am asking: how DefDlgProc get this fuction pointer(which i give it as a argument when i call DialogBox(..))?
------------------------------------------------------CCP is fascistic, they even banned www.sourceforge.net
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement