Try the attached Previous Instance Command Line Passing Demo. It uses a locked file in lieu of a Mutex object.
To run the demo, compile the project and then open the first instance. Afterwards, you can minimize the form and see what happens when you drag and drop any number of files onto the exe's icon.
If you would like an example that utilizes DDE instead, then see Karl E. Peterson's PrevInst.
Last edited by Bonnie West; Aug 27th, 2013 at 11:58 AM.
Reason: Added usage instructions
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0