get_HideVirtualFileFromFileDialog
Description
Retrieves a value that indicates whether virtual files are hidden from standard Windows file dialogs (such as Open File and Save As).
If this function returns VARIANT_TRUE, virtual files will not appear in these dialogs, even though they exist in the virtual file system.
This feature is useful when you want to make virtual resources accessible only programmatically, not through user-facing interfaces.
Syntax
HRESULT get_HideVirtualFileFromFileDialog([out, retval] VARIANT_BOOL* pbValue);Parameters
pbValue
Type: VARIANT_BOOL*
[out, retval] Receives VARIANT_TRUE if the packed executable hides virtual files from system file dialogs, or VARIANT_FALSE if they are visible.
Return Value
Returns an HRESULT.
S_OKif the value was successfully retrieved.E_POINTERifpbValueis null.- Other standard COM error codes on failure.
Example
CComPtr<IBxProject> project;
if (SUCCEEDED(BxPackerApi_CreateProject(&project))) {
VARIANT_BOOL bHide = VARIANT_FALSE;
if (SUCCEEDED(project->get_HideVirtualFileFromFileDialog(&bHide))) {
wprintf(L"Hide virtual files from file dialogs: %s\n", bHide == VARIANT_TRUE ? L"Enabled" : L"Disabled");
}
}Remarks
- When enabled, this setting prevents virtual files from appearing in any standard file dialog windows opened by the packed application.
- It does not prevent the program itself from accessing virtual files programmatically using WinAPI functions such as
CreateFileorFindFirstFile. - This helps maintain security and prevents users from accidentally interacting with or exposing internal virtual resources.
- You can change this behavior using the corresponding
put_HideVirtualFileFromFileDialogmethod.