Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CommonDialog Hook

Status
Not open for further replies.

wanmaster

Programmer
Nov 20, 2000
94
NL
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top