ok, as my main window i have a window created with CreateWindowEx. pressing a button on that window, shows a dialog window:



invoke DialogBoxParam,hInstance,6000,hWin,addr klasse5,NULL


this dialog is a simple dialog with no other controls in it.. but on WM_INITDIALOG:



klasse5 proc hdlg:DWORD,uMsg:DWORD,wParam :DWORD,lParam :DWORD
.if uMsg==WM_INITDIALOG
invoke CreateDialogParam,hInstance,6001,hdlg,addr k5_1x1,NULL


it opens another dialog that has a flat style and shall appear in the other dialog as a child window (WS_CHILD is specified in the options of this dialog). the procedure for the dialog IN the dialog is like this:
k5_1x1 proc hWin:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM


.if uMsg==WM_INITDIALOG

.else
mov eax,FALSE
ret
.endif
mov eax,TRUE
ret

k5_1x1 endp


but obviously there is something missing, because the dialog in the dialog isn't redrawn sometimes,it gets completely grey (the controls like edit and stuff aren't visible anymore till i click on them or move the top dialog, then the cursor in the edit controls isn't blinking.. and stuff like that..
i attached the exe file.. just press on "klasse 5" .. thank you

bye
Posted on 2003-02-07 16:59:51 by NOP-erator
for some reason your program is kickin my processor usage up to 100% whenever i hit that button
Posted on 2003-02-07 23:12:27 by BubbaFate
hi,

that's a good hint, but i don't know why! i use radasm to create my project, and i added a standard dialog to my project. this is how i call the dialog:



.if ax==BN_CLICKED
INVOKE DialogBoxParam,hInstance,6000,hWin,offset klasse5,NULL


this is my dialog procedure:



klasse5 proc hdlg:DWORD,uMsg:DWORD,wParam :DWORD,lParam :DWORD

;invoke CreateDialogParam,hInstance,6001,hdlg,addr k5_1x1,NULL

.IF uMsg==WM_INITDIALOG

.ELSEIF uMsg==WM_CLOSE
INVOKE EndDialog,hdlg,NULL
.ELSEIF uMsg==WM_COMMAND

;|> color the staticboxes and the dialog
.ELSEIF uMsg==WM_CTLCOLORDLG
;mov eax,lParam
;INVOKE SetTextColor,wParam,White
;INVOKE SetBkColor,wParam,Red
;INVOKE CreateSolidBrush,000000FFh
;ret

.ELSEIF uMsg==WM_CTLCOLORSTATIC
;mov eax,lParam
;INVOKE SetTextColor,wParam,White
;INVOKE SetBkColor,wParam,Black
;INVOKE CreateSolidBrush,00000000h
;ret

.ELSEIF uMsg==WM_PAINT


.ELSEIF uMsg==WM_LBUTTONDOWN

;INVOKE ReleaseCapture
;INVOKE SendMessage,hdlg,WM_NCLBUTTONDOWN,HTCAPTION,0

.ELSE
mov eax,FALSE
ret
.ENDIF
mov eax,TRUE
ret
klasse5 endp


so what's wrong?? :confused:
Posted on 2003-02-08 07:54:57 by NOP-erator
Dont know why your dialog uses 100% cpu, but the visual problem may be solved by repositioning your child dialog in the Z-order (with func SetWindowPos). example:

invoke SetWindowPos, hWnd,HWND_TOP,0,0,0,0, SWP_NOSIZE or SWP_NOMOVE or SWP_NOACTIVATE
Posted on 2003-02-08 08:35:49 by japheth
thank you, but the visual problem is obviously a consequence of that 100% cpu usage.. :(

bye
Posted on 2003-02-08 08:48:47 by NOP-erator
Yes, I see now:

possible problem may be to return TRUE as response to WM_PAINT. This may cause a loop.
Posted on 2003-02-08 08:50:19 by japheth
Most of the messages should return 0. For example WM_COMMAND, WM_LBUTTONDOWN, WM_PAINT should return 0.
Posted on 2003-02-08 10:17:41 by roticv
ok.. WM_COMMAND should return obviously zero or something..
thank you, it works fine now..
bye
Posted on 2003-02-08 11:14:32 by NOP-erator