Is it possible to specify a function with both extern and override modifiers?

Posted by Jeffrey Greenham on Stack Overflow See other posts from Stack Overflow or by Jeffrey Greenham
Published on 2011-03-11T00:07:47Z Indexed on 2011/03/11 0:10 UTC
Read the original article Hit count: 190

Filed under:
|
|

I'm trying to override the behavior of an external function in user32.dll because I don't want a certain window to show up.

What I'm trying to do is this:

    [DllImport("user32.dll")]
    public extern override IntPtr GetSystemMenu(IntPtr hMenu, bool bRevert)
    {
        return new IntPtr();
    }

but this won't work because I get the following errors:

... no suitable method found to override

and

... cannot be extern and declare a body

Is there any way to simulate what I'm trying to do?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET