Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 23 additions & 10 deletions dte.asm
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,10 @@ EXTERN _imp__TrackPopupMenu@28 :PTR ; show context popup menu
EXTERN _imp__DestroyMenu@4 :PTR ; free a menu handle
EXTERN _imp__GetMessagePos@0 :PTR ; screen coords of last msg
EXTERN _imp__SendMessageA@16 :PTR ; talk to EDIT control
EXTERN _imp__SendMessageW@16 :PTR ; talk to EDIT control
EXTERN _imp__ChooseFontW@4 :PTR ; common font picker dialog
EXTERN _imp__FindTextA@4 :PTR ; common Find dialog
EXTERN _imp__ReplaceTextA@4 :PTR ; common Replace dialog
EXTERN _imp__FindTextW@4 :PTR ; common Find dialog
EXTERN _imp__ReplaceTextW@4 :PTR ; common Replace dialog
EXTERN _imp__RegisterWindowMessageA@4 :PTR ; FINDMSGSTRING message id
EXTERN _imp__IsDialogMessageA@8 :PTR ; route keys to find dialog
EXTERN _imp__PrintDlgA@4 :PTR ; common Print dialog (returns DC)
Expand Down Expand Up @@ -784,13 +785,12 @@ DoFindNext proc NEAR
mov ft.lpstrText, eax

mov eax, fr.Flags
and eax, FR_MATCHCASE
or eax, FR_DOWN
and eax, FR_MATCHCASE or FR_WHOLEWORD or FR_DOWN

lea edx, ft
push edx
push eax
push EM_FINDTEXTEXA
push EM_FINDTEXTEXW
mov edx, hEdit
push edx
call [_imp__SendMessageA@16]
Expand All @@ -814,6 +814,10 @@ DoFindNext proc NEAR
push edx
call [_imp__SendMessageA@16]

mov eax, hEdit
push eax
call [_imp__SetFocus@4]

push 1
pop eax
ret
Expand All @@ -832,7 +836,7 @@ DoReplaceOne proc NEAR
push EM_REPLACESEL
mov eax, hEdit
push eax
call [_imp__SendMessageA@16]
call [_imp__SendMessageW@16]
call DoFindNext
ret
DoReplaceOne endp
Expand Down Expand Up @@ -863,7 +867,7 @@ DoReplaceAll proc NEAR
push EM_REPLACESEL
mov edx, hEdit
push edx
call [_imp__SendMessageA@16]
call [_imp__SendMessageW@16]
jmp RepLoop

RepDone:
Expand Down Expand Up @@ -1801,7 +1805,7 @@ WndProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM

; EDIT control (class "RICHEDIT50W")
mov eax, WS_CHILD or WS_VISIBLE or WS_BORDER or ES_LEFT \
or ES_MULTILINE or ES_AUTOVSCROLL or WS_VSCROLL
or ES_MULTILINE or ES_AUTOVSCROLL or WS_VSCROLL or ES_NOHIDESEL

; create EDIT control
EditStyleReady:
Expand Down Expand Up @@ -2097,7 +2101,7 @@ WndProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM
call InitFR
lea eax, fr
push eax
call [_imp__FindTextA@4]
call [_imp__FindTextW@4]
mov hFindDlg, eax
xor eax, eax
ret
Expand All @@ -2111,7 +2115,7 @@ WndProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM
call InitFR
lea eax, fr
push eax
call [_imp__ReplaceTextA@4]
call [_imp__ReplaceTextW@4]
mov hFindDlg, eax
xor eax, eax
ret
Expand Down Expand Up @@ -2253,6 +2257,15 @@ WndProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM

; check for WM_DESTROY
NotWMSize:
cmp uMsg, WM_SETFOCUS
jne NotWMSetFocus
mov eax, hEdit
push eax
call [_imp__SetFocus@4]
xor eax, eax
ret

NotWMSetFocus:
cmp uMsg, WM_DESTROY
jne NotWMDestroy

Expand Down