Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 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);
     }
 }
Esempio n. 3
0
 public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg Msg, int wParam, NppMenuCmd lParam);
Esempio n. 4
0
 /// <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)));
 }
 public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg Msg, int wParam, NppMenuCmd lParam);
Esempio n. 6
0
 IntPtr send(NppMsg command, int wParam, NppMenuCmd lParam)
 {
     return(Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)command, wParam, lParam));
 }
Esempio n. 7
0
 /// <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);
 }
Esempio n. 8
0
 /// <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);
Esempio n. 9
0
 internal static IntPtr SendMenuCmd(IntPtr hWnd, NppMenuCmd wParam, int lParam)
 {
     return(Win32.SendMessage(hWnd, (uint)WinMsg.WM_COMMAND, (int)wParam, lParam));
 }
Esempio n. 10
0
 public static IntPtr SendMenuCommand(NppMenuCmd command)
 => Win32.SendMessage(Npp.Editor.Handle, (uint)NppMsg.NPPM_MENUCOMMAND, 0, NppMenuCmd.IDM_FILE_NEW);
Esempio n. 11
0
File: Npp.cs Progetto: jcaillon/3P
 /// <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);
 }