mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-09-29 16:51:18 +13: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
2 changed files with 10 additions and 8 deletions
|
@ -39,6 +39,7 @@ namespace SystemTrayMenu
|
||||||
taskbarForm.Activated += TasbkarItemActivated;
|
taskbarForm.Activated += TasbkarItemActivated;
|
||||||
taskbarForm.Resize += TaskbarForm_Resize;
|
taskbarForm.Resize += TaskbarForm_Resize;
|
||||||
taskbarForm.FormClosed += TaskbarForm_FormClosed;
|
taskbarForm.FormClosed += TaskbarForm_FormClosed;
|
||||||
|
taskbarForm.Deactivate += TaskbarForm_Deactivate;
|
||||||
DllImports.NativeMethods.User32ShowInactiveTopmost(taskbarForm);
|
DllImports.NativeMethods.User32ShowInactiveTopmost(taskbarForm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,16 +50,20 @@ namespace SystemTrayMenu
|
||||||
|
|
||||||
private void TaskbarForm_Resize(object sender, EventArgs e)
|
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)
|
internal void TasbkarItemActivated(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
taskbarForm.WindowState = FormWindowState.Normal;
|
||||||
|
taskbarForm.Activate();
|
||||||
|
taskbarForm.Focus();
|
||||||
menus.SwitchOpenCloseByTaskbarItem();
|
menus.SwitchOpenCloseByTaskbarItem();
|
||||||
}
|
}
|
||||||
|
private void TaskbarForm_Deactivate(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
taskbarForm.WindowState = FormWindowState.Normal;
|
||||||
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,10 +20,7 @@ namespace SystemTrayMenu.UserInterface
|
||||||
{
|
{
|
||||||
Screen screen = Screen.PrimaryScreen;
|
Screen screen = Screen.PrimaryScreen;
|
||||||
Location = new Point(screen.Bounds.Right - Size.Width,
|
Location = new Point(screen.Bounds.Right - Size.Width,
|
||||||
//we could show behind taskbar?
|
screen.Bounds.Bottom + 80); //Hide below taskbar
|
||||||
//screen.Bounds.Bottom- Size.Height);
|
|
||||||
//but at the moment we dont want to see this
|
|
||||||
screen.Bounds.Bottom + 80); // - Size.Height);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue