After a file is associated with an application, how does a program know that it
was called by the association and not by double clicking on it.

What i want to know is it i double click on a .dat file and it is associated with myprog.exe how does myprog.exe know that foobar.dat was double clicked and how does myprog.exe populate a (i.e.) List Box with the info from foobar.dat?

Thanks