Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 221329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:01:23+00:00 2026-05-11T19:01:23+00:00

Is there a way to modify the behavior of the OpenFileDialog so that it

  • 0

Is there a way to modify the behavior of the OpenFileDialog so that it looks inside the files in the folder it opens to and then ignores certain ones based on their content?

One example would be to open to a folder full of Zip files but only show the ones that contain a certain file.

From the documentation, there’s the HookProc but I’m not exactly sure how I’d use it.

Please note that if it is possible, I realize that it’ll be a relatively slow operation. At the moment I’m not concerned about performance.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T19:01:24+00:00Added an answer on May 11, 2026 at 7:01 pm

    I wouldn’t dismiss the complexity of the OpenFileDialog. It’s not so easy to build one that really works. When you do build your own, it’s not the “normal” dialog and as a result it confuses users. This is true even if you do it well, which is difficult. So I’d suggest you stick to extending what is already there, rather than writing something new.

    Check this article for an extension of OFD that might/could be tweaked to do exactly what you want. There’s a callback that you write in C# that responds to path selection.

    Related: FolderBrowserDialogEx is a similar extension on FolderBrowserDialog. Despite the name, you can configure it to search for files, as well as folders. There’s a callback that gets invoked when something (a folder, a file) is selected, and within that callback you can do what you need to do. For example, peek inside the files within a folder and populate the list of files to display with only those files.


    Another option you might consider is the dialog library from Ookii. This is an open source implementation of the OpenFileDialog, and it includes COM wrappers for all the new dialog stuff in Vista. Using that library you can pop a Vista OpenFileDialog and receive events from the IFileDialogEvents interface, in C# code. One such event is OnFolderChange(). Within the handler you could call IFolder.GetFolder() which will get you an IShellItem, which gives you the folder the user is changing to. The next step would be to itemize and potentially filter the set of files, which is an exercise I will leave to the reader…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to modify or set-header of request inside action class? I
Is there a way to modify/tell dired to copy files asynchronously? If you mark
Is there an easy way to modify this code so that the target URL
In git, is there any (simple) way to modify the index so that only
Is there a way to modify existing .NET assemblies without resorting to 3rd party
Is there any way to modify the bound value of one of the variables
Is there any way to modify the CSS properties of one table's cells based
In the following code, is there a way to modify the contents of a
is there a simple way to modify the InnerXml of a XElement? supose we
Is there an easy-ish way to modify the webform-form-tpl.php template to show disclaimer text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.