custom event handling

XxBartmanxX

Member
Joined
Dec 8, 2003
Messages
10
Location
Oregon
Hey,

I dont know how many of you are familiar with C++ and Win32 programming, but here is what I would like to do in C#.

I need to write my own event handler, much like you would write a message loop in C++.

Bascially, I want to be able to handle every event fired off myself.

For example, this is similar to what it would look like in C++.

Code:
...
switch(msg)
{
     case WM_RMCLICK:
          ...
          break;
     case WM_MINIMIZE:
          ...
          break;
     case WM_QUIT:
          ...
          break;
     default:
          ...
          break;
}
...

Take note that the ellipses are there as place holders for code :)

Hopefully what I need to do is possible in C#, and hopefully you understand what I tried to explain.

Thanks
 
The method of handling events is much more robust than this in
C# and other .NET languages. I suggest you read up on
[mshelp=ms-help://MS.MSDNQTR.2003FEB.1033/cpguide/html/cpconevents.htm]events and delegates[/mshelp].
 
If you really want to write your own message loop, theres nothing to stop you using the standard api functions to do this. Just declare the functions using platform invoke in the normal way.
 
Back
Top