Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how to show shell context menu, given only file name?

how to show shell context menu, given only file name?

Scheduled Pinned Locked Moved C / C++ / MFC
questionlinuxtutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nm_114
    wrote on last edited by
    #1

    Can anyone tell me how to show the shell context menu for a file when all you have is the file name. I got a menu to show up but not with all the items and the ones that are there don't work right - when I click on properties the Properties dialog comes up, but with most of the info blank or 0. What I've done so far is get the PIDL for the file by using SHGetDesktopFolder() to get the desktop folder and calling ParseDisplayName which works fine. I think what is going wrong is I'm calling GetUIObjectOf() to get the IContextMenu interface with the desktop folder, when it needs the pidl's direct parent folder. If this is the case how do you get a pidl's parent folder? - thanks

    M 1 Reply Last reply
    0
    • N nm_114

      Can anyone tell me how to show the shell context menu for a file when all you have is the file name. I got a menu to show up but not with all the items and the ones that are there don't work right - when I click on properties the Properties dialog comes up, but with most of the info blank or 0. What I've done so far is get the PIDL for the file by using SHGetDesktopFolder() to get the desktop folder and calling ParseDisplayName which works fine. I think what is going wrong is I'm calling GetUIObjectOf() to get the IContextMenu interface with the desktop folder, when it needs the pidl's direct parent folder. If this is the case how do you get a pidl's parent folder? - thanks

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      Read Raymond Chen's posts on hosting a context menu, start here[^]

      --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

      N 1 Reply Last reply
      0
      • M Michael Dunn

        Read Raymond Chen's posts on hosting a context menu, start here[^]

        --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

        N Offline
        N Offline
        nm_114
        wrote on last edited by
        #3

        Thanks for the reply. Unfortunately it uses SHBindToParent() which requires Win2k+ :sigh:

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups