dcsimg
Results 1 to 3 of 3

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

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    2,290

    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)

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    24,441

    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
    2,290

    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

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width