Esempio n. 1
0
 public Monitor()
 {
     InitializeComponent();
     DefaultNonClickTransparencyKey = this.TransparencyKey;
     DefaultBorderStyle             = this.FormBorderStyle;
     ThumbnailPanel = new ThumbnailPanel
     {
         Location = Point.Empty,
         Dock     = DockStyle.Fill
     };
     Controls.Add(ThumbnailPanel);
     this.KeyPreview = true;
     WindowSeeker    = new TaskWindowSeeker()
     {
         OwnerHandle           = this.Handle,
         SkipNotVisibleWindows = true
     };
     //分水岭
     taskIcon = new NotifyIcon
     {
         Text             = "窗体监控",
         Icon             = Icon,
         Visible          = true,
         ContextMenuStrip = MenuStrip
     };
     taskIcon.DoubleClick += new EventHandler(TaskIcon_doubleclick);
     ContextMenuStrip      = MenuStrip;//传递指针进来构造的,不给右键菜单
     ShowInTaskbar         = true;
 }
Esempio n. 2
0
        public Monitor(IntPtr h)
        {
            InitializeComponent();
            DefaultNonClickTransparencyKey = this.TransparencyKey;
            DefaultBorderStyle             = this.FormBorderStyle;

            ThumbnailPanel = new ThumbnailPanel
            {
                Location = Point.Empty,
                Dock     = DockStyle.Fill
            };
            Controls.Add(ThumbnailPanel);
            this.KeyPreview = true;

            WindowSeeker = new TaskWindowSeeker()
            {
                OwnerHandle           = this.Handle,
                SkipNotVisibleWindows = true
            };
            WindowHandle w = new WindowHandle(h);

            this.SetThumbnail(w, null);
        }