How can I include Flash in VB.NET? - vb.net

I would like to create a .exe wrapper for a Flash Player using VB.NET. I am having a few problems.
1.I seem to remember being able to import Flash Player as a control into Visual Studio (2008 Pro). For some reason, I can't seem to VS to import it anymore. (I tried using the OCX from Visual Studio) Perhaps I'm looking for the wrong file. What file am I looking for?
2.Is including Flash inside of a VB program legal?
3.When a control is included in a VB.NET program (such as Flash) does the control need to be distributed in a separate file, or will the compiled application contain it in the ".exe"?
Thanks.
edit:
I was able to import the control as the Flash10b.ocx from c:\Windows\System32\Macromed directory as a COM component. Question 2 and 3 still remain.
Edit 2:
Is there documentation on the ActiveX control? I am trying top figure out the API for ExternalInterface. Any tips on that?

Using flash inside a VB program is perfectly legal, it is just an activeX control.
You will need to distribute the interop library with your application (it will be in your output directory) and the ActiveX object (flash10b.ocx) will need to be installed on the system, it wont package it all up for you.

Related

VB.net or Windows API: How to find out which icons the file explorer uses?

I am currently working on a Windows desktop application using VB.net where I would like to have a file and folder browsing interface directly integrated, i.e. the user does not have to open a file browser dialog to select files.
My file browser should resemble the original Windows file explorer at least in that it uses the same icons for the most common locations. For example, I would like to include the "Favorites" folder with the appropriate icon (please note that this is NOT the IE favorites folder, but the folder which comes up when you type shell:links into the address bar of the file explorer).
My problem is fetching the icon. So far, I have written a wrapper class for some functions of the Windows API, notably SHGetKnownFolderPath and SHGetFileInfo. My approach is the following:
1) Use SHGetKnownFolderPath to get the full path to the respective location (which depends on the Windows version and localization). This part works like expected. For example, on my system (W7 Pro x64), SHGetKnownFolderPath returns "C:\Users\Administrator\Links" when queried with the respective rfid.
2) Use SHGetFileInfo to fetch the icon which Windows considers the default icon for the path obtained in 1). This part technically works as well, but the wrong icon is returned - wrong in the sense that it is another icon than Windows file explorer uses for the same location.
I have tried that with four different locations (MyLibraries, MyFavorites (Links), MyComputer, MyNetwork). The icon for MyLibraries was the expected one, the other three were completely different from the icons Windows file explorer uses.
So I have got some questions:
1) Is there any way to detect which icons are used by the standard Windows file explorer for certain folders, e.g. "Favorites" (C:\Users\Administrator\Links on my machine)? I would be interested in a general solution (i.e. a solution which works for all locations described here).
2) If there is no such way, I will find out the number (index) of all icons of interest in shell32.dll (actually, there are only a few at the moment). Can I be sure that those indexes won't change in the future?
3) According to this document, I have to call CoInitialize before using SHGetFileInfo. I believe that the .NET framework automatically does this for the main thread before starting it and thus have not done it on my own yet (the development of the application has just started, and there is only one thread at the moment).
I think that the missing call to CoInitialize can't be the cause for the "wrong" icons. If I'm wrong here, please let me know.
A potential solution could be using a .NET language or the native Windows API / SDK. As long as there is some way (even an extremely complicated one) to use the solution from within VB.net, I will be happy with it.
Explorer uses 2 ways to detect icon of any object, file or folder.
1) call IShellFolder.GetUIObjectOf(IExtractIconA/W) and work with IExtractIcon.
2) query IShellFolder.QueryInterface(IShellIcon) and call IShellIcon.GetIconOf.
You can do the same.

How To Implement AutoCAD Color Chooser In External Application

Goal
I want to be able to access AutoCAD's Color chooser from an external application. This means that I will not be using AutoCAD to make the color chooser dialog popup. Instead, I will be using a VB.Net application to manage these colors.
Current Situation
As for now, I have no idea where to start. Do I need to import a specific library to make this work? Is it even possible to do this without AutoCAD running?
.NET has a basic built-in color picker control if you want to drive outside of AutoCAD:
System.Windows.Forms.ColorDialog
You'll likely need a helper class/extension methods for converting ARGB colors to AutoCAD colors. Although may find it better to just roll your own. Use IlSpy, DotPeek, or .NET Reflector to look at how the AutoDesk class gets instanciated/used.

possible to modifer the properties of windows in Objective C?

These are windows besides those that belong to the application. For example, how could I change the title of an open application, for example, TextEdit
You could use mach_inject and mach_override to load code into the target application and then simply use the Objective-C API's to access the window.
You could also try using applescript, but no idea if or how that is done.

where i can find input panel, i can't find it in toolbox?

I want to handle SIP. So i have gone through the article http://www.christec.co.nz/blog/archives/42
. I don't find Microsoft.WindowsCE.Forms.dll in the references. Then i downloaded the dll and tried to add it to the project, then it gives an error that it can't be added because its not build in Microsoft.Phone.Runtime environment.
So how can i get the dll and input panel.
That dll is for Windows CE, which is NOT the same as Windows Phone 7. The SIP for WP7 is handled by the operating system and is displayed automatically when a text input control receives focus (TextBox, PasswordBox, etc).
There is an article that discusses creating a Bulgarian keyboard, but it requires a custom input control, too.

Adding an item to the system context menu

How do you add an item to the system context menu? I would like to let my users be able to right click anywhere and launch this program. I cannot seem to find it documented anywhere either.
Thanks for your help!
I am coding in vb.net
What you're looking for is creating a Shell Extension Handler for Windows Explorer.
Reference: http://msdn.microsoft.com/en-us/library/bb776881(VS.85).aspx
Unfortunately doing this in a .Net application is a bit of a problem due to the way in which the CLR is loaded for COM plug-in style extensions. Raymond did a great job of exploring this problem here
http://blogs.msdn.com/oldnewthing/archive/2006/12/18/1317290.aspx