I set the OFN_NONETWORKBUTTON option in the OPENFILENAME structure, but it has no effect on the network item in the navigation pane

Raymond Chen

A customer set the OFN_NO­NETWORK­BUTTON option in the OPEN­FILE­NAME structure, but it stil shows the Network item in the navigation pane.

There are a number of flags in the OPEN­FILE­NAME structure which harken back to the old Windows 3.1-style dialog box. In Windows 3.1, the Open dialog had a button labeled Network that appeared next to the drives combo box. Clicking it let you map a new network drive. The OFN_NO­NETWORK­BUTTON flag hides that button.

But if you’re using the new Explorer-style Open dialog, there is no Network button to begin with, so there’s no button to hide.

While it’s true that there is a Network item in the navigation pane, that is not the thing that the OFN_NO­NETWORK­BUTTON flag controls. The purpose of the flag was not to hide the network; it was merely to hide the button that lets you map a new network drive. And since the Explorer-style dialog doesn’t have such a button in the first place, the flag is redundant.

There’s another flag left over from the Windows 3.1 dialog: OFN_HIDE­READ­ONLY. The original Windows 3.1 dialog had a separate check box called Read-only, but the Explorer style dialog doesn’t have that check box. Instead, the Open button is a split button, with options Open and Open as read-only. In this case, the Open dialog box was able to map the old flag to a corresponding feature in the new dialog.



Discussion is closed. Login to edit/delete existing comments.

  • W S 0

    The split-button is a Vista thing, the Windows 95 style dialog also has a checkbox control.

  • David Walker 0

    It’s *convenient* to be able to map a network drive from these dialog boxes!

    • smf 0

      Can we also have a button that launces the calculator there? I might want to do some maths when opening a file.

      • W S 0

        Hardly a relevant comparison, the Calculator can be started from the start menu in seconds while mapping a drive could be annoying if UAC/RunAs has been used on the running app and the mapped drives are not the same as your main Explorer shell.

Feedback usabilla icon