-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #195 from Ordisoftware/dev
Dev
- Loading branch information
Showing
14 changed files
with
535 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/// <license> | ||
/// This file is part of Ordisoftware Hebrew Calendar. | ||
/// Copyright 2016-2019 Olivier Rogier. | ||
/// See www.ordisoftware.com for more information. | ||
/// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. | ||
/// If a copy of the MPL was not distributed with this file, You can obtain one at | ||
/// https://mozilla.org/MPL/2.0/. | ||
/// If it is not possible or desirable to put the notice in a particular file, | ||
/// then You may include the notice in a location(such as a LICENSE file in a | ||
/// relevant directory) where a recipient would be likely to look for such a notice. | ||
/// You may add additional accurate notices of copyright ownership. | ||
/// </license> | ||
/// <created> 2019-11 </created> | ||
/// <edited> 2019-11 </edited> | ||
using System; | ||
using System.Windows.Forms; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace Ordisoftware.HebrewCalendar | ||
{ | ||
|
||
public partial class LockSessionForm : Form | ||
{ | ||
|
||
[DllImport("user32.dll", SetLastError = true)] | ||
private static extern uint SendInput(uint numberOfInputs, INPUT[] inputs, int sizeOfInputStructure); | ||
|
||
[StructLayout(LayoutKind.Sequential)] | ||
internal struct INPUT | ||
{ | ||
public uint Type; | ||
public MOUSEKEYBDHARDWAREINPUT Data; | ||
} | ||
|
||
[StructLayout(LayoutKind.Explicit)] | ||
internal struct MOUSEKEYBDHARDWAREINPUT | ||
{ | ||
[FieldOffset(0)] | ||
public HARDWAREINPUT Hardware; | ||
[FieldOffset(0)] | ||
public KEYBDINPUT Keyboard; | ||
[FieldOffset(0)] | ||
public MOUSEINPUT Mouse; | ||
} | ||
|
||
[StructLayout(LayoutKind.Sequential)] | ||
internal struct KEYBDINPUT | ||
{ | ||
public ushort Vk; | ||
public ushort Scan; | ||
public uint Flags; | ||
public uint Time; | ||
public IntPtr ExtraInfo; | ||
} | ||
|
||
[StructLayout(LayoutKind.Sequential)] | ||
internal struct MOUSEINPUT | ||
{ | ||
public int X; | ||
public int Y; | ||
public uint MouseData; | ||
public uint Flags; | ||
public uint Time; | ||
public IntPtr ExtraInfo; | ||
} | ||
|
||
[StructLayout(LayoutKind.Sequential)] | ||
internal struct HARDWAREINPUT | ||
{ | ||
public uint Msg; | ||
public ushort ParamL; | ||
public ushort ParamH; | ||
} | ||
|
||
private void MediaStop() | ||
{ | ||
if ( !EditMediaStop.Checked ) return; | ||
INPUT input = new INPUT | ||
{ | ||
Type = 1 | ||
}; | ||
input.Data.Keyboard = new KEYBDINPUT() | ||
{ | ||
Vk = 0xB3, | ||
Scan = 0, | ||
Flags = 0, | ||
Time = 0, | ||
ExtraInfo = IntPtr.Zero, | ||
}; | ||
INPUT[] inputs = new INPUT[] { input }; | ||
SendInput(1, inputs, Marshal.SizeOf(typeof(INPUT))); | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.