|
If I read you correctly, what you want to do is modify the "Places" pane of the standard windows "Open" and "Save" dialogs, to include custom locations rather than just the standard "My Documents" and "My Computer" etc.
You can do this in two ways, but they both mean editing the registry, either by hand or by software.
This works in XP, don't know about Vista
Note that Office has its own set of "Places" pane settings, which varies depending on which version you are using (Thanks, Microsoft! Standards! Lovely!).
The key you are interested in is:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\ComDlg32\PlacesBar
If it does not exist, create it. WARNING: the existance of this key overrides standard Windows behaviour and removes all items from the "Places" pane - you can delete this key to restore them.
You now need to create up to five values, named "Place0" to "Place4" inclusive, and items will be displayed in this order, with Place0 at the top of the pane.
The values can be string as in "E:\Correspondance", or DWORD as in the following table.
The DWORD values give you access to the standard items that existed before you started changing the registry - for example, if you set "Place0" to DWORD 5, the top item, in the pane will be "My Documents"
This list is (probably) not exhaustive, but if you find others that are useful, let me know. The list is (obviously) in Hex:
0 Desktop
1 Internet Explorer
2 Start Menu\Programs
3 My Computer\Control Panel
4 My Computer\Printers
5 My Documents
6 <user name>\Favorites
7 Start Menu\Programs\Startup
8 <user name>\Recent
9 <user name>\SendTo
a <desktop>\Recycle Bin
b <user name>\Start Menu
c logical "My Documents" desktop icon
d "My Music" folder
e "My Videos" folder
10 <user name>\Desktop
11 My Computer
12 Network Neighborhood (My Network Places)
13 <user name>\nethood
14 Windows\Fonts
16 All Users\Start Menu
17 All Users\Start Menu\Programs
18 All Users\Startup
19 All Users\Desktop
1a <user name>\Application Data
1b <user name>\PrintHood
1c <user name>\Local Settings\Applicaiton Data (nonroaming)0x001d
1e Nonlocalized common startup
1f Common favorites
20 Internet Cache
21 Cookies
22 History
23 All Users\Application Data
24 GetWindowsDirectory()
25 GetSystemDirectory()
26 C:\Program Files
27 C:\Program Files\My Pictures
28 USERPROFILE
29 x86 system directory on RISC
2a x86 C:\Program Files on RISC
2b C:\Program Files\Common
2c x86 Program Files\Common on RISC
2d All Users\Templates
2e All Users\Documents
2f All Users\Start Menu\Programs\Administrative Tools
30 <user name>\Start Menu\Programs\Administrative Tools
31 Network and Dial-up Connections
35 All Users\My Music
36 All Users\My Pictures
37 All Users\My Video
38 Resource Directory
39 Localized Resource Directory
3a Links to All Users OEM specific apps
To do this via REGEDIT is pretty obvious; I don't need to cover that.
Programmatically is pretty simple:
RegistryKey regKey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\ComDlg32\PlacesBar");
try
{
regKey.SetValue("Place0", 6, RegistryValueKind.DWord);
regKey.SetValue("Place1", @"E:\Correspondance", RegistryValueKind.String);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
finally
{
regKey.Close();
}
You will need to add the using for "Microsoft.Win32" - but you know how to do that, right!
This example sets the top two entries in the "Places" pane to "Favourites" and "E:\Correspondance".
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Hi Experts,
I want to Create a Virtual Drive using C#. Exactly same as M-files.
Thanks & Regards
Satish
|
|
|
|
|
|
HI,Tell me what is wrong in this code i am not able to view the Windows Folder
openFileDialog1.CustomPlaces.Add("33E28130-4E1E-4676-835A-98395C3BC3BB");
openFileDialog1.AutoUpgradeEnabled = true;
// Add Links custom place using GUID
openFileDialog1.CustomPlaces.Add(
new FileDialogCustomPlace(
new Guid("BFB9D5E0-C6A9-404C-B2B2-AE6DB6AF4968")));
// Add Windows custom place using file path.
openFileDialog1.CustomPlaces.Add(@"c:\Windows\");
openFileDialog1.ShowDialog();
|
|
|
|
|
Looks like the example from MSDN[^]. I haven't got time to test the code myself - did you get an error, or did the openFileDialog just open without the new CustomPlace ?
I are troll
|
|
|
|
|
Yes The the openFileDialog just opened without new custom Place.Tell me what to do ?
|
|
|
|
|
Try it on a computer with a different operating system. It won't work on Windows XP, according to MSDN
I are troll
|
|
|
|
|
Don't ask the same question in two places at once!!
It is rude.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I am trying to add combo box control as subitem for 1st column 1st row in listview control. Below is the code:
1.ComboBox cmb = new ComboBox();
2.cmb.Items.Add("Yes");
3.cmb.Items.Add("No");
4.cmb.DropDownStyle = ComboBoxStyle.DropDownList;
5.this.ListViewInkers.Items[i].SubItems[iCol].Control = cmb;
But i am getting below exception for 5th line.
An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll
Additional information: Index was out of range. Must be non-negative and less than the size of the collection.
Thanks in advance.
|
|
|
|
|
OK, so are you asking a question or just informing us that you don't know what you're doing?
only two letters away from being an asset
|
|
|
|
|
Yaa, i dont know to overcome this problem. If u know how to solve this issue then plz tell me.
Thanks In Advance.
|
|
|
|
|
what are the values of i and iCol? Clearly, one of these is out of range. What happens if you view ListViewInkers.Items[i] in the debugger? If that is OK, what happens when you view ListViewInkers.Items[i].SubItems[iCol] ?
Also, if you are a beginner - you do know that indices begin at 0, right?
Cheers,
Vikram. (Proud to have finally cracked a CCC!) Recent activities:
TV series: Friends, season 10
Books: Fooled by Randomness, by Nassim Nicholas Taleb. Carpe Diem.
|
|
|
|
|
I have a window as Panel
The panel is set to be a VideoPanel.
When i play the video, i get black screen on secondary monitor, if i move the window to primary, it runs fine and when i place it in the middle the part of the primary place fine, but the part on seconray is just black.
I tried to run the samme video in vlc and medaiplayer , and theres is no problem on playing in thes player on secondary screen, so it has to be something with directx.
I use Microsoft.DirectX.AudioVideoPlayback;
I search google and this forum for answer, but found nothing.
My Screens are set up to Expand desktop.
Somebody have a solution?
|
|
|
|
|
I have the same problem when I connect my TV on my laptop to play movies
and Yes , every program use DirectX top view will show a blank screen ...
thus , I used KMPlayer , and VLC as you said ... .
I think you need to try OpenGL
I know nothing , I know nothing ...
|
|
|
|
|
Ok, do you have some link to some open gl video info?
My file was in wmv, and could be play on secondary throug vlc and mediaplayer but not in my app.
But when i converted the file to mpeg, it will play in my player also on secondary screen.
-Thomaxz.tc
|
|
|
|
|
I just download VS 2010, to my understanding, it can only be used for evaluation purpose,
but I am wondering if someone use it for product developement, how MS can limit it?
|
|
|
|
|
Wow, deja vu. I'm pretty damned sure you asked this before.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
no, I asked a question also regarding to VS 2010, but it was different aspect!
|
|
|
|
|
Fair enough, but it was pointed out to you on that thread that you shouldn't ask this on the C# forum - this is a Visual Studio question. C# does not equate to Visual Studio; one's a language, the other's an IDE.
To answer your question though - the VS2010 beta will expire at a point in time. More importantly, it is targetting a beta version of the framework. Of course, you could develop a commercial product with it, but frankly you'd just be wasting your time trying to get round the timebombs when MS release free versions of their development environments in the Express editions.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I would expect project developed in the beta version to be able to move into the RC version, there may be some breakages but surely the bulk would move without expiring.
I always assumed most houses used the beta to prototype potential new projects and they would move to the release version when available.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: I would expect project developed in the beta version to be able to move into the RC version, there may be some breakages but surely the bulk would move without expiring.
It's not the projects that are the problem. It's any compiled up code you've created - especially if it binds to specific secured assemblies; then you're up the creek watching your oar disappear. At this point you have to recompile your code against the right version (taking into account any framework changes).
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Of course but what brainless twerp would try and distribute code based on a beta - oh yeah them but they aren't using someone elses framework.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Do it at your own risk - you will be targetting a Beta/RC version of the framework.
Cheers,
Vikram. (Proud to have finally cracked a CCC!) Recent activities:
TV series: Friends, season 10
Books: Fooled by Randomness, by Nassim Nicholas Taleb. Carpe Diem.
|
|
|
|
|
Over the years I have had to learn a few painfull truths (generally the hard way):
1) Never mix red and white wine.
2) Never reply "Yes" to "Does my bum look big in this?"
3) Never pause before answering "No!" to "Does my bum look big in this?"
4) Never use Beta or RC software for mission critical or production purposes.
Failing to observe these rules will lead you to a whole world of pain. Maybe not today. Maybe not tomorrow. But soon, and for the rest of your life.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
I am trying to convert datalist control to pdf. Are there any third party tool that can do this or any tutorials on how to accomplish this? I have been googling and trying stuff, but they do not work. Anyways, please help
Ferron
modified on Wednesday, July 1, 2009 4:48 PM
|
|
|
|