6

Is it possible to have a C# DLL open a message box? Like in a WinForm:

MessageBox.Show("Message");

I relise that DLL's can't be executed directly but what if it were to be injected into a process to be run, then it could show the message box (if it's possible).

Justin
  • 84,773
  • 49
  • 224
  • 367
Bali C
  • 30,582
  • 35
  • 123
  • 152
  • Do you specifically want to use System.Windows.Forms, or do you want it to be a interface IMessageBox and you inject an implementation when you use the Dll? – Meirion Hughes Mar 11 '13 at 16:56

1 Answers1

11

Step1: Click on Add Reference. Under .NET, Select System.Windows.Forms and click ok!

Step2: use namespace using System.Windows.Forms;

Rookie Programmer Aravind
  • 11,952
  • 23
  • 81
  • 114