public SubClassManager(WindowsManager owner) { _wm = owner; Type enumType = typeof(NativeMethods.Msgs); Array msgArray = Enum.GetValues(enumType); msgValues = new Dictionary <NativeMethods.Msgs, string>(msgArray.Length); for (int i = 0; i < msgArray.Length; i++) { NativeMethods.Msgs value = (NativeMethods.Msgs)msgArray.GetValue(i); string name = Enum.GetName(enumType, value); if (msgValues.ContainsKey(value)) { msgValues[value] = name; } else { msgValues.Add(value, name); } } // create Listener control which we will use to interact with the hooked window listener = new ListenerControl(this); listener.Show(); //_Breakpoints = new Dictionary<NativeMethods.Msgs, MessageBreakpoint>(); }
private void DlgCropImage_MouseUp(object sender, MouseEventArgs e) { if (bMouseDown) { bMouseDown = false; if (rc != Rectangle.Empty) { ControlPaint.DrawReversibleFrame(rc, Color.Black, FrameStyle.Dashed); rc = Rectangle.Empty; } x1 = e.X; y1 = e.Y; int x3; int x2; if (x0 > x1) { x2 = x1; x3 = x0; } else { x2 = x0; x3 = x1; } int y3; int y2; if (y0 > y1) { y2 = y1; y3 = y0; } else { y2 = y0; y3 = y1; } if (x3 != x2 && y3 != y2) { int w = x3 - x2; int h = y3 - y2; if (x2 >= 0 && x3 < _cropped.Width && y2 >= 0 && y3 < _cropped.Height) { _cropped = WindowsManager.CropImage(BackgroundImage, new Rectangle(x2, y2, w, h)); BackgroundImage = _cropped; } } } }
private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); this.ButtonInsert = new System.Windows.Forms.Button(); this.ButtonName = new System.Windows.Forms.Button(); this.Label10 = new System.Windows.Forms.Label(); this.Label9 = new System.Windows.Forms.Label(); this.GroupBox1 = new System.Windows.Forms.GroupBox(); this.Label8 = new System.Windows.Forms.Label(); this.Label7 = new System.Windows.Forms.Label(); this.Label6 = new System.Windows.Forms.Label(); this.Label4 = new System.Windows.Forms.Label(); this.Label5 = new System.Windows.Forms.Label(); this.btInsert = new System.Windows.Forms.Button(); this.txtName = new System.Windows.Forms.TextBox(); this.Label3 = new System.Windows.Forms.Label(); this.txtIndex = new System.Windows.Forms.TextBox(); this.Label2 = new System.Windows.Forms.Label(); this.btFolder = new System.Windows.Forms.Button(); this.Label1 = new System.Windows.Forms.Label(); this.txtFolder = new System.Windows.Forms.TextBox(); this.Keyboard1 = new Limnor.InputDevice.Keyboard(); this.ApplicationConfiguration1 = new Limnor.Application.ApplicationConfiguration(); this.components = new System.ComponentModel.Container(); this.NotifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components); this.mi1e23a49e = new System.Windows.Forms.ToolStripMenuItem(); this.ShowSettingsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ContextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); this.WindowsManager1 = new Limnor.Windows.WindowsManager(this.components); this.ToolStripMenuItem2147483646 = new System.Windows.Forms.ToolStripSeparator(); this.ExitMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.GroupBox1.SuspendLayout(); this.ContextMenuStrip1.SuspendLayout(); this.SuspendLayout(); // // ButtonInsert // this.ButtonInsert.Location = new System.Drawing.Point(256, 62); this.ButtonInsert.Name = "ButtonInsert"; this.ButtonInsert.Size = new System.Drawing.Size(75, 23); this.ButtonInsert.TabIndex = 34; this.ButtonInsert.Text = "Insert Slide"; this.ButtonInsert.UseVisualStyleBackColor = true; this.ButtonInsert.Click += new System.EventHandler(this.Click_ad2f4fda); // // ButtonName // this.ButtonName.Anchor = System.Windows.Forms.AnchorStyles.Right; this.ButtonName.Location = new System.Drawing.Point(341, 36); this.ButtonName.Name = "ButtonName"; this.ButtonName.Size = new System.Drawing.Size(29, 23); this.ButtonName.TabIndex = 31; this.ButtonName.Text = "..."; this.ButtonName.UseVisualStyleBackColor = true; this.ButtonName.Click += new System.EventHandler(this.Click_a5d061c7); // // Label10 // this.Label10.AutoSize = true; this.Label10.Location = new System.Drawing.Point(12, 128); this.Label10.Name = "Label10"; this.Label10.Size = new System.Drawing.Size(215, 13); this.Label10.TabIndex = 30; this.Label10.Text = "Slide # starts from 1 and sequentially go up.."; // // Label9 // this.Label9.AutoSize = true; this.Label9.Location = new System.Drawing.Point(12, 104); this.Label9.Name = "Label9"; this.Label9.Size = new System.Drawing.Size(267, 13); this.Label9.TabIndex = 29; this.Label9.Text = "In one slide-show, all slides have the same Slide Name."; // // GroupBox1 // this.GroupBox1.Controls.Add(this.Label8); this.GroupBox1.Controls.Add(this.Label7); this.GroupBox1.Controls.Add(this.Label6); this.GroupBox1.Controls.Add(this.Label4); this.GroupBox1.Controls.Add(this.Label5); this.GroupBox1.Location = new System.Drawing.Point(15, 150); this.GroupBox1.Name = "GroupBox1"; this.GroupBox1.Size = new System.Drawing.Size(348, 126); this.GroupBox1.TabIndex = 26; this.GroupBox1.TabStop = false; this.GroupBox1.Text = "How to create slides"; // // Label8 // this.Label8.AutoSize = true; this.Label8.Location = new System.Drawing.Point(6, 100); this.Label8.Name = "Label8"; this.Label8.Size = new System.Drawing.Size(313, 13); this.Label8.TabIndex = 26; this.Label8.Text = "3. Add texts, lines, arrows, etc., to the captured image as needed"; // // Label7 // this.Label7.AutoSize = true; this.Label7.Location = new System.Drawing.Point(16, 83); this.Label7.Name = "Label7"; this.Label7.Size = new System.Drawing.Size(292, 13); this.Label7.TabIndex = 25; this.Label7.Text = "You may cancel the clipping and redo the clipping if needed."; // // Label6 // this.Label6.AutoSize = true; this.Label6.Location = new System.Drawing.Point(6, 66); this.Label6.Name = "Label6"; this.Label6.Size = new System.Drawing.Size(278, 13); this.Label6.TabIndex = 24; this.Label6.Text = "2. Use the mouse to clip the captured image, if you want. "; // // Label4 // this.Label4.AutoSize = true; this.Label4.Location = new System.Drawing.Point(6, 27); this.Label4.Name = "Label4"; this.Label4.Size = new System.Drawing.Size(298, 13); this.Label4.TabIndex = 20; this.Label4.Text = "1. Keep the mouse over the window to be captured, press F3."; // // Label5 // this.Label5.AutoSize = true; this.Label5.Location = new System.Drawing.Point(16, 48); this.Label5.Name = "Label5"; this.Label5.Size = new System.Drawing.Size(202, 13); this.Label5.TabIndex = 23; this.Label5.Text = "Or, press F4 to capture the whole screen."; // // btInsert // this.btInsert.Location = new System.Drawing.Point(175, 62); this.btInsert.Name = "btInsert"; this.btInsert.Size = new System.Drawing.Size(75, 23); this.btInsert.TabIndex = 17; this.btInsert.Text = "Edit Slide"; this.btInsert.UseVisualStyleBackColor = true; this.btInsert.Click += new System.EventHandler(this.Click_9a8faed9); // // txtName // this.txtName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtName.Location = new System.Drawing.Point(100, 38); this.txtName.Name = "txtName"; this.txtName.Size = new System.Drawing.Size(235, 20); this.txtName.TabIndex = 12; // // Label3 // this.Label3.AutoSize = true; this.Label3.Location = new System.Drawing.Point(15, 45); this.Label3.Name = "Label3"; this.Label3.Size = new System.Drawing.Size(64, 13); this.Label3.TabIndex = 11; this.Label3.Text = "Slide Name:"; // // txtIndex // this.txtIndex.Location = new System.Drawing.Point(100, 64); this.txtIndex.Name = "txtIndex"; this.txtIndex.Size = new System.Drawing.Size(69, 20); this.txtIndex.TabIndex = 8; // // Label2 // this.Label2.AutoSize = true; this.Label2.Location = new System.Drawing.Point(15, 71); this.Label2.Name = "Label2"; this.Label2.Size = new System.Drawing.Size(68, 13); this.Label2.TabIndex = 7; this.Label2.Text = "Next Slide #:"; // // btFolder // this.btFolder.Anchor = System.Windows.Forms.AnchorStyles.Right; this.btFolder.Location = new System.Drawing.Point(341, 11); this.btFolder.Name = "btFolder"; this.btFolder.Size = new System.Drawing.Size(29, 23); this.btFolder.TabIndex = 4; this.btFolder.Text = "..."; this.btFolder.UseVisualStyleBackColor = true; this.btFolder.Click += new System.EventHandler(this.Click_d2e530ca); // // Label1 // this.Label1.AutoSize = true; this.Label1.Location = new System.Drawing.Point(15, 21); this.Label1.Name = "Label1"; this.Label1.Size = new System.Drawing.Size(79, 13); this.Label1.TabIndex = 3; this.Label1.Text = "Save to Folder:"; // // txtFolder // this.txtFolder.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtFolder.Location = new System.Drawing.Point(100, 14); this.txtFolder.Name = "txtFolder"; this.txtFolder.Size = new System.Drawing.Size(235, 20); this.txtFolder.TabIndex = 2; // // Keyboard1 // this.Keyboard1.HotKeys = ((Limnor.InputDevice.HotKeyList)(resources.GetObject("Keyboard1.HotKeys"))); this.Keyboard1.Location = new System.Drawing.Point(249, 128); this.Keyboard1.Name = "Keyboard1"; this.Keyboard1.GetEventHolder("KeyPress_F4").Event += new System.EventHandler(this.KeyPress_F4_8b2ce384); this.Keyboard1.GetEventHolder("KeyPress_F3").Event += new System.EventHandler(this.KeyPress_F3_3b54cbf2); // // NotifyIcon1 // this.NotifyIcon1.BalloonTipText = "Catch screenshot"; this.NotifyIcon1.BalloonTipTitle = "Catch screenshot"; this.NotifyIcon1.ContextMenuStrip = this.ContextMenuStrip1; this.NotifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("NotifyIcon1.Icon"))); this.NotifyIcon1.Text = "ScreenShot"; this.NotifyIcon1.Visible = true; // // mi1e23a49e // this.mi1e23a49e.BackColor = System.Drawing.SystemColors.Window; this.mi1e23a49e.Name = "mi1e23a49e"; this.mi1e23a49e.Size = new System.Drawing.Size(106, 20); this.mi1e23a49e.Text = "ContextMenuStrip"; // // ShowSettingsMenuItem // this.ShowSettingsMenuItem.Name = "ShowSettingsMenuItem"; this.ShowSettingsMenuItem.Size = new System.Drawing.Size(148, 22); this.ShowSettingsMenuItem.Text = "Show Settings"; this.ShowSettingsMenuItem.Click += new System.EventHandler(this.Click_8f7ed9a5); // // ContextMenuStrip1 // this.ContextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.ShowSettingsMenuItem, this.ToolStripMenuItem2147483646, this.ExitMenuItem }); this.ContextMenuStrip1.Name = "ContextMenuStrip1"; this.ContextMenuStrip1.Size = new System.Drawing.Size(149, 54); // // WindowsManager1 // this.WindowsManager1.FoundWindow = System.IntPtr.Zero; this.WindowsManager1.WindowBounds = new System.Drawing.Rectangle(0, 0, 0, 0); this.WindowsManager1.WindowLocation = new System.Drawing.Point(0, 0); this.WindowsManager1.WindowSize = new System.Drawing.Size(0, 0); // // ToolStripMenuItem2147483646 // this.ToolStripMenuItem2147483646.Name = "ToolStripMenuItem2147483646"; this.ToolStripMenuItem2147483646.Size = new System.Drawing.Size(145, 6); // // ExitMenuItem // this.ExitMenuItem.Name = "ExitMenuItem"; this.ExitMenuItem.Size = new System.Drawing.Size(148, 22); this.ExitMenuItem.Text = "E&xit"; this.ExitMenuItem.Click += new System.EventHandler(this.Click_a3e4ba47); // // Form1 // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.ClientSize = new System.Drawing.Size(375, 288); this.Controls.Add(this.ButtonInsert); this.Controls.Add(this.ButtonName); this.Controls.Add(this.Label10); this.Controls.Add(this.Label9); this.Controls.Add(this.GroupBox1); this.Controls.Add(this.btInsert); this.Controls.Add(this.txtName); this.Controls.Add(this.Label3); this.Controls.Add(this.txtIndex); this.Controls.Add(this.Label2); this.Controls.Add(this.btFolder); this.Controls.Add(this.Label1); this.Controls.Add(this.txtFolder); this.Controls.Add(this.Keyboard1); this.DrawingLayerList = ((Limnor.Drawing2D.DrawingLayerHeaderList)(resources.GetObject("$this.DrawingLayerList"))); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Location = new System.Drawing.Point(100, 100); this.MaximizeBox = false; this.Name = "Form1"; this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; this.Text = "Slides Maker"; this.GroupBox1.ResumeLayout(false); this.GroupBox1.PerformLayout(); this.ContextMenuStrip1.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); this.SizeChanged += new System.EventHandler(this.SizeChanged_53e488c2); Limnor.Application.ApplicationConfiguration.LoadingConfigurations += new System.EventHandler(this.LoadingConfigurations_3165520d); this.Load += new System.EventHandler(this.Load_e3a67207); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormClosing_5a01dd65); Limnor.Application.ApplicationConfiguration.SavingConfigurations += new System.EventHandler(this.SavingConfigurations_7e20ca90); }
public ListenerForm(WindowsManager owner) { _owner = owner; }