Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #22 from lipnitsk/master
Browse files Browse the repository at this point in the history
Fix code to support 64-bit
  • Loading branch information
kbilsted committed Feb 7, 2017
2 parents c984e36 + df11d42 commit a9c4474
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 57 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -878,14 +878,14 @@ public interface IScintillaGateway
int GetTextLength(); int GetTextLength();


/// <summary>Retrieve a pointer to a function that processes messages for this Scintilla. (Scintilla feature 2184)</summary> /// <summary>Retrieve a pointer to a function that processes messages for this Scintilla. (Scintilla feature 2184)</summary>
int GetDirectFunction(); IntPtr GetDirectFunction();


/// <summary> /// <summary>
/// Retrieve a pointer value to use as the first argument when calling /// Retrieve a pointer value to use as the first argument when calling
/// the function returned by GetDirectFunction. /// the function returned by GetDirectFunction.
/// (Scintilla feature 2185) /// (Scintilla feature 2185)
/// </summary> /// </summary>
int GetDirectPointer(); IntPtr GetDirectPointer();


/// <summary>Set to overtype (true) or insert mode. (Scintilla feature 2186)</summary> /// <summary>Set to overtype (true) or insert mode. (Scintilla feature 2186)</summary>
void SetOvertype(bool overtype); void SetOvertype(bool overtype);
Expand Down Expand Up @@ -1503,10 +1503,10 @@ public interface IScintillaGateway
void SetViewEOL(bool visible); void SetViewEOL(bool visible);


/// <summary>Retrieve a pointer to the document object. (Scintilla feature 2357)</summary> /// <summary>Retrieve a pointer to the document object. (Scintilla feature 2357)</summary>
int GetDocPointer(); IntPtr GetDocPointer();


/// <summary>Change the document object used. (Scintilla feature 2358)</summary> /// <summary>Change the document object used. (Scintilla feature 2358)</summary>
void SetDocPointer(int pointer); void SetDocPointer(IntPtr pointer);


/// <summary>Set which document modification events are sent to the container. (Scintilla feature 2359)</summary> /// <summary>Set which document modification events are sent to the container. (Scintilla feature 2359)</summary>
void SetModEventMask(int mask); void SetModEventMask(int mask);
Expand Down Expand Up @@ -1985,15 +1985,15 @@ public interface IScintillaGateway
/// characters in the document. /// characters in the document.
/// (Scintilla feature 2520) /// (Scintilla feature 2520)
/// </summary> /// </summary>
int GetCharacterPointer(); IntPtr GetCharacterPointer();


/// <summary> /// <summary>
/// Return a read-only pointer to a range of characters in the document. /// Return a read-only pointer to a range of characters in the document.
/// May move the gap so that the range is contiguous, but will only move up /// May move the gap so that the range is contiguous, but will only move up
/// to rangeLength bytes. /// to rangeLength bytes.
/// (Scintilla feature 2643) /// (Scintilla feature 2643)
/// </summary> /// </summary>
int GetRangePointer(int position, int rangeLength); IntPtr GetRangePointer(int position, int rangeLength);


/// <summary> /// <summary>
/// Return a position which, to avoid performance costs, should not be within /// Return a position which, to avoid performance costs, should not be within
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1801,21 +1801,19 @@ public int GetTextLength()
} }


/// <summary>Retrieve a pointer to a function that processes messages for this Scintilla. (Scintilla feature 2184)</summary> /// <summary>Retrieve a pointer to a function that processes messages for this Scintilla. (Scintilla feature 2184)</summary>
public int GetDirectFunction() public IntPtr GetDirectFunction()
{ {
IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETDIRECTFUNCTION, Unused, Unused); return Win32.SendMessage(scintilla, SciMsg.SCI_GETDIRECTFUNCTION, Unused, Unused);
return (int) res;
} }


/// <summary> /// <summary>
/// Retrieve a pointer value to use as the first argument when calling /// Retrieve a pointer value to use as the first argument when calling
/// the function returned by GetDirectFunction. /// the function returned by GetDirectFunction.
/// (Scintilla feature 2185) /// (Scintilla feature 2185)
/// </summary> /// </summary>
public int GetDirectPointer() public IntPtr GetDirectPointer()
{ {
IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETDIRECTPOINTER, Unused, Unused); return Win32.SendMessage(scintilla, SciMsg.SCI_GETDIRECTPOINTER, Unused, Unused);
return (int) res;
} }


/// <summary>Set to overtype (true) or insert mode. (Scintilla feature 2186)</summary> /// <summary>Set to overtype (true) or insert mode. (Scintilla feature 2186)</summary>
Expand Down Expand Up @@ -2992,14 +2990,13 @@ public void SetViewEOL(bool visible)
} }


