CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2008
    Posts
    19

    Question [SLOVED] How to manager opendialog to Programs patch ?

    Hi all...!
    I'm working with OpenFileDialog and just have a question.
    Some on here know how to manager OpenFileDialog autostart to Dir "\ProgramData\Microsoft\Windows\Start Menu\Programs" of Windows hard disk ?
    Please tell me how to do it

    Thanks a lot..!
    Last edited by tom_codon; March 25th, 2009 at 03:38 AM. Reason: [SLOVED] How to manager opendialog to Programs patch ?

  2. #2
    Join Date
    Jun 2008
    Posts
    2,477

    Re: How to manager opendialog ?

    Set the InitialDirectory property. MSDN is your friend

  3. #3
    Join Date
    May 2007
    Posts
    811

    Re: How to manager opendialog ?

    Have you read the docs? In case your Google foo is week here is a direct link to appropriate field you need to set.

  4. #4
    Join Date
    Nov 2008
    Posts
    19

    Re: How to manager opendialog ?

    Thanks BigEd781,STLDude for answer.!
    I already read it but in my computer windows system in H: Disk , other computer in C: , D: ....
    So how i can manager it to right Windows disk ?

    My computer now , files i need in "H:\ProgramData\Microsoft\Windows\Start Menu\Programs"
    I can set it , but other ?

    How can set it always go to "\ProgramData\Microsoft\Windows\Start Menu\Programs" on Windows disk ?

    Thanks again..!

  5. #5
    Join Date
    May 2007
    Posts
    811

    Re: How to manager opendialog ?

    You do need to get your Google foo in order, all this information is readily available. Here it's a start and this page lists all possible Folders you can get path to it.

  6. #6
    Join Date
    Nov 2008
    Posts
    19

    Re: How to manager opendialog ?

    Problem sloved!

    here my code :

    string sResult = "";
    string sStatup = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\Microsoft\Windows\Start Menu\Programs";

    OpenFileDialog filedlg = new OpenFileDialog();
    filedlg.InitialDirectory = sStatup;
    if (filedlg.ShowDialog() == DialogResult.OK)
    sResult = filedlg.FileName;

    Again thanks BigEd781,STLDude for help!

    Tom.
    Last edited by tom_codon; March 25th, 2009 at 03:36 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured