Is it a way to embed my User Control into Windows Explorer? Please tell me if you have any resources about this.
Thanks,
Weipeng
While you can, and there are a number of examples of how to do this. I recommend that you do NOT create shell extensions in managed code.
There are a number of reasons for this. For example, you now have to pull the entire managed runtime into the shell namespace. This means your explorer instance will use a lot more memory than is necessary.
However, the single biggest reason is that you cannot control which version of the namespace might already be in the shell process space when your control is loaded. See this article for why it's a bad idea.
Related
I want to access the objects and their properties in a similar way to how automation tools access them in their "UI Map" functionality. I'm assuming there's an assembly reference that will give access to running processes and whatever objects exist for that process.
Specifically, I need to access a few label control text properties in another running application.
Also, sorry if this is a duplicate - I looked around, but I'm not sure what keywords would get me to what I need.
This is not a common practice in C#. The term that you are looking for is to "spy" another window/application/process. There are several resources here in StackOverflow talking about this. For example:
How can I get functionality similar to Spy++ in my C# app?
To access a control in another Win32 form you need to look for the handle of that element.
For WPF applications, the UI Automation libraries present in .NET 4.5 make this way simpler: http://msdn.microsoft.com/en-us/library/ms747327.aspx
For older winforms applications, you'll have to actually utilize pInvoke on the User32 API. The example link Pete gave you in the comment on your question will help guide you in that direction: http://www.pinvoke.net/default.aspx/user32.enumwindows
I was wondering where on my computer I can find the dll file for the web browser control. The reason I need it is because I'd like to modify it for my own use, as I have found that being IE based, the webBrowser control doesn't give me everything I need, and I need to add various functions. Where can I find the dll for it?
Thanks.
System.Windows.Forms.WebBrowser is located in System.Windows.Forms.dll but this class is only the wrapper over IE engine, installed in the system. So you can't modify it as you need.
If you want to add your code, i advice to look on others engines, such as WebKit
the webBrowser control doesn't give me everything I need, and I need to add various functions
Webkit
should have everything you need. Since you're programming in C#, use a wrapper such as http://sourceforge.net/projects/webkitdotnet/ to add it to your form.
I'm looking to build an application that will rely on adding menu extensions to the menu that appears when one right clicks a file or folder. I've heard that you can build it in Python, here are the resources that I am currently looking at:
http://docs.python.org/extending/extending.html
http://docs.python.org/extending/windows.html#building-on-windows
However I'm not quite sure if I'm even looking in the right direction for this kind of stuff. What should I be searching for, and is it possible to build this kind of thing in Python or will I have to learn C#/.NET?
Thanks!
Edit: Looks like these things are called context menus and involves adding entries to the registry in order to associate applications with certain file types. In that case, should I have my application listening in the background for actions from the entry? Also if you know how to do the same thing in OS X or have some nifty cross-platform thing for this, that would be really nifty!
Here is a sample code at Sample code .
Another way is to manipulate the Registry by using the Windows Explorer tool, like the Open with option. Use it to associate a file extension with opening an executable, basically. However, this technique does not add a menu item into Windows Explorer. But it's easier.
Does anyone know how to create an app similar to IETester tool .. I have IE9 installed in my system and I need to force the webbrowser control to use IE8 assemblies, that I have a local copy.
Any ideas??
Thanks in advance,
It is technically possible, as outlined in this MSDN Library article. Just create an empty file named app.exe.local where app is the .exe name of your main program. You must copy all of the IE8 DLLs into the same folder. Actually making this work strikes me as a bit of a headache, there are a lot of DLLs. You can see them getting loaded in the Output window when you run a dummy app with a WebBrowser on a machine with IE8. Project + Properties, Debug tab, tick "Enable unmanaged code debugging" to see the DLL paths.
You can't use the web browser control as you describe, however using the link in the previous answer you can use the .local mechanism or similar mechanism and directly accessing the COM object that WebBrowser wraps to accomplish what you're trying to do.
Check out this new article by Rick Strahl which shows how to make some registry changes that will force the webBrowser control to use different versions of the rendering engine.
How does Visual Studio and other similar programs display a form in their IDE?
Is it possible to achieve the same or a similar effect using C# or VB.NET?
Please see the picture below to get what I mean.
If you are talking about hosting a Winforms editor in your code, it is entirely possible and is actually built in to the .NET framework!
The Essence is the IDesignerHost interface. The whole system is complicated, but can be done (I have done it in production code for runtime layout configuration editing). There is a sample of code from Microsoft here.
I'm sure if you search fir 'IDesignerHost' you'll find enough reference material to figure it out.
Are you speaking about UI creating tools?
Refer to http://www.icsharpcode.net/opensource/sd/ - SharpDevelop for deep dive. It's open sourse, so you'll be able to find out more details.
I believe what you want is a multiple document interface (MDI) see http://msdn.microsoft.com/en-us/library/ms973874.aspx for more info.