/// <summary>Retrieve a pointer to the document object. (Scintilla feature 2357)</summary> /// <summary>Retrieve a pointer to the document object. (Scintilla feature 2357)</summary>
public int GetDocPointer() public IntPtr GetDocPointer()
{ {
IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETDOCPOINTER, Unused, Unused); return Win32.SendMessage(scintilla, SciMsg.SCI_GETDOCPOINTER, Unused, Unused);
return (int) res;
} }


/// <summary>Change the document object used. (Scintilla feature 2358)</summary> /// <summary>Change the document object used. (Scintilla feature 2358)</summary>
public void SetDocPointer(int pointer) public void SetDocPointer(IntPtr pointer)
{ {
IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETDOCPOINTER, Unused, pointer); IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETDOCPOINTER, Unused, pointer);
} }
Expand Down Expand Up @@ -3936,10 +3933,9 @@ public void CopyAllowLine()
/// characters in the document. /// characters in the document.
/// (Scintilla feature 2520) /// (Scintilla feature 2520)
/// </summary> /// </summary>
public int GetCharacterPointer() public IntPtr GetCharacterPointer()
{ {
IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCHARACTERPOINTER, Unused, Unused); return Win32.SendMessage(scintilla, SciMsg.SCI_GETCHARACTERPOINTER, Unused, Unused);
return (int) res;
} }


/// <summary> /// <summary>
Expand All @@ -3948,10 +3944,9 @@ public int GetCharacterPointer()
/// to rangeLength bytes. /// to rangeLength bytes.
/// (Scintilla feature 2643) /// (Scintilla feature 2643)
/// </summary> /// </summary>
public int GetRangePointer(int position, int rangeLength) public IntPtr GetRangePointer(int position, int rangeLength)
{ {
IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETRANGEPOINTER, position, rangeLength); return Win32.SendMessage(scintilla, SciMsg.SCI_GETRANGEPOINTER, position, rangeLength);
return (int) res;
} }


/// <summary> /// <summary>
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public struct ScNotificationHeader
/// <summary> /// <summary>
/// CtrlID of the window issuing the notification /// CtrlID of the window issuing the notification
/// </summary> /// </summary>
public uint IdFrom; public IntPtr IdFrom;


/// <summary> /// <summary>
/// The SCN_* notification Code /// The SCN_* notification Code
Expand All @@ -46,8 +46,8 @@ public struct ScNotification
public int Length; /* SCN_MODIFIED */ public int Length; /* SCN_MODIFIED */
public int LinesAdded; /* SCN_MODIFIED */ public int LinesAdded; /* SCN_MODIFIED */
public int Message; /* SCN_MACRORECORD */ public int Message; /* SCN_MACRORECORD */
public uint wParam; /* SCN_MACRORECORD */ public IntPtr wParam; /* SCN_MACRORECORD */
public int lParam; /* SCN_MACRORECORD */ public IntPtr lParam; /* SCN_MACRORECORD */


/// <summary> /// <summary>
/// 0-based index /// 0-based index
Expand Down
108 changes: 76 additions & 32 deletions Visual Studio Project Template C#/PluginInfrastructure/Win32.cs
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class Win32
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net /// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary> /// </summary>
[DllImport("user32")] [DllImport("user32")]
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, NppMenuCmd lParam); public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam);


/// <summary> /// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as /// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
Expand All @@ -24,7 +24,7 @@ public class Win32
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net /// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary> /// </summary>
[DllImport("user32")] [DllImport("user32")]
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, IntPtr lParam); public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder lParam);


/// <summary> /// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as /// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
Expand All @@ -33,7 +33,7 @@ public class Win32
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net /// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary> /// </summary>
[DllImport("user32")] [DllImport("user32")]
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, int lParam); public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam);


/// <summary> /// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as /// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
Expand All @@ -42,123 +42,167 @@ public class Win32
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net /// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary> /// </summary>
[DllImport("user32")] [DllImport("user32")]
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, out int lParam); public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, out IntPtr lParam);


/// <summary> /// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as /// 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"/>. /// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
/// If gateways are missing or incomplete, please help extend them and send your code to the project /// If gateways are missing or incomplete, please help extend them and send your code to the project
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net /// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary> /// </summary>
[DllImport("user32")] public static IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, NppMenuCmd lParam)
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, int lParam); {
return SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), new IntPtr((uint)lParam));
}

/// <summary> /// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as /// 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"/>. /// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
/// If gateways are missing or incomplete, please help extend them and send your code to the project /// If gateways are missing or incomplete, please help extend them and send your code to the project
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net /// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary> /// </summary>
public static IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, IntPtr lParam)
{
return SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), lParam);
}


/// <summary> /// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as /// 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"/>. /// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
/// If gateways are missing or incomplete, please help extend them and send your code to the project /// If gateways are missing or incomplete, please help extend them and send your code to the project
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net /// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary> /// </summary>
[DllImport("user32")] public static IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, int lParam)
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, ref LangType lParam); {
return SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), new IntPtr(lParam));
}


