I can't find it anywhere. And if you don't have it, how do you
override WndProc? Don't you need the window messages?
I don't know what windows.h has to do with overriding WndProc. C#
doesn't use include files; the information is in referenced assemblies.
You can override things just fine without windows.h.
As far as overriding WndProc goes, in most cases you should not need to
write an override for that method, but if you do need to, you do it just
like you'd override any other method in a class: simply write the
override into your derived class, making sure that the method signature
is exactly the same as the method you are overriding (and of course,
includes the keyword "override") .
On Aug 2, 10:32 pm, Dom <dolivas...@gma il.comwrote:
I can't find it anywhere. And if you don't have it, how do you
override WndProc? Don't you need the window messages?
>
Dom
I guess I was being a little to coy. I know that C# does not have
".h" files, I meant, "what does it use instead." In particular, I
wanted to know how to get the message codes.
In C++, when you write a Wndproc, you need the message codes. You
always write a long switch statement, in which you case out the
messages you want to handle, such as WM_RBUTTONDOWN. For example, you
might write:
switch (msg)
case WM_RBUTTONDOWN:
Button1_Click (hwnd, msg, wParam, lParam);
break;
and so on. I assumed WM_???? was defined somewhere in C#.
If I am fundamentally mistaken, and Arne's articles will set me
straight, then don't bother answering.
On Aug 2, 10:32 pm, Dom <dolivas...@gma il.comwrote:
I can't find it anywhere. And if you don't have it, how do you
override WndProc? Don't you need the window messages?
>
Dom
I guess I was being a little to coy. I know that C# does not have
".h" files, I meant, "what does it use instead." In particular, I
wanted to know how to get the message codes.
In C++, when you write a Wndproc, you need the message codes. You
always write a long switch statement, in which you case out the
messages you want to handle, such as WM_RBUTTONDOWN. For example, you
might write:
switch (msg)
case WM_RBUTTONDOWN:
Button1_Click (hwnd, msg, wParam, lParam);
break;
and so on. I assumed WM_???? was defined somewhere in C#.
If I am fundamentally mistaken, and Arne's articles will set me
straight, then don't bother answering.
I guess I was being a little to coy. I know that C# does not have
".h" files, I meant, "what does it use instead." In particular, I
wanted to know how to get the message codes.
I recommend that you always do your best to ask the question you
actually want an answer for.
In C++, when you write a Wndproc, you need the message codes. You
always write a long switch statement, in which you case out the
messages you want to handle, such as WM_RBUTTONDOWN. For example, you
might write:
>
switch (msg)
case WM_RBUTTONDOWN:
Button1_Click (hwnd, msg, wParam, lParam);
break;
>
and so on. I assumed WM_???? was defined somewhere in C#.
Sorry to say, it's not. You have to declare the constants yourself,
based on the values that are in the various Windows SDK include files.
Kind of annoying, IMHO.
On Aug 2, 10:32 pm, Dom <dolivas...@gma il.comwrote:
>
I can't find it anywhere. And if you don't have it, how do you
override WndProc? Don't you need the window messages?
>
Dom
>
I guess I was being a little to coy. I know that C# does not have
".h" files, I meant, "what does it use instead." In particular, I
wanted to know how to get the message codes.
>
In C++, when you write a Wndproc, you need the message codes. You
always write a long switch statement, in which you case out the
messages you want to handle, such as WM_RBUTTONDOWN. For example, you
might write:
>
switch (msg)
case WM_RBUTTONDOWN:
Button1_Click (hwnd, msg, wParam, lParam);
break;
>
and so on. I assumed WM_???? was defined somewhere in C#.
>
If I am fundamentally mistaken, and Arne's articles will set me
straight, then don't bother answering.
>
Dom
Hi, take a look at http://www.pinvoke.net/ which will list everything
you need in easy to copy and paste format. Hmm, just noticed they've
got a VS add in as well now. Not played with that, but looks
interesting :)
Comment