Where can I get this select folder dialog? - c#

I'm aware of the FolderBrowseDialog and FolderBrowseDialogEx. However in my opinion these are both inferior to the below type of dialog:
This is more in line with the open file dialog, and gives access to the navigation pane (or whatever it is on the left).
I've seen it in a few programs (shown below is TortoiseHG), which makes me suspect that it a semi off-the-shelf component, and I'm just curious whether one is freely available. Unfortunately google-fu fails me and all I can find is the FolderBrowseDialog/Ex - so my question is, is there a pre-rolled version of this dialog box (if not in the .NET framework then elsewhere) that I can use?

This is free and seems to provide customization options. Try this out.
https://github.com/scottwis/OpenFileOrFolderDialog
and http://www.lyquidity.com/devblog/?p=136

Related

Extending Task Manager Windows 8

I would like to know if there is any way to extend the task manager in a language like C# preferably but i'm also ok with C++, or anything else that works.
I would like to add some new features like, search, kill all processes with the same name, and what ever else comes to mind, but i have no idea were to start.
Note: I don't want to replace it or rewrite it from scratch, just add some new features.
I also found this link Is it possible to add functionality to Vista/7 taskmgr.exe? but it's for VIsta/7 i'm just hoping something change in 8, considering that it was completely redesigned.
Thank you
If i am correct, what you want to know is if there is a way to extend TaskManager via a plugin based approach( like Office/Ie/Outlook plugins).
The answer is no.
I however have a different approach which may help you do what you want but would be a lot more work.
What i suggest is Com interop based injection and override.
using Spy++ you can see what are the window classes/properties of the TaskManager window. Then you would need to write a program which works minimized(system tray?!) and watches for some identifying window/class name to pop up in the messages system. Windows messages can be intercepted and hooked. http://www.codeproject.com/Articles/33459/Spying-Window-Messages-from-the-Inside may be of some help.
Once you get your window handle. you will probably need to find the tabs control group. and inject a new tab element. Post which you can put anything which you deem into the tab element.
This is speculative, and involves the assumption that all the new changes you want to add would end up in a new tab.
I hope this helps you in some way.
PS: The answer is not totally speculative though. For some internal use at my workplace, I had made a prototype which would do something similar to outlook and override some default functionality which wasn't exposed by the Add in framework per se. Beware that this would require lots of testing and was somewhat unreliable/unstable

c# read syslistview32 items tooltips via winapi

