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

  • SEARCH
  • Home
  • 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 135923
In Process

The Archive Base Latest Questions

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

Question: Does anyone know how to change the current directory of an already running

  • 0

Question:

Does anyone know how to change the current directory of an already running open file dialog?

Details:

I have a customized open file dialog (using a custom template to add extra controls) that also has all the validation, existing checks, and creation tests turned off (via the OpenFileName flags).

Turning those things off disables the built-in behavior of the dialog that will cause it to change the currently displayed folder if the user types a folder name into the ‘file name’ combo box and hits the enter key.

I would like to add that behavior back. I can detect when this happens via the hook procedure. I’ve hidden the OK button, turned off it’s accelerator, and put my own ‘select’ button on the control. This means that the only time I get a CDN_FILEOK message is when the user hits enter in the text box after typing.

I can’t, however, figure out how to programatically tell the dialog to change the current directory.

I was thinking that I might be able to accomplish this by sending some sort of a message to the SHELLDLL_DefView control in the window, but I haven’t been able to find any documentation on it.

  • 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. 2026-05-11T06:52:02+00:00Added an answer on May 11, 2026 at 6:52 am

    I was able to figure out a work around.

    It turns out that when validation is turned off, typing in a directory name that ends in a ‘\’ will still change the folder being displayed, but typing in a directory name that does not end in a ‘\’ will not.

    Using spy++ I was able to see that when enter is hit a WM_COMMAND message will be sent to the common dialog control with a wParam argument whose hi-order word is BN_CLICKED and whose low order word is ID_OK.

    If I subclass the common dialog I can intercept the message, change the text in the file name combo box, forward the message through to original subclass procedure, and then change the text back afterwards.

    It’s a little bit of hack, but it enables me to get the behavior I want from the dialog.

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

Sidebar

Related Questions

Does anyone know of any publicly available Question answering applications which have built using
I know this is kind of a dumb question, but does anyone have an
From another question in Change HTML output of Zend_Form does anyone know how I
My question in a nutshell: Does anyone know of a TwitterAnalyzer or TwitterTokenizer for
Does anyone know if Python's shelve module uses memory-mapped IO? Maybe that question is
Question says it all. Does anyone know if the following... size_t div(size_t value) {
Just a quick question, does anyone know if there are restrictions on creating Performance
Bit of a bizarre question, but does anyone know the actual limit to the
Question: I receive the following error for the code below, does anyone know why?
Apologies for the non-programming question, but does anyone know how to get Visual Studio

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.