[导入]How to play a flash with C#
2005-09-06 01:47
525 查看
How to play a flash with C#
First of all, you should know flash is a ActiveX controls, so it's has the common interface like other ActiveX controls. But the C#, is running in the protected environment, so you can not use the ActiveX Controls such as COM controls like the way in VC++. But, it's also very easy to use it.
Firt, set a new project, just windows appliction.
Second, you can add the Flash control to your tool bar. Please be sure, your computer must be set up this ActiveX control. You can find the file (Flash.ocx) on your computer in the directory of "C:\WINDOWS\system32\Macromed\Flash\Flash.ocx". Add it.
Then, your can drag the ActriveX controls to your Windows application like other controls. After that, you can set some property for is. You muset set the file path(must be full path) to play the SWF file. You also can add the SWF file into your application, but it will increase the size of you project(maybe very large).
Give another secret, there is a file GetFlash.exe at your computer(if you have set up the Flash Control). The pathe is: "C:\WINDOWS\system32\Macromed\Flash\", you can get update the FlashPlayer by run this file, is can update your FlashPlayer automately.
You can fliter the keyboard message by setting the property of the Form. But I have not find anyway to filter the message which send by right button of mouse in C#, but it is very easily to do this in C++.
Filter the keyboard message.
First, set the property.
this.KeyPreview = true;
This property is false by default, the form will not to filter the keyboard message when this propterty is "false". Then you should wirte a function to filter the message.
private void Form1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
}
private void Form1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
}
private void Form1_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
{
}
This three funcitons should be defined and do something which you whant to filter the message. You can set the "e.Handled = true;", that means, the message have been disposal, then the child Control will nolonger to deal with this message.
For example, you can filter some speciall KeyCode like this:
if(e.KeyCode==32)
{
//to do something
e.Handled = true;
}
OK, I will find anyway to filter the
文章来源:http://computer.mblogger.cn/wucountry/posts/45358.aspx
First of all, you should know flash is a ActiveX controls, so it's has the common interface like other ActiveX controls. But the C#, is running in the protected environment, so you can not use the ActiveX Controls such as COM controls like the way in VC++. But, it's also very easy to use it.
Firt, set a new project, just windows appliction.
Second, you can add the Flash control to your tool bar. Please be sure, your computer must be set up this ActiveX control. You can find the file (Flash.ocx) on your computer in the directory of "C:\WINDOWS\system32\Macromed\Flash\Flash.ocx". Add it.
Then, your can drag the ActriveX controls to your Windows application like other controls. After that, you can set some property for is. You muset set the file path(must be full path) to play the SWF file. You also can add the SWF file into your application, but it will increase the size of you project(maybe very large).
Give another secret, there is a file GetFlash.exe at your computer(if you have set up the Flash Control). The pathe is: "C:\WINDOWS\system32\Macromed\Flash\", you can get update the FlashPlayer by run this file, is can update your FlashPlayer automately.
You can fliter the keyboard message by setting the property of the Form. But I have not find anyway to filter the message which send by right button of mouse in C#, but it is very easily to do this in C++.
Filter the keyboard message.
First, set the property.
this.KeyPreview = true;
This property is false by default, the form will not to filter the keyboard message when this propterty is "false". Then you should wirte a function to filter the message.
private void Form1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
}
private void Form1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
}
private void Form1_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
{
}
This three funcitons should be defined and do something which you whant to filter the message. You can set the "e.Handled = true;", that means, the message have been disposal, then the child Control will nolonger to deal with this message.
For example, you can filter some speciall KeyCode like this:
if(e.KeyCode==32)
{
//to do something
e.Handled = true;
}
OK, I will find anyway to filter the
文章来源:http://computer.mblogger.cn/wucountry/posts/45358.aspx
相关文章推荐
- How to create a DLL library in C and then use it with C#
- How to Play '.rm' files with RhythmBox in Ubuntu?
- [导入]Flex with Visual SourceSafe how-to :让Flex支持VSS
- How to create a PictureMarkerSymbol (Picture Symbol)in ArcGIS server with C#
- Some tips about how to reverse Array with C#
- How to attach to Browser Helper Object (BHO) with C# in two minutes
- How to install Android SDK and play with Android 2.0 in the emulator
- Excel: How to run C# code behind with a click of a button on a Worksheet, without VBA code
- How to Insert OLE Object (Adobe Acrobat Document) in Word with C#(如何使用C#在Word中插入OLE对象-PDF文件)
- How to create a PictureMarkerSymbol (Picture Symbol)in ArcGIS server with C#
- How To Read and Write BLOB Data by Using ADO.NET with Visual C# .NET
- Linux/Ubuntu How to play with Vim(持续更新)
- how to create dynamically crystal roporter with C# code
- How to play video with AVPlayerViewController (AVKit) in Swift
- How to create a DLL library in C and then use it with C#
- How to Set Word Document Properties with C#
- How to play '.rm' files with RhythmBox in Ubutu?
- How To Read and Write BLOB Data by Using ADO.NET with Visual C# .NET
- How to populate the datagrid on background thread with data binding by using Visual C#
- How to train models of Object Detection with Discriminatively Trained Part Based Models