From: Heesob Park Date: 2009-09-12T19:35:46+09:00 Subject: Re: win32api hook Hi, 2009/9/12 Roomu Tessi : > 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