Didn't mean to leave you hanging. I went out of town for a few days.
What is the deal with that if statement. Why are you typecasting the lparam to a HWND. It appears that your problem is with the if statement. I am assuming based on your code that EDIT_FILE is the resource name for the edit control on the dialog (rigt click the edit box control, and select properties to get the name).
That being the case. GetDlgCtrlID will return the resource id (int) when you pass the hwnd of the object. What your code is telling me is that (HWND)lPAram is the hwnd to the editbox. If you already had the hwnd to the edit box you would not have this problem.
It appears to me, that All you have from the edit box is the resource ID not the hwnd. That is what you are trying to get. That being the case:
1) Remove the if statement. You don't need it.
2) I am making an assumption that hwnd is the handle to the dialog window, and EDIT_FILEs is the resource ID name for the edit box.
That being the case, the code should work. Let me know if it doesn't. Good luck!