I'm trying to put a picturebox on a commondialog (using SetParent(), and MoveWindow() to resize) that will display an image if the file selected is a picture (bitmap, jpeg etc.). So I need to know the name of the selected file, before the dialog box closes.
I'm trying to set a message hook on the commondialog box.
I'm using the GetOpenFileName() api function. One of the members of the OPENFILENAME structure (used as a parameter in that function) is called lpfnHook. I guess that's the pointer to the hook function (OFNHookProc()).
But it all still doesn't work. I'm also wondering how to end the hook-function in order to restore the dialog's procedure (or maybe that isn't necessary?).
Has anyone done this before?
Any suggestion or tip is appreciated..
Remedy
I'm trying to set a message hook on the commondialog box.
I'm using the GetOpenFileName() api function. One of the members of the OPENFILENAME structure (used as a parameter in that function) is called lpfnHook. I guess that's the pointer to the hook function (OFNHookProc()).
But it all still doesn't work. I'm also wondering how to end the hook-function in order to restore the dialog's procedure (or maybe that isn't necessary?).
Has anyone done this before?
Any suggestion or tip is appreciated..
Remedy