ok, as my main window i have a window created with CreateWindowEx. pressing a button on that window, shows a dialog window:
this dialog is a simple dialog with no other controls in it.. but on WM_INITDIALOG:
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:
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
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
for some reason your program is kickin my processor usage up to 100% whenever i hit that button
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:
this is my dialog procedure:
so what's wrong?? :confused:
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:
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
invoke SetWindowPos, hWnd,HWND_TOP,0,0,0,0, SWP_NOSIZE or SWP_NOMOVE or SWP_NOACTIVATE
thank you, but the visual problem is obviously a consequence of that 100% cpu usage.. :(
bye
bye
Yes, I see now:
possible problem may be to return TRUE as response to WM_PAINT. This may cause a loop.
possible problem may be to return TRUE as response to WM_PAINT. This may cause a loop.
Most of the messages should return 0. For example WM_COMMAND, WM_LBUTTONDOWN, WM_PAINT should return 0.
ok.. WM_COMMAND should return obviously zero or something..
thank you, it works fine now..
bye
thank you, it works fine now..
bye