百思不得其解,关于罗云彬书9.2节
子程序代码是这样的:
_Resizeproc
local@stRect:RECT,@stRect1:RECT
invokeMoveWindow,hWinStatus,0,0,0,0,TRUE
invokeGetWindowRect,hWinStatus,addr @stRect
invokeGetClientRect,hWinMain,addr @stRect1
movecx,@stRect1.right
subecx,@stRect1.left
moveax,@stRect1.bottom
subeax,@stRect1.top
subeax,@stRect.bottom
addeax,@stRect.top
invokeMoveWindow,hWinEdit,0,0,ecx,eax,TRUE
ret
WM_INITDIALOG
moveax,hWnd
movhWinMain,eax
invokeCreateStatusWindow,WS_CHILD OR WS_VISIBLE OR \
SBS_SIZEGRIP,NULL,hWinMain,ID_STATUSBAR
movhWinStatus,eax
invokeSendMessage,hWinStatus,SB_SETPARTS,4,offset dwStatusWidth
movlpsz1,offset sz1
movlpsz2,offset sz2
invokeSendMessage,hWinStatus,SB_SETTEXT,2,lpsz1
invokeCreateWindowEx,WS_EX_CLIENTEDGE,addr szClass,NULL,\
WS_CHILD or WS_VISIBLE or ES_MULTILINE or ES_WANTRETURN or WS_VSCROLL or ES_AUTOHSCROLL,\
0,0,0,0,hWnd,ID_EDIT,hInstance,NULL
movhWinEdit,eax
call_Resize
invokeMoveWindow,hWinStatus,0,0,0,0,TRUE ;这里设4个0是不是因为即使为0,状态栏也会自动调节大小尺寸?
invokeGetWindowRect,hWinStatus,addr @stRect ;
invokeGetClientRect,hWinMain,addr @stRect1 ;这是算客户区的尺寸,这我能看明白
movecx,@stRect1.right
subecx,@stRect1.left
moveax,@stRect1.bottom
subeax,@stRect1.top
subeax,@stRect.bottom
addeax,@stRect.top ;上面这6句代码干嘛的呢,为什么一定要这么算,算出来的又是什么的尺寸呢?不明白,算客户区的高度直接用@stRect1.bottom-@stRect1.top不就行了吗?
为什么还要用这个值去减掉@stRect.bottom和@stRect.top之间的差值(也就是状态栏的高呢)?
invokeMoveWindow,hWinEdit,0,0,ecx,eax,TRUE ;