public static void Send(APPCOMMAND appCommand, IntPtr handle) { if (handle == null) { throw new NullReferenceException("Failed to get the handle"); } Debug.WriteLine($"Send AppCommand {appCommand}"); SendMessageW(handle, WM_APPCOMMAND, handle, (IntPtr)((int)appCommand * 65536)); }
private const int WM_APPCOMMAND = 0x319; //Windows.h public static void Send(APPCOMMAND appCommand) { var handle = NUMC.Service.GetService()?.GetMain()?.Handle; if (handle == null) { throw new NullReferenceException( "Failed to get the handle of the service main form"); } Send(appCommand, handle.Value); }
public AppCommandDialog(APPCOMMAND appCommand) { InitializeComponent(); InitializeComboBox(); for (int i = 0; i < _appCommands.Length; i++) { var r = _appCommands[i]; if (r?.Command != appCommand) { continue; } commandComboBox.SelectedIndex = i; break; } }
public static string APPCOMMANDToString(APPCOMMAND appCommand, ResourceManager resource = null) { var r = resource ?? GetResource(); return(r.GetString(appCommand.ToString())); }