Win32api hook

So i just got into win32api stuff and i would like to make a (c++)dll to
join in a process. I got some code here but i dont know much about
win32api & params


require ‘win32api’

hook = Win32API.new(‘user32’,‘SetWindowsHookEx’, [’’], ‘’)
library = Win32API.new(‘kernel32’,‘LoadLibrary’, [’’], ‘’)
procadr = Win32API.new(‘kernel32’,‘GetProcAddress’, [’’], ‘’)

lcall = library.call(‘mylibrary.dll’)
pcall = procadr.call(lcall, ‘funcname’)

hook.call(‘WH_MSGFILTER’,pcall,lcall,0)

Any help?

Hi,

2009/9/12 Roomu T. [email protected]:

procadr = Win32API.new(‘kernel32’,‘GetProcAddress’, [’’], ‘’)

lcall = library.call(‘mylibrary.dll’)
pcall = procadr.call(lcall, ‘funcname’)

hook.call(‘WH_MSGFILTER’,pcall,lcall,0)

Any help?
Here is a modified code:


require ‘Win32API’

WH_MSGFILTER = -1
hook = Win32API.new(‘user32’,‘SetWindowsHookEx’, ‘ILLL’, ‘L’)
library = Win32API.new(‘kernel32’,‘LoadLibrary’, ‘P’, ‘L’)
procadr = Win32API.new(‘kernel32’,‘GetProcAddress’, ‘LP’, ‘L’)

lcall = library.call(‘mylibrary.dll’)
pcall = procadr.call(lcall, ‘funcname’)

hook.call(WH_MSGFILTER,pcall,lcall,0)

Regards,

Park H.

Thanks!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs