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

Raymond

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.

 

Raymond Chen
Raymond Chen

Follow Raymond   

4 Comments
skSdnW
W S 2019-07-05 09:44:21
The split-button is a Vista thing, the Windows 95 style dialog also has a checkbox control.
Avatar
David Walker 2019-07-06 15:12:49
It's *convenient* to be able to map a network drive from these dialog boxes!