OFN_ENABLEHOOK changes the look of GetOpenFileName ()

Why OFN_ENABLEHOOK adding a hook procedure (with the OFN_ENABLEHOOK and OFN_EXPLORER ) to GetOpenFileName () cause another dialog box to appear in Windows 7 if the hook procedure simply returns FALSE without doing anything?


Update:

Obviously, getting Vista / Windows 7 with a hook is not possible ... can anyone confirm or come across this?

+2
source share
1 answer

The reason for this is that MS has completely redesigned the file dialogs for Vista. Hooks are used to expand the file dialog box by supplying a resource file. This gives the customizable too much power. They can change the standard dialogue elements too easily, and indeed, many applications have done so. Reorganizing dialogs would break many applications that used hooks. Those would try to manipulate dialogue elements that were not there, or were implemented in different ways. Outdated versions of dialogs remain for such "insert your hooks" applications.

You are right that when using a hook it is impossible to get a new look. Instead, you need to configure the IFileDialogCustomize interface to customize the dialog. This is less effective, but leads to appearance and behavior that are more consistent with the standard part of the dialogue.

+5
source

Source: https://habr.com/ru/post/886329/


All Articles