I have a parent class with some imported methods like this:
class Parent
{
[DllImport("user32.dll")]
public static extern IntPtr GetForegroundWindow();
}
Then I have another class that inherits from this Parent class
class Child : Parent
{
GetForegroundWindow(); // intellisense cannot find it
}
Does that mean I have to create a wrapper method around the imported GetForegroundWindow() method in the parent class in order to inherit and use it in the child class?
Place GetForegroundWindow call inside of some class method, and not directly in the class.
class Child : Parent { void Foo() { GetForegroundWindow(); } }