Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
SrShadowy committed Jun 7, 2020
1 parent 672ea05 commit 12185b1
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 105 deletions.
20 changes: 14 additions & 6 deletions LauncherDesktop/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

110 changes: 27 additions & 83 deletions LauncherDesktop/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
{
Expand All @@ -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)
{
Expand All @@ -377,7 +314,6 @@ void LoadFile(string myFile)
}
else if (groups)
{
ListViewAPI.SetGroupHeaderColor(listitens.Handle, 0xC00056);
try
{
string[] file_groups = new string[2];
Expand All @@ -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
Expand All @@ -413,6 +349,7 @@ void LoadFile(string myFile)
}
}
}
cm_itens.Items.Add("Sair");

}
void ChangueItens()
Expand Down Expand Up @@ -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);
}
}

Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down
32 changes: 16 additions & 16 deletions LauncherDesktop/Form1.resx
Original file line number Diff line number Diff line change
Expand Up @@ -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
AwQBBgMAAf8DHgErJAADSAGEA1MB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