History Folder

This is a discussion on History Folder within the Windows Programming forums, part of the Platform Specific Boards category; Is there a way to find the default history folder? I thought there was, but I could only find default ...

  1. #1
    Registered User DutchStud's Avatar
    Join Date
    Oct 2001
    Posts
    43

    History Folder

    Is there a way to find the default history folder? I thought there was, but I could only find default system folder and default windows folder. thanks in advance.

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Explorer\Shell Folders

    Lots of cool shell folders in there.......

  3. #3
    Registered User DutchStud's Avatar
    Join Date
    Oct 2001
    Posts
    43
    thanks.

  4. #4
    Registered User DutchStud's Avatar
    Join Date
    Oct 2001
    Posts
    43

    Question Retrieve the data...

    Help me out with how to get this value now. I get success on the first function, but the second fails. I don't even know if the second is the correct function.
    PHP Code:
    if(
      
    RegOpenKey(
        
    HKEY_CURRENT_USER,
        
    "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders",
        &
    key) != ERROR_SUCCESS
    )
          { 
    MessageBox(hwnd"Error opening key""Error"0); }
    if(
      
    RegQueryValue(
        
    key,
        
    "History",
        
    buffer,
        &
    ret) != ERROR_SUCCESS
    )
          { 
    MessageBox(hwnd"Key Reading Error""Error"0); } 
    By the way, the \ in the text are actually double \s

  5. #5
    Registered User ExDigit's Avatar
    Join Date
    Jan 2002
    Posts
    31

    Try this:

    We figured something similar out later on in the forums, but just to make your question complete:
    Code:
    #include <windows.h>
    #include <stdio.h>
    int main()
    {
     char HistoryFolder[301];
     DWORD DataType = REG_SZ;
     DWORD BufferLength = 300;
     HKEY hKey;
    
     RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", 0, KEY_READ, &hKey);
    
     RegQueryValueEx(hKey, "History", 0, &DataType, (BYTE *)HistoryFolder, &BufferLength);
    
     MessageBox(NULL, HistoryFolder, "The history folder is..", MB_OK);
    
     return 0;
    }

    (Note: The message board broke the subkey string - that is supposed to be a continuous string)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reading .dat files from a folder in current directory...
    By porsche911nfs in forum C++ Programming
    Replies: 7
    Last Post: 04-04-2009, 09:52 PM
  2. accessing all files in a folder.
    By pastitprogram in forum C++ Programming
    Replies: 15
    Last Post: 04-30-2008, 10:56 AM
  3. Not able to access directory of home folder
    By Bargi in forum Linux Programming
    Replies: 1
    Last Post: 02-06-2008, 01:45 AM
  4. How do I clear the history folder?
    By Queatrix in forum Windows Programming
    Replies: 0
    Last Post: 08-20-2005, 09:13 AM
  5. Hiding a folder
    By nextstep in forum Windows Programming
    Replies: 16
    Last Post: 03-20-2005, 02:07 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21