roticv
Joined: 19 Jun 2003
Posts: 374
Location: Singapore
|
Hi,
I use the following code
proc MessageWindow,hwnddlg, msg, wparam, lparam
enter
mov eax, [msg]
cmp eax, WM_INITDIALOG
jz .wminitdialog_msg
cmp eax, WM_COMMAND
je .wmcommand_msg
cmp eax, WM_CLOSE
jz .wmclose_msg
cmp eax, WM_SETCLASS
jz .wmsetclass_msg
cmp eax, WM_SENDMSG
jz .wmsendmsg_msg
.end_msg:
xor eax, eax
return
.wmclose_msg:
invoke EndDialog,[hwnddlg],0
jmp .end_msg
.wminitdialog_msg:
invoke LoadIcon, hinstance, 16
invoke PostMessage, [hwnddlg],WM_SETICON, ICON_SMALL, eax
.wmcommand_msg:
mov eax, [wparam]
cmp eax,1014
je .wmclose_msg
jmp .end_msg
.wmsetclass_msg:
invoke SetWindowLong, [hwnddlg], DWL_USER, [lparam]
jmp .end_msg
.wmsendmsg_msg:
invoke GetWindowLong, [hwnddlg], DWL_USER
xchg eax, ebx
lea eax, [lvfi]
mov [eax+LV_FINDINFO.flags],LVFI_PARAM
mov [eax+LV_FINDINFO.lParam], ebx
invoke SendMessage,[hList],LVM_FINDITEM,-1, eax
cmp eax, -1
jnz @F
;;;;;;;;convert dword to string here
jmp _addmsg
@@:
mov [lvi.iItem], eax
mov [lvi.pszText], cookie
mov [lvi.cchTextMax], 30h
invoke SendMessage,[hList],LVM_GETITEM,0,lvi
push -2
push -1
invoke SendDlgItemMessage,[hwnddlg], 1011, EM_EXSETSEL,0,esp
add esp, 8
_addmsg:
invoke SendDlgItemMessage,[hwnddlg], 1011, EM_REPLACESEL,0,cookie
invoke SendDlgItemMessage,[hwnddlg], 1011, EM_REPLACESEL,0,formatting
invoke SendDlgItemMessage,[hwnddlg], 1011, EM_REPLACESEL,0,[lparam]
invoke SendDlgItemMessage,[hwnddlg], 1011, EM_REPLACESEL,0,formatting
jmp .end_msg
The problem is that fasm complains that on the last line, Error: undefined symbol, instruction: jmp .end_msg.. Any explanation is welcomed.
|