I need to be able to place a win32 message hook (WH_GETMESSAGE vis-a-vis GetMsgProc) using SetWindowsHookEx from C#. Of course you cannot dllexport from C#, so the solution will probably involve a small C++ DLL to dllexport the win32 callback function. The hook is not global; it is defined on a specific thread _in another process_. This means that the DLL will be injected into the other process' address space. I am not sure how the callback will work to the C# code since it will have to work across address spaces. The DLL injection should not cause the .NET CLR to be loaded in the other process's address space. The C# client should be able to specify filters on the HWND and/or message types, so that only those messages should be passed up by the C++ callback function. Your code should intelligently manage multiple hook filters, so if I call Hook(Thread = 1, MessageType = 0) and Hook(Thread = 1, MessageType = 1) then the second call shouldn't require any additional DLL injection or win32 calls. All filtering should be done in the win32 callback, i.e. in the injected DLL. It should not be done in C#. The C# code should be able to modify the messages. For example, if the message is WM_SIZE then the C# code might change the lParam before the message is passed down the chain. I realize that wParam and lParam are often pointers to somewhere in the other process's address space, so they are not useful for some message types. There is one of these cases that I am especially interested in -- WM_WINDOWPOSCHANGING. The C# code should be able to place a special hook for WM_WINDOWPOSCHANGING messages. When they occur the C# callback should be provided with all of the WINDOWPOS information, and should be given a chance to modify that information. Of course, an UnhookWindowsHookEx wrapper should be provided. See also: [login to view URL] [login to view URL]
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):
a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.
b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.
3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).
## Platform
See description above.