i want to write an application, which reads under windows xp the quick launch items in the order like they are located in the taskbar,
and sets hotkeys for each of these item.
windows + 1 should start the first application
windows + 2 the second, etc.
(like in windows 7)
all of these items are found i a folder, but if i read the items of this folder, i dont get the right order of these items.
i found two solutions the get the right order - first:
in the registry an entry is found, where its saved how they are located, but not in plain text. i dont know how to read this, and cant reverse engine it.
the second:
read via winapi the items tooltip from the taskbar, so i can (if there are not items with the same name) search via the name in the quick launch folder.
the quick launch bar is just a listview (syslistview32).
via sendmessage i got it work to count the items, and start one (faking a click on this item), but how the hell can i read the tooltip?
i have googled a lot, tried everything, but i didnt get it run.
i hope you have any snippets for me, to solve this problem.
cheers
Determining the order of the items in the Quick Launch toolbar programmatically is going to be inherently fragile. There's not an API exposed for this, which means that it's subject to change in future versions of Windows, breaking your code that relied on assumptions about undocumented implementation details.
However, this is less of a problem in this specific case than it normally would be, since the Quick Launch toolbar doesn't exist anymore (or, at least, no one uses it anymore). The last version of Windows that used the Quick Launch toolbar was Vista, so if you make sure that your code is compatible with Vista and earlier, you should be fine. It won't work with newer versions anyway.
The positions of items in the Quick Launch toolbar is stored in the Registry in the following key:
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop
You can extract the information from there, parse and interpret it, and then use it as you like. As you mention, this information isn't stored in plain text form because that would be very slow for the shell to load and parse itself. Since this is undocumented and not designed to be used by clients, they had no particular benefit in making it user (or developer) friendly. All that matters is what's most efficient for the shell, and storing the binary information from its internal structures is the obvious choice.
You will need to reverse engineer this in order for it to be useful to you. The way I'd go about it is probably by setting up a test environment with a couple of items in the Quick Launch bar in a particular order, exporting the information from the Registry, moving one of the items around, exporting the updated information from the Registry, and comparing the two exported Registry files to see what changed. Rinse and repeat as many times as necessary to deduce the pattern. (Really makes you wonder why so many developers actually do take the time to reverse-engineer undocumented aspects of Windows, doesn't it?)
The other option would be to use Spy++ to investigate the windows that implement the taskbar and its Quick Launch toolbar. I don't have a pre-Windows 7 system around, but it sounds like from the question that you've already done this and determined that the Quick Launch toolbar is implemented using a standard ListView. If you know the name of that window (and the names of its ancestor windows), you can walk through those windows to obtain a handle to the window you're interested in. And then you can determine the order of the items in the window as if it were a standard ListView in your own application.
The documentation for ListView controls is here; that should get you started in the right direction. You can get the text of one of the subitems by sending the LVM_GETITEMTEXT message.
This is probably the easier way of doing it. The same caveats apply--there is nothing keeping future versions of Windows from changing the names of those windows or the way that the taskbar is implemented, but since the only versions of Windows that have a Quick Launch toolbar have already been released (and therefore aren't likely to change), this may not be a big problem.
Then again, with the fact of the Quick Launch toolbar's obsolescence in mind, I struggle to comprehend why this endeavor is even worthy of investing developer time.
Also, even once you get this program all written and installed, consider what happens when the user adds a new item to the Quick Launch toolbar or re-arranges the existing items. How is your utility going to know that and adjust the keyboard shortcuts accordingly? What if an installer adds/removes an item from the Quick Launch toolbar?

saveFileDialog Long Wait on "Okay" Confirmation

I'm writing in Visual Studio 2008 using C# (if that makes a difference) and I have the following snippet of code:
if(saveFileDialog1.ShowDialog() == DialogResult.OK)
{
//Write Stuff to File Here
}
For a while I thought my code that wrote the file was taking forever, however upon debugging it seems to take forever (5 to 10 seconds) just to step between the "if" statement and the first bracket of first code within the "if".
Is there anything I'm doing wrong? Is there any difference between creating the saveFileDialog object in the UI versus creating it on the fly (through code)? Would it make a difference if there is no "else" statement?
Any thoughts or ideas would be greatly appreciated!
This is not unusual, on many machines a ton of DLLs get loaded into your process when you use that dialog. You can see them getting loaded by using Project + Properties, Debug tab, tick the "Enable unmanaged code debugging" checkbox. The Output window shows a trace of every DLL that worms its way into your program.
These are shell extensions, customizations for Explorer. The dialog you use is a shell dialog, you surely recognize the similarity with regular Explorer views. Things like icons and context menus behave the same. Having a lot of shell extensions installed is common on developer's machines, more so than user machines. There are a lot of them out there, offering such conveniences as integrating whatever tool you like to use with Explorer itself.
Debugging the problem isn't that easy, you won't have the actual source code for these extensions. You might get a hint about the troublemaker from the trace in the Output window. If there's a lengthy pause after one particular DLL then odds are good that this DLL is the source of the problem. Nothing really solid though.
The better approach is to use SysInternals' AutoRuns utility. It shows you exactly what shell extensions are installed and allows you to disable them by simply clicking a checkbox. Start disabling anything that doesn't have a Microsoft copyright and stuff you could live without. Logout + Login required to make the changes effective.

Select folder dialog for WPF, with path entry field

As is well-known, WPF still doesn't supply a folder selection dialog (unless WPF4 has one that I've missed). In the meantime, I am using System.Windows.Forms.FolderBrowserDialog.
Unfortunately, this dialog only has a folder tree, OK, Cancel, and an optional "Make New Folder" button. The usability is poor. Particularly, it is terrible when trying to select a network folder. The only way to select the folder is to expand the "Network" base.. which on many corporate systems/networks, will begin a long delay and ultimately yield an unacceptably long list.
I would like a text entry field which would allow the user to start navigation at a particular location.. such as a particular computer/folder.. such as is possible in the file browse dialog.
Has anyone done such a thing? Is this a way to extend the standard System.Windows.Forms.FolderBrowserDialog, or will I have to create my own?
Thanks.
Vista Bridge provides managed wrappers for the new Vista dialogs with fallback support when running on older OS. These file dialogs are preferrable to either the stock WPF or WinForms ones.
The Windows API Code Pack provides managed wrappers for Windows 7 features.
I think you should create your own, no default folder dialog implement something like this. If I'm not wrong, java too doesn't allow such possibility.
I normally create the "open folder dialog" button near a textbox where the path can be written manually (when the folder dialog button is closed with ok button simply fill that textbox), that's the easiest way.
Your type of dialog should be created, on the good side you can at least sell it because it looks nice and helpful. Or maybe you can find something similar on the web (previous payment by the way).
Another thing, all folders dialog are very slow, at least on windows XP, maybe is "impossible" to reduce those delays, you should do some searches to avoid this problem (multi-threaded dialog which gather information while giving possibility to start navigating through directory tree is the only thing i can think about).
Hope this will be helpful
EDIT:
Maybe this has some sort of utility,
http://www.ssware.com/fldrview.htm
it looks cool but doesn't have all features you want, I think it doesn't exist as you hope
You wrap native code and use the SHBrowseForFolder function:
http://msdn.microsoft.com/en-us/library/bb762115(v=vs.85).aspx
Or starting with Vista you could use create a COM object with the id "CLSID_FileOpenDialog" (native code, too):
http://msdn.microsoft.com/en-us/library/bb776913(VS.85).aspx
Both of those provide a text input area where you can type in UNC paths.

Integrating into Windows Explorer context menu

I want to write a small tool, that does the following:
When you right click on a file with a certain file-extension the Windows Explorer context menu shows an additional entry.
When you click this entry a certain EXE is launched with this file as one of its parameters.
I would like to use C#/.NET 2.0 for this. If it's not possible I could also do it with C++/Win32.
My questions are:
Is it possible with C# .NET 2.0?
What are the necessary functions for integrating into the Windows Explorer context menu?
How can I make this permanent? (I don't want to relaunch this tool after every boot)
What do I have to take special care of? (different OS, security permissions, etc.)
You will need to access the registry and add a key under root\\File\\shell or root\Folder\\shell, depending on which items you want the menu item visible on.
Try this article at CodeProject, it's quite useful.
Edit: There's another article here which may be of help.
It is, incidentally, not supported to use .NET for shell extensions, due to the current inability to host multiple runtime versions in the same process (.NET 4 will lift this restriction).
Consider the case where you have two shell extensions; one for .NET 3.5, one for .NET 1. Which runtime will get loaded into your process? Well, it's more or less random--it depends which shell extension gets loaded first. Sometimes it might be the 2.0 runtime, sometimes it might be the 1.1 runtime.
This is also an issue if a .NET program creates common file dialogs; your shell extension may or may not load, and may or may not run with the correct runtime version.
As such, if you go down the Shell extension route you should use native C++/COM/Win32.

Categories