Thread: Getting rid of the four shortcuts on the left side of the Save/Open Dialog Box

  1. #1
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342

    Question Getting rid of the four shortcuts on the left side of the Save/Open Dialog Box

    What kind of Flag do I have to use to get rid of those four gray buttons on the left of the Save/Open Dialog box? They are shortcut buttons labled as, "History", "Desktop", "My Computer", and "My Network Places". I have seen other programs get rid of it, so I know it's possible. Thanks in advance, August

  2. #2
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    Something tells me that I either asked a very easy question or a very hard question.

  3. #3
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    Which one is it?

  4. #4
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,820
    Um,
    It's called not bumping your own threads
    Woop?

  5. #5
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    Exactly what do you mean by "bumping your own threads"?
    I don't understand it, nor have I ever heard of it.

  6. #6
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    I think what I am refering to is called a Placebar.

  7. #7
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    Normally, this would be the part where I post a very convenient link into MSDN.

    gg

  8. #8
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    I seached MSDN and Google, I didn't find anything.

  9. #9
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    it should be enough if you add a value NoPlacesBar to this key...

    HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Policies\Comdlg32
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  10. #10
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    Exactly what do you mean by "bumping your own threads"?
    I don't understand it, nor have I ever heard of it.
    Then obviously, nor have you read the forum rules.

    http://cboard.cprogramming.com/annou...ouncementid=51

    Bumping your own threads means posting in a thread just to 'bump' it back up to the top of the list. Considering the number of pointless posts you've put in your own thread at fairly regular intervals, I would say you've been bumping, and seriously, stop it.

  11. #11
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Quote Originally Posted by Stoned_Coder
    it should be enough if you add a value NoPlacesBar to this key...

    HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Policies\Comdlg32
    I believe that's a global setting. There is a couple of instance specific options:
    Code:
    #define _WIN32_WINNT 0x0500
    #include <windows.h>
    #include <stdio.h>
    #pragma comment(lib, "comdlg32.lib")
    
    /*
     * Control, with places bar.
     */
    BOOL DoFileOpen(HWND hwnd, LPTSTR szFile, DWORD cchFile)
    {
    	OPENFILENAME ofn = { 0 };
    
    	if (cchFile != 0)
    	{
    		szFile[0] = TEXT('\0');
    	}
    
    	ofn.lStructSize    = OPENFILENAME_SIZE_VERSION_400;
    	ofn.hwndOwner      = hwnd;
    	ofn.lpstrFilter    = TEXT("All Files (*.*)\0*.*\0");
    	ofn.lpstrFile      = szFile;
    	ofn.nMaxFile       = cchFile;
    	ofn.Flags          = OFN_EXPLORER | OFN_FILEMUSTEXIST;
    	ofn.lpstrDefExt    = NULL;
    
    	return GetOpenFileName(&ofn);
    }
    
    
    /*
     * No places bar, should work on all versions of Windows.
     */
    BOOL DoFileOpenNoPlaces1(HWND hwnd, LPTSTR szFile, DWORD cchFile)
    {
    	OPENFILENAME ofn = { 0 };
    
    	if (cchFile != 0)
    	{
    		szFile[0] = TEXT('\0');
    	}
    
    	ofn.lStructSize    = OPENFILENAME_SIZE_VERSION_400;
    	ofn.hwndOwner      = hwnd;
    	ofn.lpstrFilter    = TEXT("All Files (*.*)\0*.*\0");
    	ofn.lpstrFile      = szFile;
    	ofn.nMaxFile       = cchFile;
    	ofn.Flags          = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_ENABLEHOOK;
    	ofn.lpstrDefExt    = NULL;
    
    	return GetOpenFileName(&ofn);
    }
    
    
    /*
     * No places bar, will only work on 2000/XP
     */
    BOOL DoFileOpenNoPlaces2(HWND hwnd, LPTSTR szFile, DWORD cchFile)
    {
    	OPENFILENAME ofn = { 0 };
    
    	if (cchFile != 0)
    	{
    		szFile[0] = TEXT('\0');
    	}
    
    	ofn.lStructSize    = sizeof(OPENFILENAME);
    	ofn.hwndOwner      = hwnd;
    	ofn.lpstrFilter    = TEXT("All Files (*.*)\0*.*\0");
    	ofn.lpstrFile      = szFile;
    	ofn.nMaxFile       = cchFile;
    	ofn.Flags          = OFN_EXPLORER | OFN_FILEMUSTEXIST;
    	ofn.lpstrDefExt    = NULL;
    	ofn.FlagsEx        = OFN_EX_NOPLACESBAR;
    
    	return GetOpenFileName(&ofn);
    }
    
    
    int main(void)
    {
    	TCHAR szFileName[MAX_PATH];
    
    	DoFileOpen(NULL, szFileName, MAX_PATH);
    	printf("File = %s\n", szFileName);
    
    	DoFileOpenNoPlaces1(NULL, szFileName, MAX_PATH);
    	printf("File = %s\n", szFileName);
    
    	DoFileOpenNoPlaces2(NULL, szFileName, MAX_PATH);
    	printf("File = %s\n", szFileName);
    
    	getchar();
    	return 0;
    }

  12. #12
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    I took the lazy way out as OP wasnt specific about it only affecting his app.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  13. #13
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    anonytmouse, you script gave me tons of errors.

  14. #14
    Registered User Dante Shamest's Avatar
    Join Date
    Apr 2003
    Posts
    970
    Quote Originally Posted by Cool-August
    anonytmouse, you script gave me tons of errors.
    Posting those errors might be useful. Also state which compiler you're using.

  15. #15
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    It would take to long to post all of them, I am using Dev-C++

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Display text in a Dialog Box
    By Dark_Phoenix in forum Windows Programming
    Replies: 9
    Last Post: 01-02-2009, 06:30 AM
  2. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  3. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  4. Dialog Box Resources
    By Mecnels in forum Windows Programming
    Replies: 2
    Last Post: 04-28-2003, 05:57 AM
  5. Please help me
    By teedee46 in forum C++ Programming
    Replies: 9
    Last Post: 05-06-2002, 11:28 PM