Sign in to follow this  
spree

[win32] How do i control more than one DialogBox?

Recommended Posts

spree    100
I have read and implemented a tutorail about dialog boxes. This tutorial showed how to create and manage only one dialog box. Now I understand that i control my dialog box via this func:
BOOL CALLBACK DialogProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);

and when i want to call for my dialog box i just use this func with the dialog box i designed ( IDD_D2 )
CreateDialog(hinstance,MAKEINTRESOURCE(IDD_D2),hwnd,(DLGPROC)DialogProc);

My question: If i control all the messages and events for my IDD_D2 dialog box at DialogProc, where should I to control additional message box? The messages handled at DialogProc are fitted to serve IDD_D2 dialog box, where should i implement the message handleing for my other message box?

Share this post


Link to post
Share on other sites
conman    181
Hi,
I hope I understood you question right:
for your second dialog box you write another dialog proc
and call CreateDialog with that one.

-- constantin

Share this post


Link to post
Share on other sites
spree    100
Ohhh, I thought that the BOOL CALLBACK DialogProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam); func is a built in, and i that i cant change it :) well i just changed the name of this func and it worked :)

OKAY this means that i can call my dialog func as i wish, but i must to stick with the same parameter list righ? because the argument for CreateDialog is a pointer to a spesific type of func?

Share this post


Link to post
Share on other sites
conman    181
Yes it's the signature

INT_PTR CALLBACK DialogProc(HWND hwndDlg,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
);

that must fit.
You can read more about it at
MSDN.

-- constantin

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