CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 26 of 26
  1. #16
    Join Date
    Jun 2008
    Posts
    43

    Re: Get the folders opened in explorer.exe

    Users need to choose where to copy file.
    As I said (sorry for my bad english), he can choose if to copy in one of the folders already opened in windows explorer if any, or browse for one using a dialog (the one SHBrowseForFolder shows).

    I thought that FindWindow could help me to find if there's one or more explorer windows opened, but I'm stuck here since I don't know how to get the paths.

    I noticed that the can be in the combo box (the adress bar) but not everybody uses it.

  2. #17
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Get the folders opened in explorer.exe

    Quote Originally Posted by Enrorr
    Users need to choose where to copy file.
    As I said (sorry for my bad english), he can choose if to copy in one of the folders already opened in windows explorer if any, or browse for one using a dialog (the one SHBrowseForFolder shows).

    I thought that FindWindow could help me to find if there's one or more explorer windows opened, but I'm stuck here since I don't know how to get the paths.

    I noticed that the can be in the combo box (the adress bar) but not everybody uses it.
    Just use SHBrowseForFolder and call it a day. Although retrieving paths from explorer can be done reliably, there isn't much benefit to the user for doing so. Users won't expect this behavior.

    If the user has an explorer window open, then can always paste in the path if they want to; otherwise they can use the Browse functionality.

  3. #18
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    Re: Get the folders opened in explorer.exe

    I agree. As a seaoned windows users, I would NOT expect such a functionality.

  4. #19
    Join Date
    Jun 2008
    Posts
    43

    Re: Get the folders opened in explorer.exe

    I agree it's not common, but i personally found useful.
    Anyway i was just curious how to take infos from other process or windows...
    Do you know any reading about it?

  5. #20
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Get the folders opened in explorer.exe

    A good start would be to look at the EnumWindows code link I posted earlier.

  6. #21
    Join Date
    Jun 2008
    Posts
    43

    Re: Get the folders opened in explorer.exe

    d'oh i totally missed it...
    Thanks for the hint.

  7. #22
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Get the folders opened in explorer.exe

    Check that out and use the Spy++ tool to understand the relationships of the windows (parent, child, grand parent, etc.). After you understand that post back, and I'll explain how you can manipulate them.

  8. #23
    Join Date
    Jun 2008
    Posts
    43

    Re: Get the folders opened in explorer.exe

    Ok I suppose I got it.

    I think it will be useful to get the text of the ComboBox32 class even if it isn't visible.
    I'll try for now to do it using FindWindowEx, even as I understood your function has better functionality.

    EDIT: I got some results
    Using FindWindowEx I got the combobox (after getting its father,grandfather,and grandgrandfather HWND), then sent a WM_GETTEXT message and i got the path.

    Now I need to enumerate all explorer windows (I think your function Arjay now will come in hand)
    Last edited by Enrorr; July 17th, 2008 at 12:10 PM.

  9. #24
    Join Date
    Jan 2008
    Posts
    178

    Re: Get the folders opened in explorer.exe

    It's a bad method.
    The standard method is to use COM Interfaces (IWebBrowserApp, etc)

  10. #25
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Get the folders opened in explorer.exe

    Quote Originally Posted by fred100
    It's a bad method.
    The standard method is to use COM Interfaces (IWebBrowserApp, etc)
    Not in this case, Fred. Reread the post to find out what the OP is actually trying to do.

  11. #26
    Join Date
    Mar 2009
    Posts
    1

    Re: Get the folders opened in explorer.exe

    Greetings,

    I was justing looking for this same thing, because I want to build a program that allows the users to Undo closed folders (much like Firefox's undo closed tab, but for windows), so im in the need to know the opened folders' full path

    So, let me get this clear (im kinda newbie with hWnd and stuff):
    I need to look through all my open windows (with EnumWindows for ex), then find those which are folders (with the Cabinet/Explorer class), and then get into the window and copy the from the combobox showing the path?

    Thanks!

Page 2 of 2 FirstFirst 12

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

Featured