CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Join Date
    Mar 2005
    Posts
    140

    Controlling folder views programitically

    Hi,
    In my application I need to control current the view of the folder opened in windows explorer.

    User will start my application....He will also open a folder in the windows explorer. When he clicks a button in my application the view of the folder will change.(View means list,thumbnails,icon)

    Please let me know where should i start?

    Regards and thanx,
    J

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: Controlling folder views programitically

    Quote Originally Posted by reachb4 View Post
    ...
    Please let me know where should i start?
    Start to explain more clear what you want and what the problem is.
    Victor Nijegorodov

  3. #3
    Join Date
    Oct 2008
    Location
    Cologne, Germany
    Posts
    756

    Re: Controlling folder views programitically

    I think @reachb4 has explained it good enough, he just wants to control a windows explorer's window (particularly the view) with his application. I'm also curious how it can be done.
    win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming

    remeber to give feedback you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation

    private lessons are not an option so please don't ask for help in private, I won't replay

    if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: Controlling folder views programitically

    Quote Originally Posted by memeloo View Post
    I think @reachb4 has explained it good enough, he just wants to control a windows explorer's window ...
    Well, it is not an answer...
    My question is: why does OP think that he/she needs to "control a windows explorer's window"?
    Victor Nijegorodov

  5. #5
    Join Date
    Oct 2008
    Location
    Cologne, Germany
    Posts
    756

    Re: Controlling folder views programitically

    it's not important why, but how, I think. it could be interesting to know why but for me it's irrelevant here.
    win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming

    remeber to give feedback you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation

    private lessons are not an option so please don't ask for help in private, I won't replay

    if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know

  6. #6
    Join Date
    Mar 2005
    Posts
    140

    Re: Controlling folder views programitically

    My program will have keyboard shortcut when pressed will change the folder views.

  7. #7
    Join Date
    Mar 2005
    Posts
    140

    Re: Controlling folder views programitically

    any takers?

  8. #8
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: Controlling folder views programitically

    Quote Originally Posted by reachb4 View Post
    My program will have keyboard shortcut when pressed will change the folder views.
    Quote Originally Posted by reachb4 View Post
    any takers?
    Well, since the last 24 hours you could write not so many words....
    But the worse problem is: you couldn't (or didn't want to) explain what you need and why!
    Victor Nijegorodov

  9. #9
    Join Date
    Oct 2008
    Location
    Cologne, Germany
    Posts
    756

    Re: Controlling folder views programitically

    Quote Originally Posted by VictorN View Post
    But the worse problem is: you couldn't (or didn't want to) explain what you need and why!
    I still don't understand what part of his question is unclear to you. maybe he writes some utility program for manipulating windows explorer's window. as I've already said, it's irrelevant why he is doing this.

    if I only new how to help him I would have already done it but unfortunetally I have now idea (yet) how I one can change views in windows explorer from another application and I'm also awaiting answers because it's interesing.
    win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming

    remeber to give feedback you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation

    private lessons are not an option so please don't ask for help in private, I won't replay

    if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know

  10. #10
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: Controlling folder views programitically

    Quote Originally Posted by memeloo View Post
    I still don't understand what part of his question is unclear to you. maybe he writes some utility program for manipulating windows explorer's window. as I've already said, it's irrelevant why he is doing this.
    If it is "irrelevant" for you - then help him!
    For me it is NOT "irrelevant".
    If what OP needs were "some utility program for manipulating windows explorer's window" then I'd just give up!
    But I guess OP might need something else!?

    And what to do when there are more than one windows explorer's window opened?
    And what to do if user closed windows explorer's window just after starting the Application?
    And so on...

    Quote Originally Posted by memeloo View Post
    ... unfortunetally I have now idea (yet) how I one can change views in windows explorer from another application and I'm also awaiting answers because it's interesing.
    Well, I have no idea either!
    But if you explained me what "view" in windows explorer you needed to change, what you meant by "change", and why you need to "change" I (or someone else), perhaps, would be able to suggest some (may be copletely different!) way to do it or, at least point out where to look for such a way!
    Victor Nijegorodov

  11. #11
    Join Date
    Oct 2008
    Location
    Cologne, Germany
    Posts
    756

    Re: Controlling folder views programitically

    Quote Originally Posted by VictorN
    But if you explained me what "view" in windows explorer you needed to change
    here is the answer
    Quote Originally Posted by reachb4
    (View means list,thumbnails,icon)
    Quote Originally Posted by VictorN
    And what to do when there are more than one windows explorer's window opened?
    And what to do if user closed windows explorer's window just after starting the Application?
    And so on...
    these are different topics, like how to pick a window or how to protect a picked window but they have nothing in common with changing explorer views
    win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming

    remeber to give feedback you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation

    private lessons are not an option so please don't ask for help in private, I won't replay

    if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know

  12. #12
    Join Date
    Aug 2008
    Location
    Scotland
    Posts
    379

    Re: Controlling folder views programitically

    >Please let me know where should i start?

    You can use PostMessage to send WM_COMMANDS to a window, so if you can get the handle of the Window you are interested in, you can send it a command.

    For example, on my PC this will find a Windows Explorer window, and set the view to "list":
    Code:
    #define ICONS 28713
    #define LIST 28715
    #define DETAILS 28716
    #define THUMB 28717
    #define TILES 28718
        HWND hWnd = FindWindow("ExploreWClass",NULL);
        PostMessage(hWnd,WM_COMMAND,MAKEWPARAM(LIST ,0),0);

  13. #13
    Join Date
    Oct 2008
    Location
    Cologne, Germany
    Posts
    756

    Re: Controlling folder views programitically

    @alanjhd08: could you tell us please where did you find the messages that can be send to a explorer window. I was not able to locate this part in msdn. (I know it's some header file but it's always magic to me how people come across this values)
    Last edited by memeloo; July 8th, 2009 at 08:39 AM.
    win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming

    remeber to give feedback you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation

    private lessons are not an option so please don't ask for help in private, I won't replay

    if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know

  14. #14
    Join Date
    Aug 2008
    Location
    Scotland
    Posts
    379

    Re: Controlling folder views programitically

    Hi,

    Use Windows Spy++, find the window you are interested in, and use the menu to send it the command you are interested in.

    As far as I know these are "magic" values, I don't think they are documented by MS, which is why I specify that they work on my PC. On different versions of Windows Explorer, maybe they are different.

    Alan

  15. #15
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: Controlling folder views programitically

    Victor Nijegorodov

Page 1 of 2 12 LastLast

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