سؤال

My app uses a 3rd party DLL for image processing, which opens a file dialog to choose an image file. For continuity and usability reasons, I use a separate thread to change the dialog after it appears (change the icon and title, and remove the system menu and context help button). I also introduce my own WNDPROC to capture the button clicks, which I can re-route to my app if I choose.

I want to do some specific processing of certain image types, but I need to know when one of these has been picked. Is there a way to get hold of the full file path and pass it back to my app? (The third party file dialog is not the default Windows dialog, but seems to be based on it).

هل كانت مفيدة؟

المحلول

In my WNDPROC, after catching the IDOK WM_COMMAND message, I used SendMessage and CDM_GETFILEPATH to get what I'm after!

Edit:

Actually, it seems I'm better off catching the WM_DESTROY message - in case the user double-clicks or presses enter instead of the 'OK' button.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top