npp_sendmsg not working
jairocontreras opened this issue · comments
npp_sendmsg NPPM_GETNBOPENFILES 0 0
echo $(MSG_RESULT)
the output is blank!
This is unexpected, it works for me.
Could you run
npe_debug 1
npp_sendmsg NPPM_GETNBOPENFILES 0 0
and tell what you see in the output starting from the line ; executing: NPP_SENDMSG NPPM_GETNBOPENFILES 0 0
?
For example, for me it is:
; executing: NPP_SENDMSG NPPM_GETNBOPENFILES 0 0
NPP_SENDMSG: NPPM_GETNBOPENFILES 0 0
; uMsg parameter...
CheckCmdArgs()
{
[in] "NPPM_GETNBOPENFILES"
[out] "NPPM_GETNBOPENFILES"
}
; wParam parameter...
CheckCmdArgs()
{
[in] "0"
[out] "0"
}
; lParam parameter...
CheckCmdArgs()
{
[in] "0"
[out] "0"
}
; uMsg = 2031 (0x7EF)
; wType = int, wParam = "0"
; lType = int, lParam = "0"
; calling SendMessage ...
; ... SendMessage has been called
And running a single command set
shows:
SET
local $(LAST_CMD_RESULT) = 1
local $(MSG_LPARAM) =
local $(MSG_RESULT) = 14
local $(MSG_WPARAM) =
From what I see on the screenshot, it looks like the first command npe_debug 1
had not been executed at all!
I have two questions:
- How are you running these commands? (For example, directly from NppExec's Console, or from NppExec's Execute window, or somehow else)?
- Could you additionally run the following commands
echo 1
echo 2
echo 3
and paste the output here?
thank you! i figured it out. i need to execute one command at a time. i'm getting one extra tab count though whether i use the console or execute window
The +1 tab corresponds to an invisible "new 1" tab in the Secondary View.
You can check:
npp_sendmsg NPPM_GETNBOPENFILES 0 PRIMARY_VIEW
echo $(MSG_RESULT) // possible output: 3
npp_sendmsg NPPM_GETNBOPENFILES 0 SECOND_VIEW
echo $(MSG_RESULT) // possible output: 1
npp_sendmsg NPPM_GETNBOPENFILES 0 0
echo $(MSG_RESULT) // possible output: 4 = 3 + 1
oh ok so even if i haven't opened a file in Other View it's still counted. that's not right 😕 not sure if that's a feature of this plugin or the app itself
This is the feature of Notepad++ itself.
NPP_SENDMSG simply invokes Win API function SendMessage.