Hi! I come from China, now I'm learning Win32ASM, but I encountered a problem, I create a model dialog with API:DialogBoxParam, one style of this dialog is no titlebar, in order to move the window, I know I can make a trick by responding the message:WM_NCHITTEST:

.ELSEIF uMsg==WM_NCHITTEST
invoke DefWindowProc, hWnd, uMsg, wParam, lParam
.IF eax == HTCLIENT
mov eax, HTCAPTION
.ENDIF
ret

but I found when you create dialog with DialogBoxParam, it doesn't work, in the Iczelion win32ASM tutorial wrote: Note that a dialog box

procedure doesn't pass the messages it does not process to the DefWindowProc call since it's not a real window procedure.
Can someone figure out how to solve this problem in this style of dialog? Thanks! sorry for my bad english :(

dREAMtHEATER

dreamtheater@263.net
Posted on 2002-01-04 11:47:56 by dREAMtHEATER
I'd just use something like this:



.elseif uMsg==WM_LBUTTONDOWN
mov eax,lParam
invoke PostMessage,hWin,WM_NCLBUTTONDOWN,HTCAPTION,eax



If you put that in your message handling loop it should do what you want.
Posted on 2002-01-04 12:01:44 by Will
4 oh 4 , thx for ur quick reply, I've compiled the code successfully with ur method and runs OK, I think there is other technique to do it as well, can u or others tell me how to do? :)
Posted on 2002-01-04 12:52:00 by dREAMtHEATER
The return value of the dialog procedure is not handled the same way as with normal windows. With an dialog, the return value only indicates whether you process the message (return 1) or not (return 0).
When you need to supply a return value for a specific message, you have to set it like this:


invoke SetWindowLong,hWnd,DWL_MSGRESULT, [b]return value[/b]


Thomas
Posted on 2002-01-05 11:02:33 by Thomas
Something like this (untested code!):



.ELSEIF uMsg==WM_NCHITTEST
.IF eax == HTCLIENT
invoke SetWindowLong,hWnd,DWL_MSGRESULT, HTCAPTION
xor eax, eax
inc eax ; return one indicating you've processed the message
.ELSE
xor eax, eax
.ENDIF
.ENDIF
ret


Thomas
Posted on 2002-01-05 11:04:08 by Thomas