📄 form1.h
字号:
#pragma once
/*
Created by Nimesha Ranasinghe
Undergraduate
Faculty of Information Technology
University of Moratuwa
Sri Lanka
*/
namespace EasyMotionDetection
{
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
/// <summary>
/// Summary for Form1
///
/// WARNING: If you change the name of this class, you will need to change the
/// 'Resource File Name' property for the managed resource compiler tool
/// associated with all .resx files this class depends on. Otherwise,
/// the designers will not be able to interact properly with localized
/// resources associated with this form.
/// </summary>
public __gc class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
String* file;
String* sFlashPath = System::Environment::CurrentDirectory;
String* sCurrentDir = sFlashPath;
//set path of GUI
file = new String("\\detector.swf");
sFlashPath = String::Concat(sFlashPath, file);
iStartApp = 0;
//load Main detector GUI
axShockwaveFlash1->LoadMovie(0, sFlashPath);
}
protected:
void Dispose(Boolean disposing)
{
if (disposing && components)
{
components->Dispose();
}
__super::Dispose(disposing);
}
private: AxInterop::ShockwaveFlashObjects::AxShockwaveFlash * axShockwaveFlash1;
private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container * components;
static int iStartApp; //seperate the starting & receiving
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
System::Resources::ResourceManager * resources = new System::Resources::ResourceManager(__typeof(EasyMotionDetection::Form1));
this->axShockwaveFlash1 = new AxInterop::ShockwaveFlashObjects::AxShockwaveFlash();
(__try_cast<System::ComponentModel::ISupportInitialize * >(this->axShockwaveFlash1))->BeginInit();
this->SuspendLayout();
//
// axShockwaveFlash1
//
this->axShockwaveFlash1->Enabled = true;
this->axShockwaveFlash1->Location = System::Drawing::Point(2, 2);
this->axShockwaveFlash1->Name = S"axShockwaveFlash1";
this->axShockwaveFlash1->OcxState = (__try_cast<System::Windows::Forms::AxHost::State * >(resources->GetObject(S"axShockwaveFlash1.OcxState")));
this->axShockwaveFlash1->Size = System::Drawing::Size(640, 480);
this->axShockwaveFlash1->TabIndex = 0;
this->axShockwaveFlash1->FSCommand += new AxInterop::ShockwaveFlashObjects::_IShockwaveFlashEvents_FSCommandEventHandler(this, axShockwaveFlash1_FSCommand);
//
// Form1
//
this->AutoScaleBaseSize = System::Drawing::Size(5, 13);
this->ClientSize = System::Drawing::Size(644, 484);
this->Controls->Add(this->axShockwaveFlash1);
this->Icon = (__try_cast<System::Drawing::Icon * >(resources->GetObject(S"$this.Icon")));
this->Name = S"Form1";
this->Text = S"Live Easy Motion Detector";
(__try_cast<System::ComponentModel::ISupportInitialize * >(this->axShockwaveFlash1))->EndInit();
this->ResumeLayout(false);
}
private: System::Void axShockwaveFlash1_FSCommand(System::Object * sender, AxInterop::ShockwaveFlashObjects::_IShockwaveFlashEvents_FSCommandEvent * e)
{
//I just add this 5 source lines only
iStartApp++;
if(iStartApp == 1)
{
/*this is when app starting called*/
MessageBox::Show("Application Started.");
}
else
{
//motion detected
MessageBox::Show(e->command);
}
}
};
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -