Hello all.
I have a little problem whit this code...
386p
.model flat

include exe.inc
include api.inc

extrn SetFileAttributesA:Proc
extrn GetFileAttributesA:Proc
extrn CloseHandle:Proc
extrn UnmapViewOfFile:Proc
extrn MapViewOfFile:Proc
extrn CreateFileA:Proc
extrn ExitProcess:Proc
extrn CreateFileMappingA:Proc
extrn MessageBoxA:Proc
extrn SetWindowsHookExA:Proc
extrn GetModuleHandleA:Proc
extrn CallNextHookEx:Proc


.data

sParametroArchivo db 500 dup(0)
HandleInformation BY_HANDLE_FILE_INFORMATION ?
hProcessHandle dd 0
hHookHandle dd 0
marca db 'MARCA - 123456'


.code

inicio:
push 0
call GetModuleHandleA
mov dword ptr hProcessHandle, eax


push 0
push eax
lea eax, eHandler
push eax
push 2
call SetWindowsHookExA

mov dword ptr hHookHandle, eax

push 0
call ExitProcess


eHandler:

???????????????????????????????????????????????
Why dosent the prog. ever gets here ?
???????????????????????????????????????????????

mov dword ptr marca, "TEST"

push edi
push esi
push ebx
mov eax, dword ptr hHookHandle
push eax
call CallNextHookEx


end inicio


HELP! ;)
Posted on 2002-03-22 20:39:40 by leaedx2002
i believe your problem lies here, though i'm not sure, myself...


call SetWindowsHookExA

mov dword ptr hHookHandle, eax

push 0
call ExitProcess

eHandler:
...


but i think your program needs to keep looping and dispatching messages before it has a chance to exit. btw, don't forget to unhook before your app quits!

btw, welcome! (me=newbie,too)
Posted on 2002-03-22 21:13:04 by jademtech
But, muy probles is: the new api handler is neves
executed ! Why ???
SetWindowsHookExA ending whith no errors.
Posted on 2002-03-22 22:09:12 by leaedx2002