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?
--
Posted via http://www.ruby-forum.com/.

Hi,

···

2009/9/12 Roomu Tessi <beaf_et@luukku.com>:

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?

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 Heesob

Thanks!

···

--
Posted via http://www.ruby-forum.com/.