none
HKEY_CURRENT_USER\Software\Microsoft\Windows Photo Viewer\Slideshow\Screensaver\EncryptedPIDL

    Question

  • Hi,

    I want to programatically write the registry value for" HKEY_CURRENT_USER\Software\Microsoft\Windows Photo Viewer\Slideshow\Screensaver + EncryptedPIDL". Iknow u will tell a function cryptbinarytostring for getting the path encrypted. But doing it directly doesnt work i tried it. If anybody has done it previously to set his photo screen saver settings programatically a help will a lot will be appreciated. Please help its very urgent i am stuck.

     

    Thanks,

    Nikhil.

    Thursday, December 30, 2010 11:57 AM

All replies

  •  

    Hi Nikhil,

     

    I'm so sorry for not very clear your idea, would you please give us some codes about this function?

     

    Best regards,

    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, January 03, 2011 2:17 AM
  • Hi, here is my code TCHAR finalpath[MAX_PATH] = _T("C:\\MyPic");//{0};// = { 0 }; PIDLIST_ABSOLUTE pidl; DWORD flags = SHCIDS_ALLFIELDS; pidl = ILCreateFromPath(finalpath); /*HRESULT hr = SHILCreateFromPath(LPCWSTR(finalpath),&pidl,&flags); if(hr) { } */ LPTSTR pszString; DWORD pcchString =MAX_PATH + 1;; //BOOL c= CryptBinaryToString((BYTE*)pidl,sizeof(pidl),CRYPT_STRING_BASE64,NULL,&pcchString); pszString = new TCHAR[pidl->mkid.cb]; pcchString = pidl->mkid.cb; BOOL c= CryptBinaryToString((BYTE*)pidl,sizeof(pidl),CRYPT_STRING_BASE64,pszString,&pcchString); BYTE* data = (BYTE *)pszString; LPTSTR pszString1; pszString1 = new TCHAR[sizeof(data)]; BOOL c1= CryptBinaryToString(data,sizeof(data),CRYPT_STRING_BASE64,NULL,&pcchString); c1= CryptBinaryToString(data,sizeof(data),CRYPT_STRING_BASE64,pszString1,&pcchString); // RegCloseKey(keyHandle); What it does here is, In WIN7 if u set photo screen saver as your screen saver and using settings window u browse it to your different folder location of any images of yours. it creates a key in the registry as above mentioned. this code tries to encrypt the key value for that node so that it can be set programatically to desired location. Might this link help u, http://www.ms-windows.info/Help/windows-photo-screensaver-settings-19334.aspx Looking for speedy reply. Any ways wish u a very Happy new year. Thanks, Nikhil.
    Monday, January 03, 2011 3:45 AM
  •  

    Hi Nikhil,

     

    I think your issue should be raised on General Windows Development Issue, I think you can get solution from there, this issue may cause by  photo screen saver and we cannot give more information about that thing, so I move this thread to that forum.

     

    Thanks for your understanding,

    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, January 04, 2011 8:50 AM
  • THE SOLUTION:

    This is done a little bit crazy by Microsoft.

    Please insert the path to the folder where you want to have your pictures in the screensaver and save it.

    Export the registry-key "HKEY_CURRENT_USER\Software\Microsoft\Windows Photo Viewer\Slideshow\Screensaver" to a reg file.

    This reg-file will look like this:

    [HKEY_CURRENT_USER\Software\Microsoft\Windows Photo Viewer\Slideshow\Screensaver]
    "Speed"=dword:00000001
    "Shuffle"=dword:00000001
    "EncryptedPIDL"="FAAfUOBP0CDqOmkQotgIACswMJ0ZAC9DOlwAAAAAAAAAAAAAAA
    AAAAAAAAAAUgAxAAAAAADdPGCXEABXaW5kb3dzADwACAAEAO++7jqFGt08YJcqAAA
    AWAcAAAAAAQAAAAAAAAAAAAAAAAAAAFcAaQBuAGQAbwB3AHMAAAAWAFwAMQA
    AAAAA3TxclxAAU1REUElDfjEAAEQACAAEAO++3Txcl908XJcqAAAA80MAAAAACgAAAAAA
    AAAAAAAAAAAAAFMAdABkAFAAaQBjAHQAdQByAGUAcwAAABgAAAA=

    The problem is the .reg file seems to inject carriage return or paragraph mark items at a given distance in the PIDL string and when re-imported in to the registry it can't deal with it so does not import it.

    By removing the line breaks and representing the key as one VERY long string it can then import the value fine. For example:

    [HKEY_CURRENT_USER\Software\Microsoft\Windows Photo Viewer\Slideshow\Screensaver]
    "Speed"=dword:00000001
    "Shuffle"=dword:00000001
    "EncryptedPIDL"="FAAfUOBP0CDqOmkQotgIACswMJ0ZAC9DOlwAAAAAAAAAAAAAAAAAAAAAAAAAUgAxAAAAAADdPGCXEABXaW5kb3dzADwACAAEAO++7jqFGt08YJcqAAAAWAcAAAAAAQAAAAAAAAAAAAAAAAAAAFcAaQBuAGQAbwB3AHMAAAAWAFwAMQAAAAAA3TxclxAAU1REUElDfjEAAEQACAAEAO++3Txcl908XJcqAAAA80MAAAAACgAAAAAAAAAAAAAAAAAAAFMAdABkAFAAaQBjAHQAdQByAGUAcwAAABgAAAA="

    Even on this page the value does not fit but if you do copy this to a .reg file you will be able to set the PhotoScreensaver value to Public Pictures.

    It is then possible to set this value via Group Policy Preferences or custom GPO to maintain a consistent approach throughout your organisation.

    You may even also import the reg-key on a computer to set the necessary variables.


    Wednesday, March 23, 2011 1:08 PM
  • To further clarify this fix... I ususally use Notepad to edit .reg files.

    I also usually have 'Word Wrap' enabled, but in this case it was not.

    I was having this very problem where the EncryptedPIDL entry would not import with my regedit /S batch commands.

    I ededited my .REG file and enabled/disabled word wrap a few times and this entry turned into what DerKnacker showed above (the length and not wrapped).

    I made sure the entire entry for the EncryptedPIDL was intact as above and then saved the .reg file again.

    This time, when running my batch script with the /S switch it pulled in the entry for the path.

    Not sure why this acts this way but it worked.


    • Edited by CCPIPER125 Monday, June 04, 2012 3:18 PM
    Monday, June 04, 2012 3:12 PM