Need help with messaging/notifications with Scintilla/Notepa
Posted: Wed Mar 27, 2013 6:29 pm
Hello,
I plan to developed a simple plugin for Notepad++ and I wonder how I could add an icon to Notepadd++ to start the plugin.
I know that I need to use the „beNotified“ procedure for this and catch a certain notification there before I can add my icon.
To the "beNotified" procedure Notepad++ will send all its notifications so here you can catch a certain message and react to it – in my case I need to catch the #NPPN_TBMODIFICATION message
(https://sourceforge.net/apps/mediawiki/ ... ifications)
Now my problem is that I dont know how to write the „beNotified“ procedure in Purebasic.
I have found many snippets for other languages, for example:
In Python „beNotified“ looks like this:
In C:
I understand that I need to work with the SCNotification structure that is already defined in Purebasic
So here is what I have tried to so far (I leave all my commented attempts so you can see what I have tried so far...)
But nothing works.... NPPN_TBMODIFICATION is never caught...
Heinz
I plan to developed a simple plugin for Notepad++ and I wonder how I could add an icon to Notepadd++ to start the plugin.
I know that I need to use the „beNotified“ procedure for this and catch a certain notification there before I can add my icon.
To the "beNotified" procedure Notepad++ will send all its notifications so here you can catch a certain message and react to it – in my case I need to catch the #NPPN_TBMODIFICATION message
(https://sourceforge.net/apps/mediawiki/ ... ifications)
Now my problem is that I dont know how to write the „beNotified“ procedure in Purebasic.
I have found many snippets for other languages, for example:
In Python „beNotified“ looks like this:
Code: Select all
extern "C" __declspec(dllexport) void beNotified(SCNotification *notifyCode)
{
switch(notifyCode->nmhdr.code)
{
case NPPN_TBMODIFICATION:
{ ....add icon hereCode: Select all
void beNotified(SciNotification *notif)
if (notifyCode->nmhdr.code == NPPN_TBMODIFICATION)
{.... add icon here
}So here is what I have tried to so far (I leave all my commented attempts so you can see what I have tried so far...)
Code: Select all
;ProcedureCDLL.l beNotified(Hwnd.l , Msg.l , wParam.l , lParam.l )
;ProcedureCDLL.l beNotified(msg.l)
;ProcedureCDLL.l beNotified(*notify.SCNotification)
ProcedureCDLL.l beNotified(*SCNotification)
Protected LocalSCNotification.SCNotification
CopyMemory(@*SCNotification, @LocalSCNotification, SizeOf(SCNotification)) ;needed? Cannt I work with the passed structure...?
; *lpnmhdr.NMHDR = lParam
; *notify.SCNotification = lParam
; debuglog ("*lpnmhdr\code =" + *lpnmhdr\code)
; debuglog ("*notify\message=" + *notify\message)
;Select Msg
;Select *xnotify\message
Select LocalSCNotification\message
Case #WM_NOTIFY
; *lpnmhdr.NMHDR = lParam
; *notify.SCNotification = lParam
; debuglog ("*lpnmhdr\code =" + *lpnmhdr\code)
; debuglog ("*notify\message=" + *notify\message)
; Select *lpnmhdr\code
; Select *xnotify\nmhdr\code
Select LocalSCNotification\nmhdr\code
; if (notifyCode.nmhdr.code == (uint)NppMsg.NPPN_TBMODIFICATION)
Case #NPPN_TBMODIFICATION
....Heinz