Results 1 to 7 of 7

Thread: [RESOLVED] Suddenly lost ability to create IShellItem or pidl for Devices and Printers??

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,654

    Resolved [RESOLVED] Suddenly lost ability to create IShellItem or pidl for Devices and Printers??

    So I was messing around with my shell browser project, and in my bookmarked folders was the entry for 'Devices and Printers' that I could swear up and down I had been using a while back to open this folder. But the entry wasn't actually showing up in the menu, and after investigating I found every method was failing... SHCreateItemFromParsingName, ILCreateFromPathW, IShellFolder of desktop ParseDisplayName, IShellFolder of Control Panel ParseDisplayName (from root and Hardware and Sound), IKnownFolderManager a couple different ways... none of these are returning an item or pidl for that folder... but either I'm totally losing my mind or I used to be able to browse it that way
    What makes me think I'm still sane is that following a shortcut actually works, and my control displays the folder perfectly just like I remember.

    Adding to the mystery, the follow-link process returns a pidl and I then am able to create an IShellItem for it and execute the normal enumeration then. I swear resolving directly used to work... what's going on am I insane

    Certain other control panel items still work normally; the Printers folder which is basically this same thing just for printers, the Network Connections folder... these work still.

    Code:
    Private Function GetLinkTargetPIDL(siLink As IShellItem) As Long
    On Error GoTo e0
    Dim isl As IShellLinkW
    siLink.BindToHandler 0&, BHID_SFUIObject, IID_IShellLinkW, isl
    If (isl Is Nothing) = False Then
        GetLinkTargetPIDL = isl.GetIDList()
    End If
     
    Exit Function
    
    e0:
        DebugAppend "ucShellTree.GetLinkTargetPIDL->Error: " & Err.Description & ", 0x" & Hex$(Err.Number)
    End Function
    The result of IShellLinkW.GetIDList is then passed to SHCreateItemFromIDList, which results in a valid IShellItem.

    Behold it in all its IShellLink-followed glory:


    I need to get a pidl for that without an Explorer-create shortcut (obviously Explorer gets a pidl for it somehow to create that shortcut, since there's no Path entry in the link, only IDList.
    Related problem is that it doesn't show up when I open Hardware and Sound Control Panel category in my browser.

    (Note: The full path is ::{26EE0668-A00A-44D7-9371-BEB064C98683}\2\::{A8A91A66-3A7D-4424-8D24-04E180695C7A} but sometimes just the latter GUID works and yes I've tried that in every call too)
    Last edited by fafalone; Sep 13th, 2019 at 04:39 PM.

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Suddenly lost ability to create IShellItem or pidl for Devices and Printers??

    i have no idea if it is related, but since a recent update, any printing at all seems to take significantly longer than previously
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,654

    Re: Suddenly lost ability to create IShellItem or pidl for Devices and Printers??

    I don't update my Win7 desktop because of all the backported spyware and 'Upgrade to 10!' spam...

    But just checked my Win10 laptop though and that doesn't seem to be working right either.... looks like early onset dementia for me

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,654

    Re: Suddenly lost ability to create IShellItem or pidl for Devices and Printers??

    Just in case anyone else ever has this problem and finds this thread, the solution is to prepend 'shell:'

    shell:::{26EE0668-A00A-44D7-9371-BEB064C98683}\2\::{A8A91A66-3A7D-4424-8D24-04E180695C7A}
    Works with all of the parsers listed.

    The biggest problem was that when it was opened through a shortcut, or somehow created, requesting the full parsing path omitted the 'shell:'. Of course it doesn't help that similar virtual folders like Printers does *not* need the 'shell:' prefix.

  5. #5
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: [RESOLVED] Suddenly lost ability to create IShellItem or pidl for Devices and Pri


  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,654

    Re: [RESOLVED] Suddenly lost ability to create IShellItem or pidl for Devices and Pri

    Everything in this thread applies identically in Windows 7 and Windows 10; the can't resolve w/o 'shell:', the full parsing path return, and the GUID that is referenced in this thread itself.

    But so what support is ending, I'll keep using it indefinitely and haven't updated in years anyway because of the spyware and adware.

  7. #7
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,007

    Re: [RESOLVED] Suddenly lost ability to create IShellItem or pidl for Devices and Pri

    Quote Originally Posted by dilettante View Post
    dilettante, many programmers still support their products on old OS's when MS ended support.

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