Hi! I have a question: in iczelion tutor, i found conflict explain about of API: CreateDialogParam. in

Tutorial 10: Dialog Box as Main Window, he use CreateDialogParam creating a modalless dialog, window

message loop ends with DestroyWindow, but in the Tutorial 34: RichEdit Control: More Text Operations,

message loop ends with EndDialog, below is the code snippet:

.elseif ax==IDM_GOTOLINE
.if hSearch==0
invoke CreateDialogParam,hInstance,IDD_GOTODLG,hWnd,addr GoToProc,0


GoToProc proc hWnd:DWORD, uMsg:DWORD, wParam:DWORD, lParam:DWORD
.
.
.elseif uMsg==WM_COMMAND
.
.
.
.elseif uMsg==WM_CLOSE
mov hSearch,0
invoke EndDialog,hWnd,0
.else
mov eax,FALSE
ret
.endif
mov eax,TRUE
ret
GoToProc endp

in the resource script, it wrote:

IDD_GOTODLG DIALOGEX 0, 0, 106, 30
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU

How incredible! it's modal dialog, but can created with CreateDialogParam

in MSDN explains CreateDialogParam:
After CreateDialogParam returns, the application displays the dialog box (if it is not already displayed)

using the ShowWindow function. The application destroys the dialog box by using the DestroyWindow

function. To support keyboard navigation and other dialog box functionality, the message loop for the

dialog box must call the IsDialogMessage function.

now, I have a little puzzle, Obviously, the explain of iczelion's tutor 34 is differ from MSDN, but the

code of tutor34 run happily, can someone tell me why?
Posted on 2002-02-10 13:12:42 by dREAMtHEATER
ending a CreateDialogBox dialog with EndDialog is simply an error, but it works at least at my win95 (maybe not in NT or XP)

Write a short message to the tutorials author.
Posted on 2002-02-11 03:38:11 by beaster
I run his tutor example on my XP, it works fine, i know it have a error, but why can it run?
Posted on 2002-02-11 04:01:37 by dREAMtHEATER