public void SetXML(string xml) { this.SetText(xml); NppMenuCmd mnuCmd = NppMenuCmd.IDM_LANG_XML; Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_MENUCOMMAND, 0, mnuCmd); }
private void btnClose_Click(object sender, EventArgs e) { try { NppMenuCmd mnuCmd = NppMenuCmd.IDM_FILE_CLOSE; Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_MENUCOMMAND, 0, mnuCmd); } catch (Exception ex) { MessageBox.Show("An unexpected error occurred. " + ex.Message, "Close Document Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg Msg, int wParam, NppMenuCmd lParam);
/// <summary> /// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as /// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>. /// If gateways are missing or incomplete, please help extend them and send your code to the project /// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net /// </summary> public static IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, NppMenuCmd lParam) { return(SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), new IntPtr((uint)lParam))); }
IntPtr send(NppMsg command, int wParam, NppMenuCmd lParam) { return(Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)command, wParam, lParam)); }
/// <summary> /// Allows to execute one of Npp's command /// </summary> /// <param name="cmd"></param> public static void RunCommand(NppMenuCmd cmd) { Win32Api.SendMessage(Handle, NppMsg.NPPM_MENUCOMMAND, 0, cmd); }
/// <summary> /// Sends the menu command. /// </summary> /// <param name="editor">The editor.</param> /// <param name="command">The command.</param> /// <returns></returns> public static IntPtr SendMenuCommand(this NotepadPPGateway editor, NppMenuCmd command) => Win32.SendMessage(editor.Handle, (uint)NppMsg.NPPM_MENUCOMMAND, 0, NppMenuCmd.IDM_FILE_NEW);
internal static IntPtr SendMenuCmd(IntPtr hWnd, NppMenuCmd wParam, int lParam) { return(Win32.SendMessage(hWnd, (uint)WinMsg.WM_COMMAND, (int)wParam, lParam)); }
public static IntPtr SendMenuCommand(NppMenuCmd command) => Win32.SendMessage(Npp.Editor.Handle, (uint)NppMsg.NPPM_MENUCOMMAND, 0, NppMenuCmd.IDM_FILE_NEW);
/// <summary> /// Allows to execute one of Npp's command /// </summary> /// <param name="cmd"></param> public static void RunCommand(NppMenuCmd cmd) { WinApi.SendMessage(HandleNpp, NppMsg.NPPM_MENUCOMMAND, 0, cmd); }