You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/docs/plugin-communication.md
+14-4Lines changed: 14 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1372,7 +1372,7 @@ receives the full path names of all the opened files in Notepad++
1372
1372
1373
1373
*lParam [in]*
1374
1374
: int nbFile,
1375
-
is the size of the fileNames array. Get this value by using NPPM_GETNBOPENFILES message with constant ALL_OPEN_FILES, then allocate fileNames array with this value.
1375
+
is the size of the fileNames array. Get this value by using NPPM_GETNBOPENFILES message with constant ALL_OPEN_FILES, then allocate fileNames array with this value (noting the size requirements for an [Array of Path Strings](#array-of-path-strings)).
1376
1376
1377
1377
**Return value**:
1378
1378
: Returns The number of files copied into fileNames array.
@@ -1391,7 +1391,7 @@ receives the full path names of the opened files in the primary view
1391
1391
1392
1392
*lParam [in]*
1393
1393
: int nbFile,
1394
-
is the size of the fileNames array. Get this value by using NPPM_GETNBOPENFILES message with constant PRIMARY_VIEW, then allocate fileNames array with this value.
1394
+
is the size of the fileNames array. Get this value by using NPPM_GETNBOPENFILES message with constant PRIMARY_VIEW, then allocate fileNames array with this value (noting the size requirements for an [Array of Path Strings](#array-of-path-strings)).
1395
1395
1396
1396
1397
1397
**Return value**:
@@ -1411,7 +1411,7 @@ receives the full path names of the opened files in the second view
1411
1411
1412
1412
*lParam [in]*
1413
1413
: int nbFile,
1414
-
is the size of your fileNames array. You should get this value by using NPPM_GETNBOPENFILES message with constant SECOND_VIEW, then allocate fileNames array with this value.
1414
+
is the size of your fileNames array. You should get this value by using NPPM_GETNBOPENFILES message with constant SECOND_VIEW, then allocate fileNames array with this value (noting the size requirements for an [Array of Path Strings](#array-of-path-strings)).
1415
1415
1416
1416
**Return value**:
1417
1417
: Returns The number of files copied into fileNames array.
@@ -1503,7 +1503,7 @@ the path for cloud settings obtained by this message
1503
1503
*wParam [out]*
1504
1504
: wchar_t ** sessionFileArray,
1505
1505
the array in which the files' full path of the same group are written.
1506
-
To allocate the array with the proper size, send message NPPM_GETNBSESSIONFILES.
1506
+
To allocate the array with the proper size, use the message NPPM_GETNBSESSIONFILES to get the number of strings needed, then allocate each path entry string (noting the size requirements for an [Array of Path Strings](#array-of-path-strings)).
1507
1507
1508
1508
*lParam [in]*
1509
1509
: const wchar_t * sessionFileName,
@@ -2728,3 +2728,13 @@ The BufferID received by a notification is not necessarily the _active_ buffer.
2728
2728
docIndex = value & 0x3FFFFFFF
2729
2729
NPPM_ACTIVATEDOC(view, docIndex)
2730
2730
```
2731
+
2732
+
### Array of Path Strings
2733
+
2734
+
Some of the messages have a `wchar_t **` type, which is an array of wide-character strings.
2735
+
All such messages require you to pre-allocate the array, with enough strings, and enough
2736
+
_wide_ characters (2 bytes each) for each string. Since these messages are dealing with paths,
2737
+
you should allocate enough per string for [`MAX_PATH`](https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file "MS Learn: MAX_PATH")
2738
+
_wide characters_: if your programming interface allocates strings based on number of bytes,
2739
+
then you will need to allocate `2*MAX_PATH` for the number of bytes, to be able to hold
0 commit comments