I've got a common Open dialog with a callback function for it. The callback looks like this:
UINT CALLBACK CFind_Replace::ofnHook(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
There is a lCustData member in the OPENFILENAME struct that I've read, is supposed to be passed to your callback function in the lParam of the WM_INITDIALOG message. I've checked the parameter that I get and it's not the same as the value that I put in lCustData.
One more question is that HWND parameter in the callback.
What window is it a handle to? I've gotten a valid window pointer from it and done all sorts of things to the window that the pointer points to and it doesn't seem to be the dialog (or any other window).