I realise this might be hard to explain, so let me start by using an example from Windows; keBugCheckEx().
How would I go about making a method that is contained within one program but, when executed from another, affect the program it is in. For example, in the main program, you could have:
public static void Panic(uint errCode)
{
System.Windows.MessageBox.Show("Function Panic() was called with error code: "
+ errCode);
Application.Exit();
}
And then, in the second program, you could call that method, e.g.
public static void Main(string[] args)
{
Foo.Panic(0x3C);
}
How would I go about making it so that, instead of the MessageBox showing in the second program, it appears in the first program? Sorry if this is not very well explained.