When writing a client app in Winforms, I came across this question about placing a button within a text box without it interfering with the view of the textbox itself.
In that answer, I noticed the extern modifier, which I hadn't seen in code before.
From MSDN:
"The extern modifier is used to declare a method that is implemented externally. A common use of the extern modifier is with the DllImport attribute when you are using Interop services to call into unmanaged code."
Which is exactly how I'm seeing it used in the related question. I don't understand why it would be necessary to call a user32 external function for this, but that should probably be asked in a separate question.
So my question is, when would extern be the modifier I should use? Why is it better than simply adding the dll to your references and using it directly?