コアコードその一
WebBrowser 埋め込み済みの Form 派生クラスWin

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;

namespace ak5
{
    public abstract class Win : Form
    {
        //public abstract uint vfMemSize() { return 0; }

        public Win()
        { sfInitializeCommon(this, !isRelease, null, null, false, null, null); }

        //public Win(dfProcessCommandLine idfProcessCommandLine, String mutexName)
        //{ sfInitializeCommon(this, !isRelease, idfProcessCommandLine, mutexName, false, null, null); }

        //public Win(String mutexName, String homeUrl, String InitailUri)
        //{ sfInitializeCommon(this, !isRelease, null, mutexName, true, homeUrl, InitailUri); }

        //public Win(String homeUrl, String InitailUri)
        //{ sfInitializeCommon(this, !isRelease, null , null, true, homeUrl, InitailUri); }

        public Win(bool isDebug, dfProcessCommandLine idfProcessCommandLine, String mutexName, bool haveWeb, String homeUrl, String InitailUri)
        { sfInitializeCommon(this, isDebug, idfProcessCommandLine, mutexName, haveWeb, homeUrl, InitailUri); }

        public delegate bool dfProcessCommandLine(String[] args, ref String mutexName, ref bool haveWeb, ref String homeUrl, ref String InitailUri);
       
        protected static void sfInitializeCommon(Win f, bool isDebug, dfProcessCommandLine idfProcessCommandLine, String mutexName, bool haveWeb, String homeUrl, String InitailUri)
        {
           
            isRelease = !isDebug;
            if (sWins == null)
            {
                bool isDone = false;
                if (idfProcessCommandLine != null)
                { isDone = idfProcessCommandLine(System.Environment.GetCommandLineArgs(), ref mutexName, ref haveWeb, ref homeUrl, ref InitailUri); }
                if (!String.IsNullOrEmpty(mutexName))
                {
                    sMutexWin = new System.Threading.Mutex(false, mutexName);
                    if (sMutexWin.WaitOne(0, false) == false)
                    { isDone = true; }
                }
                if (isDone)
                {
                    System.Diagnostics.Process.GetCurrentProcess().Close();
                    System.Diagnostics.Process.GetCurrentProcess().Kill();
                }
                sWins = new List<Win>();
                Screen[] all = Screen.AllScreens;
                monCount = all.Length;
                mons = new Rectangle[monCount + 1];
                mons[monCount] = Screen.PrimaryScreen.WorkingArea;
                monUse = 0;
                for (int i = 0; i < monCount; i++)
                {
                    mons[i] = all[i].Bounds;
                    if (all[i].Primary) { monPri = i; }
                    if (mons[i].Left > mons[monUse].Left) { monUse = i; }
                    if (mons[i].Left == mons[monUse].Left) { if (mons[i].Top < mons[monUse].Top) { monUse = i; } }
                }
            }
            sWins.Add(f);
            if (isRelease)
            {
                f.Opacity = 0;
                f.ShowInTaskbar = false;
            }
            f.FormBorderStyle = FormBorderStyle.None;
            f.BackColor = Color.FromArgb(255, 255, 254);
            //if (isRelease) { f.TransparencyKey = f.BackColor; }
            f.StartPosition = FormStartPosition.Manual;
            f.Bounds = mons[monUse];
            //f.Icon = Properties.Resources.ico_quick;
            int div = 3;
            f.Width = 1920 / div;
            for (int i = 0; i < sWins.Count; i++)
            { if (f == sWins[i]) { f.Left += (f.Width * (i % div)); } }
            f.urlHome = homeUrl;
            f.urlInitial = InitailUri;
            if (haveWeb)
            {
                WebBrowser c = new WebBrowser();
                f.mWeb = c;
                f.Controls.Add(c);
                c.Dock = DockStyle.Fill;
                c.BringToFront();
                f.mWeb.Navigating += mWeb_Navigating;
                f.mWeb.DocumentCompleted += mWeb_DocumentCompleted;
                if (!String.IsNullOrEmpty(f.urlInitial)) { c.Navigate(f.urlInitial); }
            }
            f.BringToFront();
        }

        protected static void mWeb_Navigating(Object o, WebBrowserNavigatingEventArgs e)
        { (((WebBrowser)o).FindForm()).Text = e.Url.ToString(); }

        protected static void mWeb_DocumentCompleted(Object o, WebBrowserDocumentCompletedEventArgs e)
        {
            WebBrowser c = (WebBrowser)o;
            String title = String.Empty;
            if (c.Document != null)
            { title = c.Document.Title; }
            if (String.IsNullOrEmpty(title)) { (c.FindForm()).Text = e.Url.ToString(); }
            else { (c.FindForm()).Text = title; }
        }

