* new system function for "send message"

* @panel: Alt+F4 sends close message rather than immediate kill

git-svn-id: svn://kolibrios.org@665 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Evgeny Grechnikov (Diamond) 2007-10-25 11:20:02 +00:00
parent 94cec78ecd
commit c1f806239d
6 changed files with 101 additions and 35 deletions

View File

@ -213,6 +213,7 @@ iglobal
dd sys_debug_services ; 69-Debug dd sys_debug_services ; 69-Debug
dd file_system_lfn ; 70-Common file system interface, version 2 dd file_system_lfn ; 70-Common file system interface, version 2
dd syscall_windowsettings ; 71-Window settings dd syscall_windowsettings ; 71-Window settings
dd sys_sendwindowmsg ; 72-Send window message
times 255 - ( ($-servetable) /4 ) dd undefined_syscall times 255 - ( ($-servetable) /4 ) dd undefined_syscall

View File

@ -2198,14 +2198,15 @@ dd 638
* eax = 47 - ­®¬¥à ä㭪樨 * eax = 47 - ­®¬¥à ä㭪樨
* ebx = ¯ à ¬¥âàë ¯à¥®¡à §®¢ ­¨ï ç¨á«  ¢ ⥪áâ: * ebx = ¯ à ¬¥âàë ¯à¥®¡à §®¢ ­¨ï ç¨á«  ¢ ⥪áâ:
* bl = 0 - ecx ᮤ¥à¦¨â ç¨á«® * bl = 0 - ecx ᮤ¥à¦¨â ç¨á«®
* bl = 1 - ecx α<EFBFBD>€₯নβ γͺ § β₯«μ ­  dword-η¨α«<CEB1>, «¨<C2A8> qword-η¨α«<CEB1> * bl = 1 - ecx ᮤ¥ΰ¦¨β γ<> § β¥«μ ­  dword/qword-η¨α«®
* bh = 0 - ®â®¡à ¦ âì ¢ ¤¥áïâ¨ç­®© á¨á⥬¥ áç¨á«¥­¨ï * bh = 0 - ®â®¡à ¦ âì ¢ ¤¥áïâ¨ç­®© á¨á⥬¥ áç¨á«¥­¨ï
* bh = 1 - ®â®¡à ¦ âì ¢ è¥áâ­ ¤æ â¥à¨ç­®© á¨á⥬¥ * bh = 1 - ®â®¡à ¦ âì ¢ è¥áâ­ ¤æ â¥à¨ç­®© á¨á⥬¥
* bh = 2 - ®â®¡à ¦ âì ¢ ¤¢®¨ç­®© á¨á⥬¥ * bh = 2 - ®â®¡à ¦ âì ¢ ¤¢®¨ç­®© á¨á⥬¥
* ¡¨âë 16-21 = ᪮«ìª® æ¨äà ®â®¡à ¦ âì * ¡¨âë 16-21 = ᪮«ìª® æ¨äà ®â®¡à ¦ âì
* ¡¨âë 22-29 § à¥§¥à¢¨à®¢ ­ë ¨ ¤®«¦­ë ¡ëâì ãáâ ­®¢«¥­ë ¢ 0 * ¡¨âë 22-29 § à¥§¥à¢¨à®¢ ­ë ¨ ¤®«¦­ë ¡ëâì ãáâ ­®¢«¥­ë ¢ 0
* ‘¨β 30 - γαβ ­<C2A0>«₯­ 1, ₯᫨ βΰ₯‘γ₯βαο λ<CEBB>€ qword (64-¨β­<CEB2>£<EFBFBD>) η¨α«  * ΅¨β 30 γαβ ­®Ά«¥­ = ΆλΆ®¤¨βμ qword (64-΅¨β­®¥ η¨α«®);
* ‘¨β 31 - γαβ ­<C2A0>«₯­ 1, ₯᫨ βΰ₯‘γ₯βαο λ<CEBB>€ η¨α«  ‘₯§ ―γαβλε ­γ«₯© αβ ΰθ¨ε ΰ §ΰο€ ε ―ΰ¨ ν⮬ ¤®«¦­® ΅λβμ bl = 1
* ΅¨β 31 γαβ ­®Ά«¥­ = ­¥ ΆλΆ®¤¨βμ Ά¥¤γ騥 ­γ«¨ η¨α« 
* ecx = ç¨á«® (¯à¨ bl=0) ¨«¨ 㪠§ â¥«ì (¯à¨ bl=1) * ecx = ç¨á«® (¯à¨ bl=0) ¨«¨ 㪠§ â¥«ì (¯à¨ bl=1)
* edx = [ª®®à¤¨­ â  ¯® ®á¨ x]*65536 + [ª®®à¤¨­ â  ¯® ®á¨ y] * edx = [ª®®à¤¨­ â  ¯® ®á¨ x]*65536 + [ª®®à¤¨­ â  ¯® ®á¨ y]
* esi = 0xX0RRGGBB: * esi = 0xX0RRGGBB:
@ -4592,6 +4593,20 @@ Architecture Software Developer's Manual, Volume 3, Appendix B);
áâப¨. áâப¨.
* —⮡ë ã¡à âì § £®«®¢®ª, ¯¥à¥¤ ©â¥ NULL ¢ ecx. * —⮡ë ã¡à âì § £®«®¢®ª, ¯¥à¥¤ ©â¥ NULL ¢ ecx.
======================================================================
================ ”γ­<CEB3>ζ¨ο 72 - ―®α« βμ α®®΅ι¥­¨¥ ®<>­γ. ================
======================================================================
--- <20>®¤δγ­<CEB3>ζ¨ο 1 - ―®α« βμ α®®΅ι¥­¨¥ α ― ΰ ¬¥β஬  <>β¨Ά­®¬γ ®<>­γ. ----
<EFBFBD> ΰ ¬¥βΰλ:
* eax = 72 - ­®¬¥ΰ δγ­<CEB3>樨
* ebx = 1 - ­®¬¥ΰ ―®¤δγ­<CEB3>樨
* ecx = <20>®¤ α®΅λβ¨ο: 2 ¨«¨ 3
* edx = <20>®¤ <20>« Ά¨θ¨ ¤«ο ecx=2, ¨¤¥­β¨δ¨<CEB4> β®ΰ <20>­®―<C2AE>¨ ¤«ο ecx=3
‚®§Άΰ ι ¥¬®¥ §­ η¥­¨¥:
* eax = 0 - γα―¥θ­®
* eax = 1 - ΅γδ¥ΰ § ―®«­¥­
====================================================================== ======================================================================
========== ”ã­ªæ¨ï -1 - § ¢¥àè¨âì ¢ë¯®«­¥­¨¥ ¯®â®ª /¯à®æ¥áá  ========= ========== ”ã­ªæ¨ï -1 - § ¢¥àè¨âì ¢ë¯®«­¥­¨¥ ¯®â®ª /¯à®æ¥áá  =========
====================================================================== ======================================================================

