Compare commits
1 Commits
8d040202ea
...
main
Author | SHA1 | Date | |
---|---|---|---|
e40270fb4a |
@ -562,7 +562,7 @@ namespace Program_Hide
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Form2 f2;
|
public static Form2 f2;
|
||||||
private void button1_Click(object sender, EventArgs e) //need to make a version like this for the actual keybind list
|
private void button1_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
StopRecording();
|
StopRecording();
|
||||||
if (ShowHideKeysList.Count == 2 && ShowHideKeysList.Contains(KeyboardHook.VKeys.LSHIFT) && ShowHideKeysList.Contains(KeyboardHook.VKeys.LMENU))
|
if (ShowHideKeysList.Count == 2 && ShowHideKeysList.Contains(KeyboardHook.VKeys.LSHIFT) && ShowHideKeysList.Contains(KeyboardHook.VKeys.LMENU))
|
||||||
@ -715,11 +715,11 @@ namespace Program_Hide
|
|||||||
}
|
}
|
||||||
else if (size.x < image.Width && !(size.y < image.Height))
|
else if (size.x < image.Width && !(size.y < image.Height))
|
||||||
{
|
{
|
||||||
props.rcDestination = new Rect(image.Left + ((image.Width - (props.rcDestination.Left + size.x)) / 2), image.Top, image.Right, image.Bottom); //x is good, x is centered
|
props.rcDestination = new Rect(image.Left + ((image.Width - (props.rcDestination.Left + size.x)) / 2), image.Top, image.Right, image.Bottom);
|
||||||
}
|
}
|
||||||
else if (!(size.x < image.Width) && size.y < image.Height)
|
else if (!(size.x < image.Width) && size.y < image.Height)
|
||||||
{
|
{
|
||||||
props.rcDestination = new Rect(image.Left, image.Top + ((image.Height - (props.rcDestination.Top + size.y)) / 2), image.Right, image.Bottom);//y is good, y is centered
|
props.rcDestination = new Rect(image.Left, image.Top + ((image.Height - (props.rcDestination.Top + size.y)) / 2), image.Right, image.Bottom);
|
||||||
}
|
}
|
||||||
else if (!(size.x < image.Width && size.y < image.Height))
|
else if (!(size.x < image.Width && size.y < image.Height))
|
||||||
{
|
{
|
||||||
|
33
src/Form2.cs
33
src/Form2.cs
@ -101,9 +101,8 @@ namespace Program_Hide
|
|||||||
label1.Location = new Point(((this.Width / 2) - label1.Width / 2), label1.Location.Y);
|
label1.Location = new Point(((this.Width / 2) - label1.Width / 2), label1.Location.Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (keybindMethod == "APP") //when creating new form2 and sending params in form1, just send intptr as null aslong as string or just empty
|
if (keybindMethod == "APP")
|
||||||
{
|
{
|
||||||
//label1.Text = "\"" + applicationLocation + "\"";
|
|
||||||
label1.Visible = false;
|
label1.Visible = false;
|
||||||
checkBox2.Visible = true;
|
checkBox2.Visible = true;
|
||||||
checkBox3.Visible = true;
|
checkBox3.Visible = true;
|
||||||
@ -112,7 +111,6 @@ namespace Program_Hide
|
|||||||
|
|
||||||
#region KeyUp Detection System
|
#region KeyUp Detection System
|
||||||
bool alreadyShownMB;
|
bool alreadyShownMB;
|
||||||
//bool ShowingForm; //never used... as of 1/26/2020:8:12PM
|
|
||||||
bool keyIsNew;
|
bool keyIsNew;
|
||||||
public static bool NewWindowRecording;
|
public static bool NewWindowRecording;
|
||||||
public static bool Form2ForceRecord;
|
public static bool Form2ForceRecord;
|
||||||
@ -146,12 +144,9 @@ namespace Program_Hide
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//else //WHY WOULD AN ELSE BE HERE?
|
|
||||||
//{
|
|
||||||
//Debug.WriteLine("KEYS RESET");
|
|
||||||
textBox1.Text = "";
|
textBox1.Text = "";
|
||||||
|
|
||||||
for (int i = 0; i < TempKeysList.Count; i++) //probably should make a better system than this.
|
for (int i = 0; i < TempKeysList.Count; i++)
|
||||||
{
|
{
|
||||||
if (i < 1)
|
if (i < 1)
|
||||||
{
|
{
|
||||||
@ -164,7 +159,6 @@ namespace Program_Hide
|
|||||||
|
|
||||||
textBox1.SelectionStart = textBox1.TextLength;
|
textBox1.SelectionStart = textBox1.TextLength;
|
||||||
}
|
}
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
keyIsNew = false;
|
keyIsNew = false;
|
||||||
@ -186,7 +180,7 @@ namespace Program_Hide
|
|||||||
|
|
||||||
textBox1.Text = "";
|
textBox1.Text = "";
|
||||||
|
|
||||||
for (int i = 0; i < TempKeysList.Count; i++) //probably should make a better system than this.
|
for (int i = 0; i < TempKeysList.Count; i++)
|
||||||
{
|
{
|
||||||
if (i < 1)
|
if (i < 1)
|
||||||
{
|
{
|
||||||
@ -249,13 +243,11 @@ namespace Program_Hide
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
label1.Text = "\"" + fileName.Substring(0, 28) + "....exe\""; //stops at 29th character, reason is because ....exe takes up space also | adds + 3 chars anyways cause of "..."
|
label1.Text = "\"" + fileName.Substring(0, 28) + "....exe\"";
|
||||||
}
|
}
|
||||||
|
|
||||||
label1.Location = new Point(((this.Width / 2) - label1.Width / 2), label1.Location.Y);
|
label1.Location = new Point(((this.Width / 2) - label1.Width / 2), label1.Location.Y);
|
||||||
label1.Visible = true;
|
label1.Visible = true;
|
||||||
|
|
||||||
//... Add other functionality here
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkBox2_CheckedChanged(object sender, EventArgs e)
|
private void checkBox2_CheckedChanged(object sender, EventArgs e)
|
||||||
@ -288,7 +280,7 @@ namespace Program_Hide
|
|||||||
{
|
{
|
||||||
for (int i2 = 0; i2 < NewWindowKeysList.Count; i2++)
|
for (int i2 = 0; i2 < NewWindowKeysList.Count; i2++)
|
||||||
{
|
{
|
||||||
if (!Form3.AllKeyBinds[i1].Contains(NewWindowKeysList[i2])) //dont really think it matters if i put form3.allkeybinds on outside or inside of contains or not, so just put it like this as it seems simpler
|
if (!Form3.AllKeyBinds[i1].Contains(NewWindowKeysList[i2]))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -383,10 +375,7 @@ namespace Program_Hide
|
|||||||
{
|
{
|
||||||
Form2ForceRecord = true;
|
Form2ForceRecord = true;
|
||||||
Form1.Form1ForceRecord = false;
|
Form1.Form1ForceRecord = false;
|
||||||
//if (Form1.ShowHideRecording)
|
|
||||||
//{
|
|
||||||
// Form1.ShowHideRecording = false;
|
|
||||||
//}
|
|
||||||
|
|
||||||
this.ActiveControl = null;
|
this.ActiveControl = null;
|
||||||
if (!NewWindowRecording)
|
if (!NewWindowRecording)
|
||||||
@ -433,7 +422,7 @@ namespace Program_Hide
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetNewKeys() //don't know if this is necessary
|
public void SetNewKeys()
|
||||||
{
|
{
|
||||||
NewWindowKeysList = TempKeysList.ToList();
|
NewWindowKeysList = TempKeysList.ToList();
|
||||||
button1.Enabled = true;
|
button1.Enabled = true;
|
||||||
@ -519,12 +508,4 @@ namespace Program_Hide
|
|||||||
StopRecording();
|
StopRecording();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//public class ProgramHideExceptions : Exception //do an exception if the thing doesnt match
|
|
||||||
//{
|
|
||||||
// public InvalidInputTypeException()
|
|
||||||
// {
|
|
||||||
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
41
src/Form3.cs
41
src/Form3.cs
@ -51,13 +51,10 @@ namespace Program_Hide
|
|||||||
label1.Visible = false;
|
label1.Visible = false;
|
||||||
panel1.Location = new Point(0, 0);
|
panel1.Location = new Point(0, 0);
|
||||||
panel1.MouseWheel += Panel1_MouseWheel;
|
panel1.MouseWheel += Panel1_MouseWheel;
|
||||||
//panel1.AutoScroll = true;
|
|
||||||
|
|
||||||
vScrollBar1 = new VScrollBar();
|
vScrollBar1 = new VScrollBar();
|
||||||
vScrollBar1.Dock = DockStyle.Right;
|
vScrollBar1.Dock = DockStyle.Right;
|
||||||
|
|
||||||
//vScrollBar1.LargeChange = 0; //maybe reenable
|
|
||||||
|
|
||||||
vScrollBar1.Scroll += (osender, eargs) => {
|
vScrollBar1.Scroll += (osender, eargs) => {
|
||||||
UpdateScroll(true);
|
UpdateScroll(true);
|
||||||
};
|
};
|
||||||
@ -79,7 +76,7 @@ namespace Program_Hide
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void ShowForm(int i) //RN IT JUST HIDES THE WINDOW ALWAYS WHEN KEYPRESSED, MAKE AN OPTION TO JUST MINIMIZE IT OR SOMETHING | CHECK 2-9-20 NOTES
|
public void ShowForm(int i)
|
||||||
{
|
{
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
{
|
{
|
||||||
@ -90,19 +87,15 @@ namespace Program_Hide
|
|||||||
}
|
}
|
||||||
if (ShowingWindow[i])
|
if (ShowingWindow[i])
|
||||||
{
|
{
|
||||||
//this.Hide();
|
|
||||||
ShowWindowAsync(AllHandles[i], SW_HIDE);
|
ShowWindowAsync(AllHandles[i], SW_HIDE);
|
||||||
ShowingWindow[i] = false;
|
ShowingWindow[i] = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//this.Show();
|
|
||||||
ShowWindowAsync(AllHandles[i], SW_SHOW);
|
ShowWindowAsync(AllHandles[i], SW_SHOW);
|
||||||
SetForegroundWindow(AllHandles[i]);
|
SetForegroundWindow(AllHandles[i]);
|
||||||
//BringWindowToTop(this.Handle);
|
|
||||||
//BringToFront();
|
|
||||||
|
|
||||||
if (Maximize[i]) //dont need to add checkbox for maximize for main menu
|
if (Maximize[i])
|
||||||
{
|
{
|
||||||
ShowWindowAsync(AllHandles[i], SW_MAXIMIZE);
|
ShowWindowAsync(AllHandles[i], SW_MAXIMIZE);
|
||||||
}
|
}
|
||||||
@ -149,7 +142,7 @@ namespace Program_Hide
|
|||||||
CurrentKeys.Remove(key);
|
CurrentKeys.Remove(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
int changeInScroll = 5; //THIS IS PRETTY MUCH USELESS BECAUSE MICROSOFT IS LAZY AND RUINED THE FEATURE OF HAVING THE SCROLLBAR ACTUALLY GO ALL THE WAY DOWN :( //CAN POSSIBLY FIX LATER
|
int changeInScroll = 5;
|
||||||
int scrollFreeSpace;
|
int scrollFreeSpace;
|
||||||
float VScrollBar1Translation;
|
float VScrollBar1Translation;
|
||||||
private void Panel1_MouseWheel(object sender, MouseEventArgs e)
|
private void Panel1_MouseWheel(object sender, MouseEventArgs e)
|
||||||
@ -167,14 +160,14 @@ namespace Program_Hide
|
|||||||
scrollFreeSpace = panel1.Height - this.ClientSize.Height;
|
scrollFreeSpace = panel1.Height - this.ClientSize.Height;
|
||||||
Debug.WriteLine(scrollFreeSpace);
|
Debug.WriteLine(scrollFreeSpace);
|
||||||
|
|
||||||
VScrollBar1Translation = (float)Math.Floor((double)(scrollFreeSpace / changeInScroll)); //pretty much does nothing...
|
VScrollBar1Translation = (float)Math.Floor((double)(scrollFreeSpace / changeInScroll));
|
||||||
vScrollBar1.Maximum = (int)VScrollBar1Translation;
|
vScrollBar1.Maximum = (int)VScrollBar1Translation;
|
||||||
Debug.WriteLine("OUT OF: " + scrollFreeSpace / changeInScroll);
|
Debug.WriteLine("OUT OF: " + scrollFreeSpace / changeInScroll);
|
||||||
Debug.WriteLine(vScrollBar1.Maximum);
|
Debug.WriteLine(vScrollBar1.Maximum);
|
||||||
|
|
||||||
if (vScrollBar1.Maximum > 0)
|
if (vScrollBar1.Maximum > 0)
|
||||||
{
|
{
|
||||||
if (e.Delta > 0) //go up
|
if (e.Delta > 0)
|
||||||
{
|
{
|
||||||
if (vScrollBar1.Value - changeInScroll > vScrollBar1.Minimum)
|
if (vScrollBar1.Value - changeInScroll > vScrollBar1.Minimum)
|
||||||
{
|
{
|
||||||
@ -185,7 +178,7 @@ namespace Program_Hide
|
|||||||
vScrollBar1.Value = 0;
|
vScrollBar1.Value = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else //go down
|
else
|
||||||
{
|
{
|
||||||
if (vScrollBar1.Value + changeInScroll < vScrollBar1.Maximum)
|
if (vScrollBar1.Value + changeInScroll < vScrollBar1.Maximum)
|
||||||
{
|
{
|
||||||
@ -200,7 +193,6 @@ namespace Program_Hide
|
|||||||
|
|
||||||
UpdateScroll(false);
|
UpdateScroll(false);
|
||||||
}
|
}
|
||||||
//if (this)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -221,18 +213,16 @@ namespace Program_Hide
|
|||||||
{
|
{
|
||||||
Debug.WriteLine(vScrollBar1.Value + " OUT OF " + vScrollBar1.Maximum);
|
Debug.WriteLine(vScrollBar1.Value + " OUT OF " + vScrollBar1.Maximum);
|
||||||
|
|
||||||
if (vScrollBar1.Value > ((vScrollBar1.Maximum / 10) * 9)) //this is included to prevent it from going into blank white space
|
if (vScrollBar1.Value > ((vScrollBar1.Maximum / 10) * 9))
|
||||||
{
|
{
|
||||||
Debug.WriteLine("true");
|
Debug.WriteLine("true");
|
||||||
panel1.Location = new Point(0, tempInt1); //dk if this.cleintsize.height + 40 is needed
|
panel1.Location = new Point(0, tempInt1);
|
||||||
}
|
}
|
||||||
else //this is included to make the scroll wheel work up and down properly, still need to get it working properly
|
else
|
||||||
{
|
{
|
||||||
Debug.WriteLine("TRUE");
|
Debug.WriteLine("TRUE");
|
||||||
panel1.Location = new Point(0, tempInt1 - (int)(tempInt1 / -8.9f));//this just sucks D:, just keep it the way it is, its fine because it isnt cutting off any wording so its ok! for as of 2/1/12:36AM. Just fix it later or something!
|
panel1.Location = new Point(0, tempInt1 - (int)(tempInt1 / -8.9f));
|
||||||
}
|
}
|
||||||
//panel1.Location = new Point(0, 0 - (vScrollBar1.Value * (panel1.Height / vScrollBar1.Maximum)) + (vScrollBar1.Value * ((this.ClientSize.Height + 40) / vScrollBar1.Maximum)) - 40);
|
|
||||||
//panel1.Location = new Point(0, (0 - (vScrollBar1.Value * (panel1.Height / vScrollBar1.Maximum)) + (vScrollBar1.Value * ((this.ClientSize.Height + 40) / vScrollBar1.Maximum))) / 9 * 10);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -242,7 +232,7 @@ namespace Program_Hide
|
|||||||
if (!(tempInt1 > 0))
|
if (!(tempInt1 > 0))
|
||||||
{
|
{
|
||||||
Debug.WriteLine("WORKING");
|
Debug.WriteLine("WORKING");
|
||||||
panel1.Location = new Point(0, tempInt1);// - (changeInScroll * vScrollBar1.Value)));
|
panel1.Location = new Point(0, tempInt1);
|
||||||
Debug.WriteLine(tempInt1);
|
Debug.WriteLine(tempInt1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -258,7 +248,7 @@ namespace Program_Hide
|
|||||||
List<Panel> PanelList = new List<Panel>();
|
List<Panel> PanelList = new List<Panel>();
|
||||||
List<Label> LabelList = new List<Label>();
|
List<Label> LabelList = new List<Label>();
|
||||||
List<Label> NumLabelList = new List<Label>();
|
List<Label> NumLabelList = new List<Label>();
|
||||||
private void timer1_Tick(object sender, EventArgs e) //may need to change way it works later, current works by disposing all panels whenever a new keybind is added and then recreates them all.
|
private void timer1_Tick(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (AllKeyBinds.Count != prevListValue)
|
if (AllKeyBinds.Count != prevListValue)
|
||||||
{
|
{
|
||||||
@ -278,7 +268,7 @@ namespace Program_Hide
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static bool forcePanelUpdate;
|
public static bool forcePanelUpdate;
|
||||||
public void UpdatePanels() //current anchor set are good enough i guess...
|
public void UpdatePanels()
|
||||||
{
|
{
|
||||||
if (!this.Visible)
|
if (!this.Visible)
|
||||||
{
|
{
|
||||||
@ -293,7 +283,7 @@ namespace Program_Hide
|
|||||||
}
|
}
|
||||||
|
|
||||||
DisposeOldPanels();
|
DisposeOldPanels();
|
||||||
for (int i = 0; i < AllKeyBinds.Count; i++) //just redraw always to make simple and not have errors!!!
|
for (int i = 0; i < AllKeyBinds.Count; i++)
|
||||||
{
|
{
|
||||||
p1 = new Panel();
|
p1 = new Panel();
|
||||||
PanelList.Add(p1);
|
PanelList.Add(p1);
|
||||||
@ -309,9 +299,6 @@ namespace Program_Hide
|
|||||||
panel1.Height = this.ClientSize.Height;
|
panel1.Height = this.ClientSize.Height;
|
||||||
}
|
}
|
||||||
|
|
||||||
//p1.AutoSize = true;
|
|
||||||
//p1.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right); //anchor not working...
|
|
||||||
|
|
||||||
l1 = new Label();
|
l1 = new Label();
|
||||||
LabelList.Add(l1);
|
LabelList.Add(l1);
|
||||||
l1.AutoSize = true;
|
l1.AutoSize = true;
|
||||||
|
@ -27,7 +27,6 @@ namespace KeyboardHook1
|
|||||||
public enum VKeys//Vkeys //ACTUAL VKEYS, CHANGED OUT FOR UPDATED KEYS
|
public enum VKeys//Vkeys //ACTUAL VKEYS, CHANGED OUT FOR UPDATED KEYS
|
||||||
{
|
{
|
||||||
// Losely based on http://www.pinvoke.net/default.aspx/Enums/VK.html
|
// Losely based on http://www.pinvoke.net/default.aspx/Enums/VK.html
|
||||||
//NULL = 0x00, //I ADDED THIS ONE MYSELF <-----------------------------------
|
|
||||||
LBUTTON = 0x01, // Left mouse button
|
LBUTTON = 0x01, // Left mouse button
|
||||||
RBUTTON = 0x02, // Right mouse button
|
RBUTTON = 0x02, // Right mouse button
|
||||||
CANCEL = 0x03, // Control-break processing
|
CANCEL = 0x03, // Control-break processing
|
||||||
|
Reference in New Issue
Block a user