mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-06-20 19:30:31 +12:00
#115, version 0.11.2.0
[Feature] Show icon in taskbar when application is running #115
This commit is contained in:
parent
5cf29e0ba5
commit
50231f5a3c
|
@ -39,6 +39,7 @@ namespace SystemTrayMenu
|
|||
taskbarForm.Activated += TasbkarItemActivated;
|
||||
taskbarForm.Resize += TaskbarForm_Resize;
|
||||
taskbarForm.FormClosed += TaskbarForm_FormClosed;
|
||||
taskbarForm.Deactivate += TaskbarForm_Deactivate;
|
||||
DllImports.NativeMethods.User32ShowInactiveTopmost(taskbarForm);
|
||||
}
|
||||
|
||||
|
@ -49,16 +50,20 @@ namespace SystemTrayMenu
|
|||
|
||||
private void TaskbarForm_Resize(object sender, EventArgs e)
|
||||
{
|
||||
if (taskbarForm.WindowState == FormWindowState.Minimized)
|
||||
{
|
||||
taskbarForm.WindowState = FormWindowState.Normal;
|
||||
}
|
||||
taskbarForm.WindowState = FormWindowState.Normal;
|
||||
}
|
||||
|
||||
internal void TasbkarItemActivated(object sender, EventArgs e)
|
||||
{
|
||||
taskbarForm.WindowState = FormWindowState.Normal;
|
||||
taskbarForm.Activate();
|
||||
taskbarForm.Focus();
|
||||
menus.SwitchOpenCloseByTaskbarItem();
|
||||
}
|
||||
private void TaskbarForm_Deactivate(object sender, EventArgs e)
|
||||
{
|
||||
taskbarForm.WindowState = FormWindowState.Normal;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
|
|
|
@ -20,10 +20,7 @@ namespace SystemTrayMenu.UserInterface
|
|||
{
|
||||
Screen screen = Screen.PrimaryScreen;
|
||||
Location = new Point(screen.Bounds.Right - Size.Width,
|
||||
//we could show behind taskbar?
|
||||
//screen.Bounds.Bottom- Size.Height);
|
||||
//but at the moment we dont want to see this
|
||||
screen.Bounds.Bottom + 80); // - Size.Height);
|
||||
screen.Bounds.Bottom + 80); //Hide below taskbar
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue