|
|
|
@ -51,9 +51,14 @@ process_event:
|
|
|
|
|
push es |
|
|
|
|
|
|
|
|
|
; On entry, ds and es will not be set correctly for us |
|
|
|
|
mov bp, cs |
|
|
|
|
mov ds, bp |
|
|
|
|
mov es, bp |
|
|
|
|
; WM_OPEN_FILE needs ds to be left-as is |
|
|
|
|
cmp al, WM_OPEN_FILE |
|
|
|
|
je .no_set_ds |
|
|
|
|
push cs |
|
|
|
|
pop ds |
|
|
|
|
.no_set_ds: |
|
|
|
|
push cs |
|
|
|
|
pop es |
|
|
|
|
|
|
|
|
|
cmp al, WM_PAINT |
|
|
|
|
jne .not_paint |
|
|
|
@ -79,6 +84,12 @@ process_event:
|
|
|
|
|
jmp .end |
|
|
|
|
.not_unhook: |
|
|
|
|
|
|
|
|
|
cmp al, WM_OPEN_FILE |
|
|
|
|
jne .not_open_file |
|
|
|
|
call event_open_file |
|
|
|
|
jmp .end |
|
|
|
|
.not_opend_file: |
|
|
|
|
|
|
|
|
|
.end: |
|
|
|
|
pop es |
|
|
|
|
pop ds |
|
|
|
@ -316,7 +327,7 @@ event_click:
|
|
|
|
|
; out: |
|
|
|
|
; clobbers everything |
|
|
|
|
event_keyboard: |
|
|
|
|
; Unlike other events, keyboard events are not forwarded |
|
|
|
|
; Unlike most other events, keyboard events are not forwarded |
|
|
|
|
; Since we do not care about the keyboard for this app, we just |
|
|
|
|
; swallow the event |
|
|
|
|
ret |
|
|
|
@ -353,6 +364,24 @@ event_unhook:
|
|
|
|
|
mov ax, [window_next] |
|
|
|
|
ret |
|
|
|
|
|
|
|
|
|
; in: |
|
|
|
|
; al = WM_OPEN_FILE |
|
|
|
|
; ds:cx = filename |
|
|
|
|
; ds ≠ cs |
|
|
|
|
; out: |
|
|
|
|
; ds = cs |
|
|
|
|
; clobbers everything |
|
|
|
|
event_open_file: |
|
|
|
|
; File open events are sent specifically to a process, so we don't |
|
|
|
|
; need to forward it |
|
|
|
|
; Unlike other event handlers, event_open_file is called with ds |
|
|
|
|
; still set to calling process's segment, so that it can read the |
|
|
|
|
; passed-in filename. For simplicity of code running after the, |
|
|
|
|
; event handlers, we set ds to point to our own segment on return |
|
|
|
|
push cs |
|
|
|
|
pop ds |
|
|
|
|
ret |
|
|
|
|
|
|
|
|
|
; ------------------------------------------------------------------ |
|
|
|
|
; Event handler subroutines |
|
|
|
|
; ------------------------------------------------------------------ |
|
|
|
|