Added: system shut down support
This commit is contained in:
parent
1577dcc24e
commit
40e5f65e57
23
MainForm.cs
23
MainForm.cs
@ -26,6 +26,7 @@ namespace AppLauncher
|
|||||||
//protected const int MOD_SHIFT = 0x4;
|
//protected const int MOD_SHIFT = 0x4;
|
||||||
//protected const int MOD_WIN = 0x8;
|
//protected const int MOD_WIN = 0x8;
|
||||||
protected const int WM_HOTKEY = 0x312;
|
protected const int WM_HOTKEY = 0x312;
|
||||||
|
protected const int WM_QUERYENDSESSION = 0x0011;
|
||||||
|
|
||||||
protected OptionsForm optionsForm = null;
|
protected OptionsForm optionsForm = null;
|
||||||
protected string sessionFilename = null;
|
protected string sessionFilename = null;
|
||||||
@ -127,17 +128,25 @@ namespace AppLauncher
|
|||||||
|
|
||||||
protected override void WndProc(ref Message m)
|
protected override void WndProc(ref Message m)
|
||||||
{
|
{
|
||||||
base.WndProc(ref m);
|
switch (m.Msg)
|
||||||
|
|
||||||
if (m.Msg != WM_HOTKEY) return;
|
|
||||||
|
|
||||||
switch (m.WParam.ToInt32())
|
|
||||||
{
|
{
|
||||||
case 1:
|
case WM_HOTKEY:
|
||||||
this.Visible = !this.Visible;
|
if (m.WParam.ToInt32() == 1)
|
||||||
|
{
|
||||||
|
this.Visible = !this.Visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case WM_QUERYENDSESSION:
|
||||||
|
requestExit = true;
|
||||||
|
this.Close();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default: break;
|
default: break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
base.WndProc(ref m);
|
||||||
}
|
}
|
||||||
|
|
||||||
public LauncherSession CurrentSession { get; set; } = null;
|
public LauncherSession CurrentSession { get; set; } = null;
|
||||||
|
Reference in New Issue
Block a user