[Mono-list] Developer Express on Linux

Paul Johnson paul at all-the-johnsons.co.uk
Wed Aug 3 04:24:06 EDT 2011


Hi,

2011/8/3 Hamit Abdullah SARMIŞ (Uygulama Geliştirme Altyapı Müdürlüğü) <
HamitAbdullah.SARMIS at vakifbank.com.tr>

>  Thanks for your replies.****
>
> We also consider using wine but, our applications need to be .net framework
> 4 which is not supported by wine (According to winehq).****
>
> On the other hand, I don't need all functionalities of kernel32.dll or
> user32.dll.****
>
> I know the actual code causing the problem (As developer express can be
> disassembled):****
>
> ** **
>
>      [DllImport("USER32.dll", CharSet = CharSet.Auto)]****
>
>     protected static IntPtr SetWindowsHookEx(int idHook, Hook lpfn, inthMod,
> int dwThreadId);****
>
> ** **
>
>     [DllImport("USER32.dll", CharSet = CharSet.Auto)]****
>
>     protected static int CallNextHookEx(IntPtr hhk, int nCode, IntPtr
> wParam, IntPtr lParam);****
>
> ** **
>
>     [DllImport("USER32.dll", CharSet = CharSet.Auto)]****
>
>     protected static bool UnhookWindowsHookEx(IntPtr hhk);****
>
> ** **
>
>     [DllImport("kernel32.dll")]****
>
>     public int GetCurrentThreadId();****
>
> ** **
>
> Can I find any Linux library implementing these methods and map them to
> kernel32.dll and user32.dll to provide DevEx what it needs?****
>
> The thread one can be substituted with standard threading. SetWindowHookEx
(as stated at
http://msdn.microsoft.com/en-us/library/ms644990%28v=vs.85%29.aspx) installs
a hook procedure into a hook chain. The other calls are similar in that they
call the next hook in the chain and remove the hook.

http://support.microsoft.com/kb/318804 makes things clear. The only real
swines are the low level WH_MOUSE_LL and WH_KEYBOARD_LL stuff which isn't
supported under .NET

Effectively in .NET land rather thank USER32 land

1. Create a class containing whatever you need
2. Create an instance of the class wherever you need it - remember to put it
in a try/catch (creates the hook)
3. Add a method in (1) to do what you need it to do

As for the unhook, in C++, it would be simple - delete. In C# either use the
garbage collector methods or Finalize as part of the try/catch set up.

Not sure about the CallNextHookEx - it calls the next hook in the chain.

HTH

PFJ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20110803/f6e08f1f/attachment.html 


More information about the Mono-list mailing list