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. get the actual selected file in windows explorer???

get the actual selected file in windows explorer???

Scheduled Pinned Locked Moved C / C++ / MFC
databasedebugginghelpquestion
6 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.
  • M Offline
    M Offline
    mightyCoCo
    wrote on last edited by
    #1

    hi, following problem: i trace the actual front window with GetForegroundWindow(), then look up, if its classname is "CabinetWClass" or "ExploreWClass", witch are the explorer window-classes. ok, so far, so good. then i subclass the "SysListView32" if it exists by passing through the CWnd-childwindows with EnumChildWindows(..., ...) - fine, works! i subclass the resulting CListView of the explorer-window and subclass its CListCtrl - ok - i can get the index of the selected item with .GetSelectonMark(). all functions work like .GetSelectionCount() and so on... but the function .GetItemText(item, subitem) dosen´t work - also the .GetItem(&pItem) dosent return the filename of the selected file... so what??? anyone have an idea? what i try to do: i want to check out if specific files are selected in the windows-explorer-windows - if they are selected, i want to run a action... :confused: cheers, vertex_x

    D 1 Reply Last reply
    0
    • M mightyCoCo

      hi, following problem: i trace the actual front window with GetForegroundWindow(), then look up, if its classname is "CabinetWClass" or "ExploreWClass", witch are the explorer window-classes. ok, so far, so good. then i subclass the "SysListView32" if it exists by passing through the CWnd-childwindows with EnumChildWindows(..., ...) - fine, works! i subclass the resulting CListView of the explorer-window and subclass its CListCtrl - ok - i can get the index of the selected item with .GetSelectonMark(). all functions work like .GetSelectionCount() and so on... but the function .GetItemText(item, subitem) dosen´t work - also the .GetItem(&pItem) dosent return the filename of the selected file... so what??? anyone have an idea? what i try to do: i want to check out if specific files are selected in the windows-explorer-windows - if they are selected, i want to run a action... :confused: cheers, vertex_x

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      vertex_x wrote: what i try to do: i want to check out if specific files are selected in the windows-explorer-windows - if they are selected, i want to run a action... Why not just add your action item to the context menu that pops up when you right-click a file? It's much easier, and wouldn't be nearly as annoying, than what you are currently doing.


      "Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow

      M 1 Reply Last reply
      0
      • D David Crow

        vertex_x wrote: what i try to do: i want to check out if specific files are selected in the windows-explorer-windows - if they are selected, i want to run a action... Why not just add your action item to the context menu that pops up when you right-click a file? It's much easier, and wouldn't be nearly as annoying, than what you are currently doing.


        "Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow

        M Offline
        M Offline
        mightyCoCo
        wrote on last edited by
        #3

        of course, thats right. but excessive right-clicking and popping windows takes to much time for me. i just want to cycle through a lot of files and directly see some type of preview... without draging files to a preview window or starting applikations via right-click...

        D 1 Reply Last reply
        0
        • M mightyCoCo

          of course, thats right. but excessive right-clicking and popping windows takes to much time for me. i just want to cycle through a lot of files and directly see some type of preview... without draging files to a preview window or starting applikations via right-click...

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Fair enough. Have you checked out the IShellChangeNotify interface? There's also SHChangeNotifyRegister().


          "Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow

          M 2 Replies Last reply
          0
          • D David Crow

            Fair enough. Have you checked out the IShellChangeNotify interface? There's also SHChangeNotifyRegister().


            "Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow

            M Offline
            M Offline
            mightyCoCo
            wrote on last edited by
            #5

            thanx alot! i actually can´t find any documentation about them, even not in my msdn-library ;o) looking now on msdn in the net for it ;o) i´ll notice here, if it works... cheers, vertex

            1 Reply Last reply
            0
            • D David Crow

              Fair enough. Have you checked out the IShellChangeNotify interface? There's also SHChangeNotifyRegister().


              "Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow

              M Offline
              M Offline
              mightyCoCo
              wrote on last edited by
              #6

              with the above functions i get only messages if something is changed - eg. file rw-access, folder creation/delet, media insertion/remov and so on... but thanks anyway ;o) it was a good tray :o) cheers, vertex

              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