hi all,
what is wrong on start a dialog without class definitio and without message loop, as follow..
It's the shortest way to write a simple dialog app but i'm not sure this method is correct. Seems work but It's without message loop...
B7
what is wrong on start a dialog without class definitio and without message loop, as follow..
all GetModuleHandleA, NULL
mov [hInstance], eax
call InitCommonControls
call CreateDialogParamA, [hInstance], IDD_MAIN, 0, offset DLG_Proc_Main, 0
call ExitProcess, 0
DLG_Proc_Main proc .....
cmp [wmsg],WM_INITDIALOG
je Create
cmp [wmsg],WM_PAINT
je Paint
...
...
It's the shortest way to write a simple dialog app but i'm not sure this method is correct. Seems work but It's without message loop...
B7
The normal way of creating a dialog app is to use DialogBoxParamA. That function provides its own message loop. It also prefers using EndDialog (instead of DestroyWindow) to close the window.
sorry, i was wrong on attaching the code. The function i've used was just DialogBoxParamA, not CreateDialogParamA.
But so, why using windowsclass & messageloop if i can use DialogBoxParamA ?
But so, why using windowsclass & messageloop if i can use DialogBoxParamA ?
HI! a cool thing i found my self is that we can mix it together ,
for example we make a dialog with no buttons or any control at all
just the :
1000 DIALOG 203,188,200,143
STYLE DS_CENTER | DS_3DLOOK | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
CAPTION "dialog name"
FONT 8, "Helv"
BEGIN
END
then if we want to make a button or edit control for example we just do:
wm_inidialog:
call CreateWindowExA, NULL, "BUTTON","", WS_CHILD | WS_VISIBLE,200,104,27,25,, 101, , NULL
;)
it works fine!
for example we make a dialog with no buttons or any control at all
just the :
1000 DIALOG 203,188,200,143
STYLE DS_CENTER | DS_3DLOOK | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
CAPTION "dialog name"
FONT 8, "Helv"
BEGIN
END
then if we want to make a button or edit control for example we just do:
wm_inidialog:
call CreateWindowExA, NULL, "BUTTON","", WS_CHILD | WS_VISIBLE,200,104,27,25,, 101, , NULL
;)
it works fine!
why using windowsclass & messageloop if i can use DialogBoxParamA ?
You can do modeless dialog boxes as well.
Bit7, dialog based applications are just fine, nobody says you _have_ to use a messageloop.
Bit7, dialog based applications are just fine, nobody says you _have_ to use a messageloop.