diff --git a/LauncherDesktop/Form1.Designer.cs b/LauncherDesktop/Form1.Designer.cs index cebacef..454a9de 100644 --- a/LauncherDesktop/Form1.Designer.cs +++ b/LauncherDesktop/Form1.Designer.cs @@ -65,6 +65,7 @@ private void InitializeComponent() this.removerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.moverParaOGrupoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.definirComoADMINToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); this.cms_viewer.SuspendLayout(); this.SuspendLayout(); @@ -82,7 +83,7 @@ private void InitializeComponent() // this.cm_itens.Name = "cm_itens"; this.cm_itens.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional; - this.cm_itens.Size = new System.Drawing.Size(61, 4); + this.cm_itens.Size = new System.Drawing.Size(181, 26); this.cm_itens.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.Cm_itens_ItemClicked); // // menuStrip1 @@ -114,35 +115,35 @@ private void InitializeComponent() // abrirListaToolStripMenuItem // this.abrirListaToolStripMenuItem.Name = "abrirListaToolStripMenuItem"; - this.abrirListaToolStripMenuItem.Size = new System.Drawing.Size(140, 22); + this.abrirListaToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.abrirListaToolStripMenuItem.Text = "Abrir Lista"; this.abrirListaToolStripMenuItem.Click += new System.EventHandler(this.AbrirListaToolStripMenuItem_Click); // // importaListaToolStripMenuItem // this.importaListaToolStripMenuItem.Name = "importaListaToolStripMenuItem"; - this.importaListaToolStripMenuItem.Size = new System.Drawing.Size(140, 22); + this.importaListaToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.importaListaToolStripMenuItem.Text = "Importa lista"; this.importaListaToolStripMenuItem.Click += new System.EventHandler(this.ImportaListaToolStripMenuItem_Click); // // esconderToolStripMenuItem // this.esconderToolStripMenuItem.Name = "esconderToolStripMenuItem"; - this.esconderToolStripMenuItem.Size = new System.Drawing.Size(140, 22); + this.esconderToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.esconderToolStripMenuItem.Text = "Esconder"; this.esconderToolStripMenuItem.Click += new System.EventHandler(this.EsconderToolStripMenuItem_Click); // // salvarListaToolStripMenuItem // this.salvarListaToolStripMenuItem.Name = "salvarListaToolStripMenuItem"; - this.salvarListaToolStripMenuItem.Size = new System.Drawing.Size(140, 22); + this.salvarListaToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.salvarListaToolStripMenuItem.Text = "Salvar lista"; this.salvarListaToolStripMenuItem.Click += new System.EventHandler(this.SalvarListaToolStripMenuItem_Click); // // sairToolStripMenuItem // this.sairToolStripMenuItem.Name = "sairToolStripMenuItem"; - this.sairToolStripMenuItem.Size = new System.Drawing.Size(140, 22); + this.sairToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.sairToolStripMenuItem.Text = "Sair"; this.sairToolStripMenuItem.Click += new System.EventHandler(this.SairToolStripMenuItem_Click); // @@ -367,6 +368,12 @@ private void InitializeComponent() this.definirComoADMINToolStripMenuItem.Text = "Definir como ADMIN"; this.definirComoADMINToolStripMenuItem.Click += new System.EventHandler(this.DefinirComoADMINToolStripMenuItem_Click); // + // toolStripMenuItem1 + // + this.toolStripMenuItem1.Name = "toolStripMenuItem1"; + this.toolStripMenuItem1.Size = new System.Drawing.Size(180, 22); + this.toolStripMenuItem1.Text = "Exit"; + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -429,6 +436,7 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripMenuItem definirComoADMINToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem escondeAoAbrirAlgoToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem importaListaToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1; } } diff --git a/LauncherDesktop/Form1.cs b/LauncherDesktop/Form1.cs index f277661..32395e9 100644 --- a/LauncherDesktop/Form1.cs +++ b/LauncherDesktop/Form1.cs @@ -17,66 +17,7 @@ public Form1() InitializeComponent(); } - //Change COLOR ListViewGroup Header - - // né class api - public class ListViewAPI - { - public const int LVM_FIRST = 4096; - public const int LVM_SETGROUPMETRICS = (LVM_FIRST + 155); - public const int LVGMF_NONE = 0; - public const int LVGMF_BORDERSIZE = 1; - public const int lVGMF_BORDERCOLOR = 2; - public const int LVGMF_TEXTCOLOR = 0x4; - - - - - - - //import SendMessage - [DllImport("user32.dll")] - public static extern int SendMessage(IntPtr hWnd, int wMsg, IntPtr wParam, IntPtr lParam); - - //Layout Senquencia crHeader - [StructLayout(LayoutKind.Sequential, Pack = 1)] - public struct LVGROUPMETRICS - { - public int cbSize; - public int mask; - public int left; - public int top; - public int right; - public int bottom; - public int crLeft; - public int crTop; - public int crRight; - public int crBottom; - public int crHeader; - public int crFooter; - } - - public static void SetGroupHeaderColor(IntPtr handle, int icolor) - { - var groupMetrics = new LVGROUPMETRICS(); - Int32 ptrRetVal; - IntPtr wparam = new IntPtr(); - IntPtr lparam = new IntPtr(); - - groupMetrics.cbSize = Marshal.SizeOf(groupMetrics); - groupMetrics.mask = ListViewAPI.LVGMF_TEXTCOLOR; - groupMetrics.crHeader = icolor; - - lparam = System.Runtime.InteropServices.Marshal.AllocCoTaskMem(System.Runtime.InteropServices.Marshal.SizeOf(groupMetrics)); - System.Runtime.InteropServices.Marshal.StructureToPtr(groupMetrics, lparam, false); - - ptrRetVal = SendMessage(handle, LVM_SETGROUPMETRICS, wparam, lparam); - - System.Runtime.InteropServices.Marshal.FreeCoTaskMem(lparam); - } - - } - + //Global vars readonly ListBox mylist = new ListBox(); readonly ListBox ConfigGroups = new ListBox(); @@ -89,7 +30,7 @@ public static void SetGroupHeaderColor(IntPtr handle, int icolor) string result = string.Empty; bool change = false; readonly string myFile = Application.StartupPath + "\\DATA.bin"; - readonly string Ver = "20.05.03"; + readonly string Ver = "20.06.07"; string TitleProgram = string.Empty; bool question = false; public class IconExtractor @@ -197,7 +138,7 @@ public static DialogResult InputBox(string title, string promptText, ref string void AddFile(string filename) { - string type = Path.GetExtension(filename); + //string type = Path.GetExtension(filename); result = Path.GetFileNameWithoutExtension(filename); mylist.Items.Add(filename); try @@ -331,7 +272,7 @@ void LoadFile(string myFile) if (!groups && !admins && !AD_Groups && !config_itens) { mylist.Items.Add(lines[i]); - string type = Path.GetExtension(lines[i]); + //string type = Path.GetExtension(lines[i]); result = Path.GetFileNameWithoutExtension(lines[i]); try { @@ -346,11 +287,7 @@ void LoadFile(string myFile) listitens.Items.Add(result, 0); cm_itens.Items.Add(result, lista_icons.Images[0]); } - - - - } else if (AD_Groups) { @@ -377,7 +314,6 @@ void LoadFile(string myFile) } else if (groups) { - ListViewAPI.SetGroupHeaderColor(listitens.Handle, 0xC00056); try { string[] file_groups = new string[2]; @@ -387,7 +323,7 @@ void LoadFile(string myFile) { if (string.Compare(listitens.Groups[x].Header, file_groups[1]) == 0) listitens.Items[listitens.Items.IndexOf(listitens.FindItemWithText(file_groups[0]))].Group - = listitens.Groups[x]; + = listitens.Groups[x]; } }catch @@ -413,6 +349,7 @@ void LoadFile(string myFile) } } } + cm_itens.Items.Add("Sair"); } void ChangueItens() @@ -658,8 +595,8 @@ private void Form1_Load(object sender, EventArgs e) LoadFile(myFile); using (RegistryKey key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true)) { - var kaka = key.GetValue("LauncherApps"); - inicializarComOOSToolStripMenuItem.Checked = (kaka != null); + var KeyOsInicialization = key.GetValue("LauncherApps"); + inicializarComOOSToolStripMenuItem.Checked = (KeyOsInicialization != null); } } @@ -686,6 +623,8 @@ private void EsconderToolStripMenuItem_Click(object sender, EventArgs e) { Hide(); notifyIcon1.Visible = true; + notifyIcon1.BalloonTipText = "Estamos aqui na barra basta clica para abrir novamente :)"; + notifyIcon1.ShowBalloonTip(1000); } private void NotifyIcon1_MouseClick(object sender, MouseEventArgs e) @@ -722,8 +661,6 @@ private void InicializarComOOSToolStripMenuItem_Click(object sender, EventArgs e using (RegistryKey key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true)) { key.SetValue("LauncherApps", "\"" + Application.ExecutablePath + "\""); - //Properties.Settings.Default.autoIni = true; - } } catch @@ -784,20 +721,25 @@ private void VerificarUpdateToolStripMenuItem_Click(object sender, EventArgs e) } private void Cm_itens_ItemClicked(object sender, ToolStripItemClickedEventArgs e) { - int index = cm_itens.Items.IndexOf(e.ClickedItem); - // MessageBox.Show(e.ClickedItem.Text + " " + index); - listitens.Items[index].Selected = true; - Run(false); - + if (String.Compare("Sair", e.ClickedItem.Text) == 0) + { + Close(); + }else + { + int index = cm_itens.Items.IndexOf(e.ClickedItem); + // MessageBox.Show(e.ClickedItem.Text + " " + index); + listitens.Items[index].Selected = true; + Run(false); + } } private void Form1_SizeChanged(object sender, EventArgs e) { if (WindowState == FormWindowState.Minimized) { - Hide(); - notifyIcon1.Visible = true; - notifyIcon1.BalloonTipText = "Estamos aqui na barra basta clica para abrir novamente :)"; - notifyIcon1.ShowBalloonTip(1000); + // Hide(); + //notifyIcon1.Visible = true; + //notifyIcon1.BalloonTipText = "Estamos aqui na barra basta clica para abrir novamente :)"; + //notifyIcon1.ShowBalloonTip(1000); } } private void AdicionarGrupoToolStripMenuItem_Click(object sender, EventArgs e) @@ -849,7 +791,9 @@ private void DefinirComoADMINToolStripMenuItem_Click(object sender, EventArgs e) if (removeAt > 0) ConfigAdmin.Items.RemoveAt(removeAt); - ConfigAdmin.Items.Add(listitens.Items[itemIndex].Text + ":" + Convert.ToInt32( listitens.Items[itemIndex].Checked)); + if (listitens.Items[itemIndex].Checked) + ConfigAdmin.Items.Add(listitens.Items[itemIndex].Text + ":" + Convert.ToInt32( listitens.Items[itemIndex].Checked)); + ChangueItens(); if (listitens.Items[itemIndex].Checked) listitens.Items[itemIndex].ForeColor = Color.Red; diff --git a/LauncherDesktop/Form1.resx b/LauncherDesktop/Form1.resx index 4be82f0..09a1eac 100644 --- a/LauncherDesktop/Form1.resx +++ b/LauncherDesktop/Form1.resx @@ -690,26 +690,26 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADC - BQAAAk1TRnQBSQFMAwEBAAFIAQABSAEAARkBAAEZAQAE/wEhAQAI/wFCAU0BNgcAATYDAAEoAwABZAMA - ARkDAAEBAQABIAUAARABJyIAAzgBXgNWAdkDCQH9AwAB/wMAAf8DAAH/AwAB/wMAAf8DAAH/AwAB/wMA - Af4DSAGF/wBdAAM1AVgDJwH2Az8BbgMjATMDIQEwAyEBMAMhATADIQEwAyEBMAMhATADIQEwA08BmwMA - Af4DNgFZ/wBZAANZAdIDQwF3JAADSAGEA0UB7QMsAfUDIwEz/wBRAAMDAQQDCQH8AyIBMiQAA0gBhANT - AawDSwGPA1MB4gMSARj/AE0AAwQBBgMAAf8DHgErJAADSAGEA1MBrAMCAQMDVQG6A1kBxAMFAQf/AEkA - AwQBBgMAAf8DHgErJAADSAGEA1MBrAQAAxABFQNRAeMDTwGc/wBJAAMEAQYDAAH/Ax4BKyQAA0UBfgNV - AbQIAAMnATsDGwH6Az8Bbv8ARQADBAEGAwAB/wMeASskAAMnAToDKAH3A0YBgQNCAXUDQgF1A1kBzAMS - AfsDKwFD/wBBAAMEAQYDAAH/Ax4BKygAAzcBWwNWAbYDVQG6A1UBugNVAboDWAHGA0YB7AMCAQP/AD0A - AwQBBgMAAf8DHgErLAADNgFZAyYBOQgAAx4BKwMAAf8DBAEG/wA9AAMEAQYDAAH/Ax4BKywAA1kBzQNL + BQAAA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