用C ++创建Notepad ++插件

时间:2017-09-28 04:07:46

标签: c++ visual-studio plugins notepad++

我在Visual Studio中创建了一个notepad ++插件。 我已经下载了demo插件并尝试了一些基本功能,它正在运行。

我正在寻找一些有助于我的要求的功能,即#34;在当前文件中查找已打开的特定文本并将其复制到新文件中。"

我知道如何打开新文件

// Open a new document
::SendMessage(nppData._nppHandle, NPPM_MENUCOMMAND, 0, IDM_FILE_NEW);

我只想找到和复制文字的功能。

基本上我想使用可用的记事本选项,如serach,find,替换VC中的插件代码。任何帮助都将不胜感激。

由于

1 个答案:

答案 0 :(得分:0)

    `//Belong to MENU FILE
    #define    IDM_OPEN_ALL_RECENT_FILE             (IDM_EDIT + 40)
    #define    IDM_CLEAN_RECENT_FILE_LIST           (IDM_EDIT + 41)

#define    IDM_SEARCH    (IDM + 3000)
    #define    IDM_SEARCH_FIND                 (IDM_SEARCH + 1)
    #define    IDM_SEARCH_FINDNEXT             (IDM_SEARCH + 2)
    #define    IDM_SEARCH_REPLACE              (IDM_SEARCH + 3)
    #define    IDM_SEARCH_GOTOLINE             (IDM_SEARCH + 4)
    #define    IDM_SEARCH_TOGGLE_BOOKMARK      (IDM_SEARCH + 5)
    #define    IDM_SEARCH_NEXT_BOOKMARK        (IDM_SEARCH + 6)
    #define    IDM_SEARCH_PREV_BOOKMARK        (IDM_SEARCH + 7)
    #define    IDM_SEARCH_CLEAR_BOOKMARKS      (IDM_SEARCH + 8)
    #define    IDM_SEARCH_GOTOMATCHINGBRACE    (IDM_SEARCH + 9)
    #define    IDM_SEARCH_FINDPREV             (IDM_SEARCH + 10)
    #define    IDM_SEARCH_FINDINCREMENT        (IDM_SEARCH + 11)
    #define    IDM_SEARCH_FINDINFILES          (IDM_SEARCH + 13)
    #define    IDM_SEARCH_VOLATILE_FINDNEXT    (IDM_SEARCH + 14)
    #define    IDM_SEARCH_VOLATILE_FINDPREV    (IDM_SEARCH + 15)
    #define    IDM_SEARCH_CUTMARKEDLINES       (IDM_SEARCH + 18)
    #define    IDM_SEARCH_COPYMARKEDLINES      (IDM_SEARCH + 19)
    #define    IDM_SEARCH_PASTEMARKEDLINES     (IDM_SEARCH + 20)
    #define    IDM_SEARCH_DELETEMARKEDLINES    (IDM_SEARCH + 21)
    #define    IDM_SEARCH_MARKALLEXT1          (IDM_SEARCH + 22)
    #define    IDM_SEARCH_UNMARKALLEXT1        (IDM_SEARCH + 23)
    #define    IDM_SEARCH_MARKALLEXT2          (IDM_SEARCH + 24)
    #define    IDM_SEARCH_UNMARKALLEXT2        (IDM_SEARCH + 25)
    #define    IDM_SEARCH_MARKALLEXT3          (IDM_SEARCH + 26)
    #define    IDM_SEARCH_UNMARKALLEXT3        (IDM_SEARCH + 27)
    #define    IDM_SEARCH_MARKALLEXT4          (IDM_SEARCH + 28)
    #define    IDM_SEARCH_UNMARKALLEXT4        (IDM_SEARCH + 29)
    #define    IDM_SEARCH_MARKALLEXT5          (IDM_SEARCH + 30)
    #define    IDM_SEARCH_UNMARKALLEXT5        (IDM_SEARCH + 31)
    #define    IDM_SEARCH_CLEARALLMARKS        (IDM_SEARCH + 32)

    #define    IDM_SEARCH_GOPREVMARKER1        (IDM_SEARCH + 33)
    #define    IDM_SEARCH_GOPREVMARKER2        (IDM_SEARCH + 34)
    #define    IDM_SEARCH_GOPREVMARKER3        (IDM_SEARCH + 35)
    #define    IDM_SEARCH_GOPREVMARKER4        (IDM_SEARCH + 36)
    #define    IDM_SEARCH_GOPREVMARKER5        (IDM_SEARCH + 37)
    #define    IDM_SEARCH_GOPREVMARKER_DEF     (IDM_SEARCH + 38)

    #define    IDM_SEARCH_GONEXTMARKER1        (IDM_SEARCH + 39)
    #define    IDM_SEARCH_GONEXTMARKER2        (IDM_SEARCH + 40)
    #define    IDM_SEARCH_GONEXTMARKER3        (IDM_SEARCH + 41)
    #define    IDM_SEARCH_GONEXTMARKER4        (IDM_SEARCH + 42)
    #define    IDM_SEARCH_GONEXTMARKER5        (IDM_SEARCH + 43)
    #define    IDM_SEARCH_GONEXTMARKER_DEF     (IDM_SEARCH + 44)

    #define    IDM_FOCUS_ON_FOUND_RESULTS      (IDM_SEARCH + 45)
    #define    IDM_SEARCH_GOTONEXTFOUND        (IDM_SEARCH + 46)
    #define    IDM_SEARCH_GOTOPREVFOUND        (IDM_SEARCH + 47)

    #define    IDM_SEARCH_SETANDFINDNEXT       (IDM_SEARCH + 48)
    #define    IDM_SEARCH_SETANDFINDPREV       (IDM_SEARCH + 49)
    #define    IDM_SEARCH_INVERSEMARKS         (IDM_SEARCH + 50)
    #define    IDM_SEARCH_DELETEUNMARKEDLINES  (IDM_SEARCH + 51)
    #define    IDM_SEARCH_FINDCHARINRANGE      (IDM_SEARCH + 52)
    #define    IDM_SEARCH_SELECTMATCHINGBRACES (IDM_SEARCH + 53)
    #define    IDM_SEARCH_MARK                 (IDM_SEARCH + 54)`