I need to find out where WM_SETFOCUS is defined. For instance, I know it isn't System.Windows.Forms.WM_SETFOCUS
I've looked online, and everything seems to just use the name with no mention of how to let your compiler know the name.
I DO know the integer value it represents, but I really want to reference an authoritative assembly, and not just litter my code with constants.
I am using the value in a class which implements IMessageFilter.
ADDED DETAILS:
Using IMessageFilter, I am getting messages, and the messages have a Msg field (in开发者_JAVA技巧t) which identifies its type. Where can I find C# definitions of those integer values? (I don't need one named WM_SETFOCUS, I just need something with all the definitions of the values I am receiving.) Since Microsoft supplies IMessageFilter, shouldn't they also supply the information needed to make it useful?
It would seem to be defined in System.Windows.Forms.NativeMethods.WM_SETFOCUS
(Which, unfortunately is an internal class). It's also defined in Microsoft.VisualStudio.NativeMethods.WM_SETFOCUS
If you're worried about littering your code with native methods, I would do as the framework does and create an internal NativeMethods
static class, and dump everything interop-related in it. At least you can keep it all in one place.
精彩评论