diff --git a/EntryList.cs b/EntryList.cs index f6af196..de388bf 100755 --- a/EntryList.cs +++ b/EntryList.cs @@ -11,6 +11,7 @@ public class Entry { public string Target { get; set; } + public string Arguments { get; set; } public string Icon { get; set; } public int IconIndex { get; set; } public string Name { get; set; } diff --git a/EntryList.cs b/EntryList.cs index f6af196..de388bf 100755 --- a/EntryList.cs +++ b/EntryList.cs @@ -11,6 +11,7 @@ public class Entry { public string Target { get; set; } + public string Arguments { get; set; } public string Icon { get; set; } public int IconIndex { get; set; } public string Name { get; set; } diff --git a/ShortcutUtil/MainForm.Designer.cs b/ShortcutUtil/MainForm.Designer.cs index dee63e1..3f2c089 100755 --- a/ShortcutUtil/MainForm.Designer.cs +++ b/ShortcutUtil/MainForm.Designer.cs @@ -43,9 +43,10 @@ // defaultShortcutLabel // this.defaultShortcutLabel.AutoSize = true; - this.defaultShortcutLabel.Location = new System.Drawing.Point(14, 75); + this.defaultShortcutLabel.Location = new System.Drawing.Point(19, 94); + this.defaultShortcutLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.defaultShortcutLabel.Name = "defaultShortcutLabel"; - this.defaultShortcutLabel.Size = new System.Drawing.Size(169, 20); + this.defaultShortcutLabel.Size = new System.Drawing.Size(226, 25); this.defaultShortcutLabel.TabIndex = 0; this.defaultShortcutLabel.Text = "Select default shortcut"; // @@ -56,9 +57,10 @@ | System.Windows.Forms.AnchorStyles.Right))); this.entryListBox.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable; this.entryListBox.FormattingEnabled = true; - this.entryListBox.Location = new System.Drawing.Point(16, 98); + this.entryListBox.Location = new System.Drawing.Point(21, 122); + this.entryListBox.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.entryListBox.Name = "entryListBox"; - this.entryListBox.Size = new System.Drawing.Size(770, 316); + this.entryListBox.Size = new System.Drawing.Size(1025, 394); this.entryListBox.TabIndex = 1; this.entryListBox.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.entryListBox_DrawItem); this.entryListBox.MeasureItem += new System.Windows.Forms.MeasureItemEventHandler(this.entryListBox_MeasureItem); @@ -66,9 +68,10 @@ // createButton // this.createButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.createButton.Location = new System.Drawing.Point(642, 424); + this.createButton.Location = new System.Drawing.Point(856, 530); + this.createButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.createButton.Name = "createButton"; - this.createButton.Size = new System.Drawing.Size(144, 40); + this.createButton.Size = new System.Drawing.Size(192, 50); this.createButton.TabIndex = 2; this.createButton.Text = "&Create Shortcut"; this.createButton.UseVisualStyleBackColor = true; @@ -77,18 +80,20 @@ // appUserModelIdLabel // this.appUserModelIdLabel.AutoSize = true; - this.appUserModelIdLabel.Location = new System.Drawing.Point(14, 12); + this.appUserModelIdLabel.Location = new System.Drawing.Point(19, 15); + this.appUserModelIdLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.appUserModelIdLabel.Name = "appUserModelIdLabel"; - this.appUserModelIdLabel.Size = new System.Drawing.Size(213, 20); + this.appUserModelIdLabel.Size = new System.Drawing.Size(284, 25); this.appUserModelIdLabel.TabIndex = 3; this.appUserModelIdLabel.Text = "&Shortcut App User Model ID:"; // // appButton // this.appButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.appButton.Location = new System.Drawing.Point(633, 35); + this.appButton.Location = new System.Drawing.Point(844, 44); + this.appButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.appButton.Name = "appButton"; - this.appButton.Size = new System.Drawing.Size(74, 31); + this.appButton.Size = new System.Drawing.Size(99, 39); this.appButton.TabIndex = 5; this.appButton.Text = "&APP"; this.appButton.UseVisualStyleBackColor = true; @@ -97,10 +102,11 @@ // hwndButton // this.hwndButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.hwndButton.Location = new System.Drawing.Point(712, 35); - this.hwndButton.MinimumSize = new System.Drawing.Size(76, 26); + this.hwndButton.Location = new System.Drawing.Point(949, 44); + this.hwndButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.hwndButton.MinimumSize = new System.Drawing.Size(101, 32); this.hwndButton.Name = "hwndButton"; - this.hwndButton.Size = new System.Drawing.Size(76, 31); + this.hwndButton.Size = new System.Drawing.Size(101, 39); this.hwndButton.TabIndex = 6; this.hwndButton.Text = "&HWND"; this.hwndButton.UseVisualStyleBackColor = true; @@ -110,9 +116,10 @@ // this.appUserModelIdBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.appUserModelIdBox.Location = new System.Drawing.Point(16, 35); + this.appUserModelIdBox.Location = new System.Drawing.Point(21, 44); + this.appUserModelIdBox.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.appUserModelIdBox.Name = "appUserModelIdBox"; - this.appUserModelIdBox.Size = new System.Drawing.Size(608, 26); + this.appUserModelIdBox.Size = new System.Drawing.Size(809, 31); this.appUserModelIdBox.TabIndex = 4; this.appUserModelIdBox.WaterMarkColor = System.Drawing.Color.Gray; this.appUserModelIdBox.WaterMarkText = "Enter a manual ID, or select on from a UWP App or open Window"; @@ -121,18 +128,20 @@ // this.helperLocationText.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.helperLocationText.Location = new System.Drawing.Point(79, 470); + this.helperLocationText.Location = new System.Drawing.Point(105, 588); + this.helperLocationText.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.helperLocationText.Name = "helperLocationText"; - this.helperLocationText.Size = new System.Drawing.Size(654, 26); + this.helperLocationText.Size = new System.Drawing.Size(871, 31); this.helperLocationText.TabIndex = 7; this.helperLocationText.TextChanged += new System.EventHandler(this.helperLocationText_TextChanged); // // helperLocationButton // this.helperLocationButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.helperLocationButton.Location = new System.Drawing.Point(739, 470); + this.helperLocationButton.Location = new System.Drawing.Point(985, 588); + this.helperLocationButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.helperLocationButton.Name = "helperLocationButton"; - this.helperLocationButton.Size = new System.Drawing.Size(46, 31); + this.helperLocationButton.Size = new System.Drawing.Size(61, 39); this.helperLocationButton.TabIndex = 8; this.helperLocationButton.Text = "..."; this.helperLocationButton.UseVisualStyleBackColor = true; @@ -140,19 +149,21 @@ // // helperLocationLabel // + this.helperLocationLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.helperLocationLabel.AutoSize = true; - this.helperLocationLabel.Location = new System.Drawing.Point(13, 473); + this.helperLocationLabel.Location = new System.Drawing.Point(17, 591); + this.helperLocationLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.helperLocationLabel.Name = "helperLocationLabel"; - this.helperLocationLabel.Size = new System.Drawing.Size(60, 20); + this.helperLocationLabel.Size = new System.Drawing.Size(81, 25); this.helperLocationLabel.TabIndex = 9; this.helperLocationLabel.Text = "H&elper:"; // // MainForm // this.AcceptButton = this.createButton; - this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); + this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 508); + this.ClientSize = new System.Drawing.Size(1067, 635); this.Controls.Add(this.helperLocationLabel); this.Controls.Add(this.helperLocationButton); this.Controls.Add(this.helperLocationText); @@ -163,6 +174,7 @@ this.Controls.Add(this.createButton); this.Controls.Add(this.entryListBox); this.Controls.Add(this.defaultShortcutLabel); + this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.Name = "MainForm"; this.Text = "Form1"; this.ResumeLayout(false); diff --git a/EntryList.cs b/EntryList.cs index f6af196..de388bf 100755 --- a/EntryList.cs +++ b/EntryList.cs @@ -11,6 +11,7 @@ public class Entry { public string Target { get; set; } + public string Arguments { get; set; } public string Icon { get; set; } public int IconIndex { get; set; } public string Name { get; set; } diff --git a/ShortcutUtil/MainForm.Designer.cs b/ShortcutUtil/MainForm.Designer.cs index dee63e1..3f2c089 100755 --- a/ShortcutUtil/MainForm.Designer.cs +++ b/ShortcutUtil/MainForm.Designer.cs @@ -43,9 +43,10 @@ // defaultShortcutLabel // this.defaultShortcutLabel.AutoSize = true; - this.defaultShortcutLabel.Location = new System.Drawing.Point(14, 75); + this.defaultShortcutLabel.Location = new System.Drawing.Point(19, 94); + this.defaultShortcutLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.defaultShortcutLabel.Name = "defaultShortcutLabel"; - this.defaultShortcutLabel.Size = new System.Drawing.Size(169, 20); + this.defaultShortcutLabel.Size = new System.Drawing.Size(226, 25); this.defaultShortcutLabel.TabIndex = 0; this.defaultShortcutLabel.Text = "Select default shortcut"; // @@ -56,9 +57,10 @@ | System.Windows.Forms.AnchorStyles.Right))); this.entryListBox.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable; this.entryListBox.FormattingEnabled = true; - this.entryListBox.Location = new System.Drawing.Point(16, 98); + this.entryListBox.Location = new System.Drawing.Point(21, 122); + this.entryListBox.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.entryListBox.Name = "entryListBox"; - this.entryListBox.Size = new System.Drawing.Size(770, 316); + this.entryListBox.Size = new System.Drawing.Size(1025, 394); this.entryListBox.TabIndex = 1; this.entryListBox.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.entryListBox_DrawItem); this.entryListBox.MeasureItem += new System.Windows.Forms.MeasureItemEventHandler(this.entryListBox_MeasureItem); @@ -66,9 +68,10 @@ // createButton // this.createButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.createButton.Location = new System.Drawing.Point(642, 424); + this.createButton.Location = new System.Drawing.Point(856, 530); + this.createButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.createButton.Name = "createButton"; - this.createButton.Size = new System.Drawing.Size(144, 40); + this.createButton.Size = new System.Drawing.Size(192, 50); this.createButton.TabIndex = 2; this.createButton.Text = "&Create Shortcut"; this.createButton.UseVisualStyleBackColor = true; @@ -77,18 +80,20 @@ // appUserModelIdLabel // this.appUserModelIdLabel.AutoSize = true; - this.appUserModelIdLabel.Location = new System.Drawing.Point(14, 12); + this.appUserModelIdLabel.Location = new System.Drawing.Point(19, 15); + this.appUserModelIdLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.appUserModelIdLabel.Name = "appUserModelIdLabel"; - this.appUserModelIdLabel.Size = new System.Drawing.Size(213, 20); + this.appUserModelIdLabel.Size = new System.Drawing.Size(284, 25); this.appUserModelIdLabel.TabIndex = 3; this.appUserModelIdLabel.Text = "&Shortcut App User Model ID:"; // // appButton // this.appButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.appButton.Location = new System.Drawing.Point(633, 35); + this.appButton.Location = new System.Drawing.Point(844, 44); + this.appButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.appButton.Name = "appButton"; - this.appButton.Size = new System.Drawing.Size(74, 31); + this.appButton.Size = new System.Drawing.Size(99, 39); this.appButton.TabIndex = 5; this.appButton.Text = "&APP"; this.appButton.UseVisualStyleBackColor = true; @@ -97,10 +102,11 @@ // hwndButton // this.hwndButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.hwndButton.Location = new System.Drawing.Point(712, 35); - this.hwndButton.MinimumSize = new System.Drawing.Size(76, 26); + this.hwndButton.Location = new System.Drawing.Point(949, 44); + this.hwndButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.hwndButton.MinimumSize = new System.Drawing.Size(101, 32); this.hwndButton.Name = "hwndButton"; - this.hwndButton.Size = new System.Drawing.Size(76, 31); + this.hwndButton.Size = new System.Drawing.Size(101, 39); this.hwndButton.TabIndex = 6; this.hwndButton.Text = "&HWND"; this.hwndButton.UseVisualStyleBackColor = true; @@ -110,9 +116,10 @@ // this.appUserModelIdBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.appUserModelIdBox.Location = new System.Drawing.Point(16, 35); + this.appUserModelIdBox.Location = new System.Drawing.Point(21, 44); + this.appUserModelIdBox.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.appUserModelIdBox.Name = "appUserModelIdBox"; - this.appUserModelIdBox.Size = new System.Drawing.Size(608, 26); + this.appUserModelIdBox.Size = new System.Drawing.Size(809, 31); this.appUserModelIdBox.TabIndex = 4; this.appUserModelIdBox.WaterMarkColor = System.Drawing.Color.Gray; this.appUserModelIdBox.WaterMarkText = "Enter a manual ID, or select on from a UWP App or open Window"; @@ -121,18 +128,20 @@ // this.helperLocationText.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.helperLocationText.Location = new System.Drawing.Point(79, 470); + this.helperLocationText.Location = new System.Drawing.Point(105, 588); + this.helperLocationText.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.helperLocationText.Name = "helperLocationText"; - this.helperLocationText.Size = new System.Drawing.Size(654, 26); + this.helperLocationText.Size = new System.Drawing.Size(871, 31); this.helperLocationText.TabIndex = 7; this.helperLocationText.TextChanged += new System.EventHandler(this.helperLocationText_TextChanged); // // helperLocationButton // this.helperLocationButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.helperLocationButton.Location = new System.Drawing.Point(739, 470); + this.helperLocationButton.Location = new System.Drawing.Point(985, 588); + this.helperLocationButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.helperLocationButton.Name = "helperLocationButton"; - this.helperLocationButton.Size = new System.Drawing.Size(46, 31); + this.helperLocationButton.Size = new System.Drawing.Size(61, 39); this.helperLocationButton.TabIndex = 8; this.helperLocationButton.Text = "..."; this.helperLocationButton.UseVisualStyleBackColor = true; @@ -140,19 +149,21 @@ // // helperLocationLabel // + this.helperLocationLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.helperLocationLabel.AutoSize = true; - this.helperLocationLabel.Location = new System.Drawing.Point(13, 473); + this.helperLocationLabel.Location = new System.Drawing.Point(17, 591); + this.helperLocationLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.helperLocationLabel.Name = "helperLocationLabel"; - this.helperLocationLabel.Size = new System.Drawing.Size(60, 20); + this.helperLocationLabel.Size = new System.Drawing.Size(81, 25); this.helperLocationLabel.TabIndex = 9; this.helperLocationLabel.Text = "H&elper:"; // // MainForm // this.AcceptButton = this.createButton; - this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); + this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 508); + this.ClientSize = new System.Drawing.Size(1067, 635); this.Controls.Add(this.helperLocationLabel); this.Controls.Add(this.helperLocationButton); this.Controls.Add(this.helperLocationText); @@ -163,6 +174,7 @@ this.Controls.Add(this.createButton); this.Controls.Add(this.entryListBox); this.Controls.Add(this.defaultShortcutLabel); + this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.Name = "MainForm"; this.Text = "Form1"; this.ResumeLayout(false); diff --git a/ShortcutUtil/MainForm.cs b/ShortcutUtil/MainForm.cs index 2b71b0f..bd3b3b0 100755 --- a/ShortcutUtil/MainForm.cs +++ b/ShortcutUtil/MainForm.cs @@ -101,13 +101,23 @@ private void ClickedTestButton(int index) { - ProcessStartInfo startInfo = new ProcessStartInfo + try { + Entry entry = entryList.Entries[index]; + ProcessStartInfo startInfo = new ProcessStartInfo + { - FileName = entryList.Entries[index].Target, - UseShellExecute = true - }; - Process.Start(startInfo); + FileName = entry.Target, + Arguments = entry.Arguments, + UseShellExecute = true + }; + Process.Start(startInfo); + } + catch (Exception e) + { + MessageBox.Show("Couldn't start entry: " + e.ToString()); + } + } private Dictionary, Icon> iconsByFileIndex = new Dictionary, Icon>(); @@ -197,7 +207,7 @@ g.DrawString(index + ": " + entry.Name, nameFont, fontBrush, textLocation); textLocation = PointF.Add(textLocation, textSize); - g.DrawString(entry.Target, defaultFont, fontBrush, textLocation); + g.DrawString(entry.Target + " " + entry.Arguments, defaultFont, fontBrush, textLocation); textLocation = PointF.Add(textLocation, textSize); g.DrawString(entry.Description, defaultFont, fontBrush, textLocation);