View File

@ -2169,14 +2169,14 @@ Parameters:
* eax = 47 - function number * eax = 47 - function number
* ebx = parameters of conversion number to text: * ebx = parameters of conversion number to text:
* bl = 0 - ecx contains number * bl = 0 - ecx contains number
* bl = 1 - ecx contains pointer to dword-number, or qword-number * bl = 1 - ecx contains pointer to dword/qword-number
* bh = 0 - display in decimal number system * bh = 0 - display in decimal number system
* bh = 1 - display in hexadecimal system * bh = 1 - display in hexadecimal system
* bh = 2 - display in binary system * bh = 2 - display in binary system
* bits 16-21 = how many digits to display * bits 16-21 = how many digits to display
* bits 22-29 reserved and must be set to 0 * bits 22-29 reserved and must be set to 0
* bit 30 - set in 1, if the output of qword (64-bites) number * bit 30 set = display qword (64-bit) number (must be bl=1)
* bit 31 - set in 1, if the output of number without empty zero in high bits is required * bit 31 set = do not display leading zeroes of the number
* ecx = number (if bl=0) or pointer (if bl=1) * ecx = number (if bl=0) or pointer (if bl=1)
* edx = [coordinate on axis x]*65536 + [coordinate on axis y] * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
* esi = 0xX0RRGGBB: * esi = 0xX0RRGGBB:
@ -4547,6 +4547,20 @@ Remarks:
length, no more than 255 characters are drawn. length, no more than 255 characters are drawn.
* Pass NULL in ecx to remove caption. * Pass NULL in ecx to remove caption.
======================================================================
=============== Function 72 - send message to a window. ==============
======================================================================
- Subfunction 1 - send message with parameter to the active window. --
Parameters:
* eax = 72 - function number
* ebx = 1 - subfunction number
* ecx = event code: 2 or 3
* edx = parameter: key code for ecx=2, button identifier for ecx=3
Returned value:
* eax = 0 - success
* eax = 1 - buffer is full
====================================================================== ======================================================================
=============== Function -1 - terminate thread/process =============== =============== Function -1 - terminate thread/process ===============
====================================================================== ======================================================================

