using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
namespace dotNet
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private AxShockwaveFlashObjects.AxShockwaveFlash axShockwaveFlash1;
private Splash splash;
private System.ComponentModel.Container components = null;
public Form1()
{
InitializeComponent();
String swfPath = Directory.GetCurrentDirectory() +
Path.DirectorySeparatorChar + "menubar.swf";
this.axShockwaveFlash1.EmbedMovie = true;
this.axShockwaveFlash1.Movie = swfPath;
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
this.axShockwaveFlash1 = new AxShockwaveFlashObjects.AxShockwaveFlash();
this.splash = new dotNet.Splash();
((System.ComponentModel.ISupportInitialize)(this.a xShockwaveFlash1)).BeginInit();
this.SuspendLayout();
//
// axShockwaveFlash1
//
this.axShockwaveFlash1.Dock = System.Windows.Forms.DockStyle.Fill;
this.axShockwaveFlash1.Enabled = true;
this.axShockwaveFlash1.Name = "axShockwaveFlash1";
this.axShockwaveFlash1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.Get Object("axShockwaveFlash1.OcxState")));
this.axShockwaveFlash1.Size = new System.Drawing.Size(488, 322);
this.axShockwaveFlash1.TabIndex = 0;
this.axShockwaveFlash1.FSCommand += new AxShockwaveFlashObjects._IShockwaveFlashEvents_FSC ommandEventHandler(this.FlashFSCommand);
//
// splash
//
this.splash.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.splash.ClientSize = new System.Drawing.Size(300, 150);
this.splash.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.splash.Icon = ((System.Drawing.Icon)(resources.GetObject("splash .Icon")));
this.splash.Location = new System.Drawing.Point(360, 320);
this.splash.MaximumSize = new System.Drawing.Size(0, 0);
this.splash.MinimumSize = new System.Drawing.Size(0, 0);
this.splash.Name = "splash";
this.splash.Opacity = 1;
this.splash.ShowInTaskbar = false;
this.splash.StartPosition = System.Windows.Forms.FormStartPosition.CenterScree n;
this.splash.Text = "Splash";
this.splash.TopMost = true;
this.splash.Visible = false;
this.splash.VisibleChanged += new System.EventHandler(this.splash_VisibleChanged);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(488, 322);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.axShockwaveFlash1});
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this. Icon")));
this.Name = "Form1";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScree n;
this.Text = "Form1";
((System.ComponentModel.ISupportInitialize)(this.a xShockwaveFlash1)).EndInit();
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private const int WM_MOUSEACTIVATE = 0x0021;
private const int HTCAPTION = 0x2;
protected override void WndProc(ref Message m)
{
if(m.Msg == WM_MOUSEACTIVATE)
{
if(m.LParam.ToInt32()==0x2040001)
{
m.Result = new IntPtr(HTCAPTION);
}
}
else
base.WndProc(ref m);
}
private void FlashFSCommand(object sender, AxShockwaveFlashObjects._IShockwaveFlashEvents_FSC ommandEvent e)
{
switch (e.command)
{
case "quit":
Application.Exit();
break;
case "about":
splash.Show();
this.Enabled = false;
break;
default:
break;
}
}
private void splash_VisibleChanged(object sender, System.EventArgs e)
{
if(this.splash.Visible == false)
this.Enabled = true;
}
}
}