/// <summary> /// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as /// 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"/>. /// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
/// If gateways are missing or incomplete, please help extend them and send your code to the project /// If gateways are missing or incomplete, please help extend them and send your code to the project
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net /// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary> /// </summary>
[DllImport("user32")] public static IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, out int lParam)
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder lParam); {
IntPtr outVal;
IntPtr retval = SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), out outVal);
lParam = outVal.ToInt32();
return retval;
}


/// <summary> /// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as /// 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"/>. /// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
/// If gateways are missing or incomplete, please help extend them and send your code to the project /// If gateways are missing or incomplete, please help extend them and send your code to the project
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net /// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary> /// </summary>
[DllImport("user32")] public static IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, int lParam)
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam); {
return SendMessage(hWnd, (UInt32)Msg, wParam, new IntPtr(lParam));
}


/// <summary> /// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as /// 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"/>. /// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
/// If gateways are missing or incomplete, please help extend them and send your code to the project /// If gateways are missing or incomplete, please help extend them and send your code to the project
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net /// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary> /// </summary>
[DllImport("user32")] public static IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder lParam)
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam); {
return SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), lParam);
}


/// <summary> /// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as /// 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"/>. /// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
/// If gateways are missing or incomplete, please help extend them and send your code to the project /// If gateways are missing or incomplete, please help extend them and send your code to the project
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net /// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary> /// </summary>
[DllImport("user32")] public static IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam)
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder lParam); {

return SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), lParam);
}


// TODO KBG Experimental
/// <summary> /// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as /// 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"/>. /// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
/// If gateways are missing or incomplete, please help extend them and send your code to the project /// If gateways are missing or incomplete, please help extend them and send your code to the project
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net /// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary> /// </summary>
[DllImport("user32")] public static IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, IntPtr wParam, int lParam)
public static extern IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, IntPtr wParam, IntPtr lParam); {
return SendMessage(hWnd, (UInt32)Msg, wParam, new IntPtr(lParam));
}

/// <summary> /// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as /// 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"/>. /// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
/// If gateways are missing or incomplete, please help extend them and send your code to the project /// If gateways are missing or incomplete, please help extend them and send your code to the project
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net /// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary> /// </summary>
[DllImport("user32")] public static IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, int wParam, IntPtr lParam)
public static extern IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, IntPtr wParam, int lParam); {

return SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), lParam);
}


/// <summary> /// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as /// 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"/>. /// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
/// If gateways are missing or incomplete, please help extend them and send your code to the project /// If gateways are missing or incomplete, please help extend them and send your code to the project
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net /// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary> /// </summary>
[DllImport("user32")] public static IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, int wParam, string lParam)
public static extern IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, int wParam, IntPtr lParam); {
return SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), lParam);
}


/// <summary> /// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as /// 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"/>. /// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
/// If gateways are missing or incomplete, please help extend them and send your code to the project /// If gateways are missing or incomplete, please help extend them and send your code to the project
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net /// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary> /// </summary>
[DllImport("user32")] public static IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, int wParam, [MarshalAs(UnmanagedType.LPStr)] StringBuilder lParam)
public static extern IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, int wParam, string lParam); {
return SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), lParam);
}


/// <summary> /// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as /// 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"/>. /// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
/// If gateways are missing or incomplete, please help extend them and send your code to the project /// If gateways are missing or incomplete, please help extend them and send your code to the project
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net /// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary> /// </summary>
[DllImport("user32")] public static IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, int wParam, int lParam)
public static extern IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, int wParam, [MarshalAs(UnmanagedType.LPStr)] StringBuilder lParam); {
return SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), new IntPtr(lParam));
}


/// <summary> /// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as /// 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"/>. /// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
/// If gateways are missing or incomplete, please help extend them and send your code to the project /// If gateways are missing or incomplete, please help extend them and send your code to the project
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net /// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary> /// </summary>
[DllImport("user32")] public static IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, IntPtr wParam, IntPtr lParam)
public static extern IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, int wParam, int lParam); {
return SendMessage(hWnd, (UInt32)Msg, wParam, 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, ref LangType lParam)
{
IntPtr outVal;
IntPtr retval = SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), out outVal);
lParam = (LangType)outVal;
return retval;
}


public const int MAX_PATH = 260; public const int MAX_PATH = 260;


Expand Down Expand Up @@ -186,4 +230,4 @@ public class Win32
[DllImport("kernel32")] [DllImport("kernel32")]
public static extern void OutputDebugString(string lpOutputString); public static extern void OutputDebugString(string lpOutputString);
} }
} }

0 comments on commit a9c4474

Please sign in to comment.