sample of embedding flash in windows form using c# - c#

I have a swf file (little animation) created in swish and I want to put it in my windows form app like a header, I was reviewing the below link but it doesn't say too much, could someone give an example of how to do this?
Embedding Flash in a Windows Forms .NET app

Your link is to an old page. (Circa 2003)
Next, there is a SO question similar to this: AxShockwaveFlashObjects and ShockwaveFlashObjects from Flash ocx
To get the two DLL Files needed, do the following:
Open your command prompt. Switch to the directory that contains the aximp.exe file. Typically; C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin>
Enter the following command (you may need to change the name of your COX file to match your version.
aximp.exe -source "C:\WNDOWS\system32\Macromed\Flash\Flash10a.ocx"
Look in the C:\WNDOWS\system32\Macromed\Flash\ directory. Your files should be there.
Add these two files as reference in Visual Studio.
Here is a sample app on MSDN: http://social.msdn.microsoft.com/Forums/en-US/winformsdesigner/thread/5815e676-50b0-47f4-964a-c1bcebfdb9a4

Related

wpf string files not found on release version but work in debug c#

I have finished a very basic application (wpf/c#). The solution is made of 3 projects:
The main project for the app
The Class Library Project to store app resources (images and txt files)
The Setup project which I use to create exe file for distribution to other
machines.
While the project works fine in debug mode when I deploy it using the Setup project and install on the computer I can access the image files from the Library Project (I can see there is a dll file for the library project in the application folder) but it fails to access the text files, complaining the path was not found. This is my very first time I completed the application and attempted to deploy it so am a bit at a loss why the setup does not provide correct references to the text files and yet it seems to work fine with image files which are located in the same library project.
Can someone point me in the right direction where to look at it to troubleshoot?
I have cleaned and rebuilt all projects in the solution. retested in debug mode (works fine). tried to search msdn and StackOverflow but I cannot find any guidance I could use or follow.
I would like to be able to display text from the text files in the released/installed application version the same way it works in debug mode. At the moment it fails to find the relevant txt files.
Finally, I have managed to crack it. Posting the answer for anyone having the same problem.
The issue here was not with the file path, even though I came up with a more clearer technique of building it, see my comments above. The problem was with the way Setup Project in VS2017 was creating a package. It is handling differently images and text files, even though both are in the same Library Project, essentially for text files I had to do the following to get it working:
Open File System in Setup Project
Create the 'Resources' Folder under 'Application Folder'
Set the 'Resource' folder 'AlwaysCopy' property to 'true'
In 'Resources' folder right-click and select Add> File...
Navigate to the folder with the files and select them all (make sure the files are setup as Resources or embedded resources)
Rebuild the Setup Project
.
So summarising I had to specifically tell Visual Studio to build the folder structure in the Application Folder during the install.
Now when I run the installer the text files are included in the package and created during standalone installation. Also included a screenshot below.

cordova windows phone 8 how to add a plugin

Hello im trying to use the InAppBrowser in my cordova project.
But i dont get it working.
I have downloaded the files InAppBrowser.cs and InAppBrowser.js and put the .cs file inside the project root folder and the .js file inside the www folder.
I also add to the root folder config.xml file the plugin tag.
<widget>
<access origin="*"/>
<feature name="InAppBrowser" value="InAppBrowser" />
</widget>
Unfortunately it doenst work.
Someone knows what im missing?
Am i too late answering this ? Anyway.. i think you should make use of CLI.
First install node.js.
http://nodejs.org/download/
Then git installer.
http://git-scm.com/downloads
Then Hit Windows+R and type cmd to open command prompt.
After that follow these steps to create a new project, then add your platform(ie WP8)
http://docs.phonegap.com/en/3.0.0/guide_cli_index.md.html
Windows Phone 8 Plugin Resource.
http://plugreg.com/plugins#platform=wp8
Select any plugin
For eg, File plugin by apache.
just copy and paste the code to your command prompt.
Hit enter, the plugin will be installed automatically.
Then use it normally. or just read the plugin documentations.
:-)

Default program to open file and load Application in C#

I have a C# WinForm application. This program is designed to create and open specific files (.cus). Files are created using this program and can be opened in same program.
I am using Advanced Installer to create Installer.
After Installation, I need my program to open file(.cus) when it is double clicked. (Just like, If we dblClick .xls file it loads and opens MS Excel if it is there in system.)
How can I achieve this?
I detail answer will be good to understand.
Let me know if I need to make it more clear.
Thanks in anticipation.
You need to get your installation package to create the file association in Windows when you install your application. I am not sure how to achieve this in Advanced Installer, but most installation packages will allow you to do this.
You will also need to make sure your Winforms application accepts a file path as a parameter to the Main(string[] arg) method, which windows will set to be the .cus file you double clicked on.

Windows Shell: How to associate different xml-files with different apps?

I have many kinds of xml-files (all with extension .xml) with different root element name and namespace. I want to associate each type with a different application and also make it possible to have different file-icons for each type. Can this be done using C# .NET?
The only way to handle this is in a similar way to that which Visual Studio uses to handle .sln files which is the Visual Studio Version Selector. This application is the one that gets associated with .sln files and handles providing an icon and an eventual process to handle the specific .sln file. Assuming you have Visual Studio installed, take a look in the registry at HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln to see how it's done.
So basically you need to:
Write an executable that can decide what to do with .xml files
Register the process as the one responsible for handling .xml files
Place logic in your executable, or in configuration that your executable consumes, that decides what to do on a per file basis.
For icons, take a look at the subkey ShellEx\IconHandler. You'll see that it points to (on an x64 machine with Visual Studio 2010 installed) HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{9A2B23E4-2A50-48DB-B3C3-F5EA12947CB8} which lists under InprocServer32 a DLL that is responsible for providing icons for files, in this instance C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\VSFileHandler.dll. You'll need to implement a similar DLL that shares the configuration/logic of your launcher process to determine what icon to show on a per file basis.
The usual caveat: Writing shell extensions in managed code has always been a big "no no" because shell extensions get loaded into any process that shows the common file dialogs. This can cause merry chaos as, up until .net 4.0, only one version of the CLR can be loaded into a process, so you have to be very sure before doing this. Given that .net 4.0 supports in-process side by side, this may not be an issue for you.
No. To Windows, an XML file is an XML file. The OS doesn't look inside to see what namespace is associated with it; it's just an XML file.
Windows associates file types with their extension, so again, all XML files are XML files. You can see this for yourself: rename a normal .txt file that contains absolutely no XML, and then refresh the view of it's folder in Explorer. You'll see the icon change from a text file image to an XML file image.
There isn't a way that you can do this without having custom extensions or an intermediary program.
Maybe one option would be to have a custom applicaiton which is assigned to handle XML files. When this is program is spawned it works out what the "type" of the file is using one of the XML tags and spawns the correct process accordingly. It's unlikely, however that you can give different "types" different icons.

How to get my program name in list of right click menu on any file

I have created a File/folder copy utility in C#.net. its working fine. problem is that when i right click on folder than my program's name appear their and its also working fine. but when i right click on any file or group of files and folder. so tell me which and where i need to create a registry key through my program so i can do that.
Not sure I understand the question, but here are some links that might help:
Registering File Types:
How to associate a file extension to the current executable in C#
Filetype association with application (C#)
Windows Shell Integration:
Windows Shell Integration using .NET
http://www.codeproject.com/KB/cs/dateparser.aspx

Categories

Resources