Click here to Skip to main content
11,578,241 members (61,500 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: WinXP C# Windows Win7 API
Hi...

I want to open a directory ( like "E:\\" ) in an open window,
I mean that I want to change a window navigation address in windowsExplore.exe,

for example i have a window open that shows "D:\\new folder" and I want to change its address to "E:\\",

I know this code
System.Diagnostics.Process.Start("E:\\");
but this code opens a new window... I want to change not open a new window.
Posted 4-Sep-12 7:15am
soox425
Edited 4-Sep-12 7:22am
v2
Comments
Sergey Alexandrovich Kryukov at 4-Sep-12 14:42pm
   
If you think a bit about it, you will see that there is no such thing as "open a directory" -- this is no more than some metaphor common for some types of applications, such as file managers. By some reason, your code really opens a new window, but it's not just a window, this is a window of Windows "Explorer" application. To get some help, you really need to realize all that and explain what you want to achieve, otherwise this question makes no sense.
--SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

AFAIK, what you are trying to do is not possible this way. This is not how Process.Start works.

A folder is not a process that can be 'started'.
  Permalink  
Comments
Sandeep Mewara at 4-Sep-12 15:50pm
   
You cannot do it. You need an event to do it. URL's are executed and directed to other ones by same web app. External applications can launch a new URL but cannot change existing windows one from security perspective. Think if it was allowed, how viruses and male-ware would do with our open windows.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

I don't know a way to change navigation bar value, but you can open directory using

System.Diagnostics.Process.Start("explorer.exe", @"/select, " + fileName);

If you don't want to select a file just replace @"/select, " with "".filename represents location of file or folder.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Richard MacCutchan 165
1 OriginalGriff 150
2 Peter Leow 150
3 Afzaal Ahmad Zeeshan 100
4 Frankie-C 75
0 OriginalGriff 880
1 Sergey Alexandrovich Kryukov 685
2 Abhinav S 573
3 F-ES Sitecore 420
4 Suvendu Shekhar Giri 393


Advertise | Privacy | Mobile
Web04 | 2.8.150603.1 | Last Updated 4 Sep 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100