Windows Develop Bookmark and Share   
 index > Windows Forms General > Input redirection / Inconsistence between SPY++ messages / DefWndProc messages
 

Input redirection / Inconsistence between SPY++ messages / DefWndProc messages

At my company we are developing an canvas that will be used to visually create data synchronization business rules.

What I am trying to achieve is the ability to use WinForms controls within the CanvasItems. In the current prototype I composite the canvas myself by rendering the controls using DrawToBitmap and use the composite engine to nicely layout/overlay/draw lines between items, etc etc. (also think about things like rubberband selection).

Graphically we achieve great flexibility by the indirect rendering however I am fighting with input redirection.

Not only do I want to redirect the input on the canvas to the right control within the canvasitem, I also want the ability to 'transform' inputs. (think about rotated controls). This works fine for things like mouse-over. (I am transforming and after that PostMessage mousemoves translated to NCHITTESTs, and such) however it fails for things like mouse clicks on a button.



I am not fishing for a complete solution, I am fishing for any information that could help me to understand in depth the message handling of window controls. For example I see different messages between SPY++ and an DefWndProc override within a control that inheretences from a button. (I am really interested in the story behind this).



Any help, any pointers on this issue will help me.

Thanks a lot in advance.
Synap  Tuesday, September 23, 2008 3:54 PM
You should override WndProc, not DefWndProc. The latter is only used when a control didn't have any use for a message and default processing should be done. You'd miss the interesting ones.
nobugz  Tuesday, September 23, 2008 8:58 PM
Thanks, that helps a lot already! I also found an very interesting article:
http://msdn.microsoft.com/nl-nl/magazine/cc163617(en-us).aspx

I am still not getting clicks events though, will have to dig into that deeper.


Synap  Wednesday, September 24, 2008 2:32 PM
You should override WndProc, not DefWndProc. The latter is only used when a control didn't have any use for a message and default processing should be done. You'd miss the interesting ones.
nobugz  Tuesday, September 23, 2008 8:58 PM
Thanks, that helps a lot already! I also found an very interesting article:
http://msdn.microsoft.com/nl-nl/magazine/cc163617(en-us).aspx

I am still not getting clicks events though, will have to dig into that deeper.


Synap  Wednesday, September 24, 2008 2:32 PM

You can use google to search for other answers

Custom Search

More Threads

• How to Secure Connection Strings using DataProtectionConfigurationProvider or RSAProtectedConfigurationProvider?
• [C#] DataGridView AllowUserToOrderColumns
• Typing in a ListView with check boxes causes beeps or unwanted checks
• Windows XP-like Controls for VB .Net
• put a file into a Richtextbox
• getting innerhtml text from a webpage iput type=password
• richtextbox that behaves like CMD window (C#)
• open calculator
• howto Add columns to a DATAGRID control in webforms?
• Non True-type font display issue