View File

@ -493,6 +493,40 @@ eventoccur:
mov [esp+36], eax mov [esp+36], eax
ret ret
sys_sendwindowmsg:
dec eax
jnz .ret
cmp ebx, 3
jz .sendbtn
cmp ebx, 2
jnz .ret
.sendkey:
pushf
cli
movzx eax, byte [KEY_COUNT]
cmp al, 120
jae .overflow
inc eax
mov [KEY_COUNT], al
mov [KEY_COUNT+eax], cl
jmp .ok
.overflow:
popf
mov dword [esp+36], 1
ret
.sendbtn:
pushf
cli
cmp byte [BTN_COUNT], 0
jnz .overflow
mov byte [BTN_COUNT], 1
mov [BTN_BUFF], ecx
.ok:
popf
and dword [esp+36], 0
.ret:
ret
get_event_for_app: get_event_for_app:
pushad pushad

View File

@ -1454,7 +1454,8 @@ normalize_number:
jne .continue jne .continue
dec eax dec eax
cmp eax,1 cmp eax,1
jne @r ja @r
mov al,1
.continue: .continue:
and eax,0x3f and eax,0x3f
ret ret

View File

@ -91,34 +91,35 @@ begin_1:
jmp begin_1.ret jmp begin_1.ret
kill_active_application: kill_active_application:
mcall 18, 7 ; mcall 18, 7
mov ecx,eax ; mov ecx,eax
;
;//{SPraid.simba do not kill panel and icon ; ;//{SPraid.simba do not kill panel and icon
push eax ; push eax
mov eax,9 ; mov eax,9
mov ebx, process_info_buffer ; mov ebx, process_info_buffer
int 0x40 ; int 0x40
mov eax,process_info_buffer ; mov eax,process_info_buffer
add eax,10 ; add eax,10
mov ebx,[eax] ; mov ebx,[eax]
cmp ebx,'ICON' ; cmp ebx,'ICON'
je no_kill ; je no_kill
cmp ebx,'@PAN' ; cmp ebx,'@PAN'
jne kill_app ; jne kill_app
add eax,4 ; add eax,4
mov ebx,[eax] ; mov ebx,[eax]
and ebx,0x0000FFFF ; and ebx,0x0000FFFF
cmp ebx,'EL' ; cmp ebx,'EL'
je no_kill ; je no_kill
kill_app: ; kill_app:
pop ecx ; pop ecx
mcall 18, 2 ; mcall 18, 2
jmp if_kill ; jmp if_kill
no_kill: ; no_kill:
pop eax ; pop eax
if_kill: ; if_kill:
;// }SPraid.simba ; ;// }SPraid.simba
mcall 72,1,3,1
jmp begin_1.ret jmp begin_1.ret