i know how to pass parameter using DialogBoxParam
(the last parameter : dwInitParam // initialization value)

but with CreatewindowEx, the last param is :
lpParam // pointer to window-creation data

pParam :
"Points to a value passed to the window through the CREATESTRUCT structure referenced by the lParam parameter of the WM_CREATE message. If an application calls CreateWindow to create a multiple document interface client window, lpParam must point to a CLIENTCREATESTRUCT structure. "

but i just want to pass a DWORD value, to be retrieve in WM_CREATE, and in CREATESTRUCT, i don't know how to put it.

why DialogBoxParam and CreatewindowEx don't use the same scheme?
Posted on 2002-01-28 15:46:13 by gael
Because the dialog pertains to the Window. The windows are HWND, while the dialogs are int. The last parameter of the DialogBoxParam is an initialization value, in the windows you have initialization, many of them, that you define in the CREATESTRUCT structure. Just store the structure in a memory address, e.g: structureforwindow CREATESTRUCT <>. And then you are going to be able to modify these parameters, and then the window will be created.

As the signature of someone said: Select the parameters you wish to modify, and change their values
Posted on 2002-01-28 16:40:22 by CodeLover
Although the lpParam of CreateWindowEx is defined as a pointer, it can really be any DWORD value. The CREATESTRUCT that comes with the WM_CREATE message holds it as the member lpCreateParams.

; in WM_CREATE handler

mov ecx,[lParam] ; get CREATESTRUCT address
assume ecx:ptr CREATESTRUCT ; make members addressable
mov eax,[ecx.lpCreateParams] ; get DWORD value (lpParam from create call)
assume ecx:NONE ; undo ECX assumption

Note that CLIENTCREATESTRUCT is only used with the MDICLIENT class.
Posted on 2002-01-28 18:08:42 by tank