문제

I implemented a dialog-based Win32 Visual C++ application (Visual Studio Ultimate 2012) by following this article.

What is the way to call another dialog box (by clicking on a button) from the one I already created?

도움이 되었습니까?

해결책

Add a button to the dialog in the dialog resource view. Just drag a button from the toolbar onto the dialog template. When the button is clicked you will get a WM_COMMAND message containing the button ID and the BN_CLICKED notification code.

http://msdn.microsoft.com/en-us/library/windows/desktop/bb761825(v=vs.85).aspx

Add a case in your DialogProc to detect the click. When you get it, create a new dialog by calling the DialogBox API.

http://msdn.microsoft.com/en-us/library/windows/desktop/ms645452(v=vs.85).aspx

This second dialog will need you to write a new DialogProc2, just like the first DialogProc, to handle messages from the second dialog.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top