        protected override void OnClosed(EventArgs e)
        {
            if (this == sWins[0])
            {
                for (int i = (sWins.Count - 1); i == 1; i--)
                { sWins[i].Close(); }
                if (sMutexWin != null) { sMutexWin.Close(); sMutexWin = null; }
            }
            sWins.Remove(this);
            if (sWins.Count == 0) { sWins = null; }
            base.OnClosed(e);
        }

        public WebBrowser mWeb;
        protected String urlHome, urlInitial;
        public static bool isRelease = false;
        protected static List<Win> sWins;
        public static void sfQuit() { sWins[0].Close(); }
        protected static int monCount, monPri, monUse;
        protected static Rectangle[] mons;
        private static System.Threading.Mutex sMutexWin;
    }
}

This article's copyright goes Akitsugu Tomisawa but riabilities stays with me, Yoshiyuki Yamaguchi.  As I owe some cash fto him.

Byebye Windows....
  Well, finally I had to give up when I saw JST Clock turned into UTC Clock few times.
Before, I used to use C# on mshtml (IE11) to auto drive web site....

  Now, I think I'm ready to move into Linux (hope I don't have to go netBSD which I'm getting ready by ordering Raspberry Pi 2 Board.)

Hardware:
  All started with N3150-ITX board from ASRock ( http://shop.tsukumo.co.jp/goods/4537694200714/201750010600000 it come from 2 year warranty from Japanese importer) and Apple Music which I had to discontinue subscription by not able to manage devices under Windows 10 (I do believe most of my problem is coming from UEFI).  I was nice quiet system with US$16 Power Supply ( http://www.aliexpress.com/item/Z2-ATX-120-120W-Power-Supply-Module-20pin-mini-ITX-DC-ATX-PICO-BOX-DC-ATX/32271887292.html ) , but unstable, mostly because of Microsoft.

Platform
  I do believe this is the time when things start changing by finishing capitalism, again.  Do not surprise, yes from Roman Empire (Christian) side, this is first "World Strikes Back" (Yes Roman Empire System got first strikes back after breaking revenge siege from Cartago, which is called as Sunni Muslim, by reconquista).  But from world side, it always happen after fight is over.  After recoverly, rised strong demnad got ceased and supply surplus begin.  So, we are getting ready to start having new generation of farmers (exchanging surplus production to hold and grow personal happiness of living.)  Society is backing into Age of Robin Hood.  So, I've decided to pick-up my first arrow into this stage to be multi core ARM v7 with multi core OpenGL ES 2.0.
  Still, most of current fruit is origined from KDE, so my working platform will KUbuntu 15.04 on amd64 with beautiful and stupid Plasma where tools and methods are full.  But I can stay there quite short as departing platform like Lisa.  I do believe Microsoft has done great job but with fundamental mistake they focused into wrong 48 bit (IP V4+ports) and stupid 128 bit (IP V6).  Real adress still stay same 48 bit MAC address (both wired and wireless) but since I start working with network with AppleTalk PhoneNet and 10Base5, wireless seems quite close to 10Base5 which required physical protection of terminals and cables, so I have to spend effort to detect, remove and control 2.4 & 5 GHz devices.
  That is the reason I picked up my first Orange Pi mini 2 (I did not like wifi which is unable to remove) after disappointed performance experience with Raspberry PI model B.  Which I regretted by not being able to behave as Miracast device.  But 15.04 MATE image did good....  So, I decided to focus in Ubuntu 15.04 on Orange PI PC.

Which image to start
  MATE was fun.  But removing something out of UNIX like system is always nightmare.  In the first place that's is the reqason why I decided to work on boot from SD type of device.  Image is eazy to back up and rollback after trial modification.  So, I start working with Ubuntu_vivid_mini.img.xz image by Boris Lovošević on Aug 29, 2015 ( http://www.orangepi.org/orangepibbsen/forum.php?mod=viewthread&tid=342 ) and placed smple of Orange PI PC (http://www.aliexpress.com/item/Orange-Pi-PC-set-3-Orange-Pi-PC-Transparent-ABS-Case-USB-to-DC-4-0MM/32451086788.html) I ordered with USB cable since removing power plug was quite painful on AC adaptor in Orange PI mini 2 and I am too razy to reach for swtch of power tap.  Unlike raspberry PI it woll work on HDMI-DVI cable but resolution is limited to 1080p and 720P, so I could not use my favorite light weight monitor which resolution is 1600 by 900, I decided to stay with 1080P.

So, this is start point I'll start uploading generic image for my memory by time by time.

This article's copyright goes Akitsugu Tomisawa and he hold all copyrights reserved, but liabilities stays with me, Yoshiyuki Yamaguchi.  As I owe daily cash fto him.

↑このページのトップヘ