⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 akeldll.h

📁 一个类似于notepad的文本编辑器源代码
💻 H
📖 第 1 页 / 共 4 页
字号:

Return Value
 zero


AKDN_OPENDOCUMENT_FINISH
________________________

Notification message, sends to the main procedure after document opened.

(HWND)wParam == rich edit window
(int)lParam  == open document error. See EOD_* messages.

Return Value
 zero


AKDN_SAVEDOCUMENT_START
_______________________

Notification message, sends to the main procedure before document saved.

(HWND)wParam            == rich edit window
(NSAVEDOCUMENT *)lParam == pointer to a NSAVEDOCUMENT structure
                           (NSAVEDOCUMENTA *)lParam   if bOldWindows == TRUE
                           (NSAVEDOCUMENTW *)lParam   if bOldWindows == FALSE

Return Value
 zero


AKDN_SAVEDOCUMENT_FINISH
________________________

Notification message, sends to the main procedure after document saved.

(HWND)wParam == rich edit window
(int)lParam  == save document error. See ESD_* messages.

Return Value
 zero


AKDN_SIZE
_________

Notification message, sends to the main procedure before windows size changed.

(HWND)wParam    == rich edit window handle, if its size will be changed
                   NULL, if MDI client size will be changed
(RECT *)lParam  == pointer to a client RECT

Return Value
 zero


AKDN_SEARCH_ENDED
_________________

Notification message, sends to the main procedure after find/replace dialog found nothing.

(HWND)wParam == find/replace dialog
lParam       == not used

Return Value
 zero


AKDN_ACTIVATE
_____________

Notification message, sends to the main procedure after another instance of the program activates main window.

wParam == not used
lParam == not used

Return Value
 zero


AKDN_RECENTFILESDELETE
______________________

Notification message, sends to the main procedure before displaying message about deleted non-existent recent files records.

(int)wParam    == records deleted
(BOOL *)lParam == TRUE   show message
                  FALSE  don't show message

Return Value
 zero


AKD_GETMAINPROC, AKD_GETEDITPROC, AKD_GETFRAMEPROC
_______________  _______________  ________________

Get procedure from main window subclass chain.

(int)wParam            == index of procedure in chain, if positive search from top
                          if negative from beginning
(WNDPROCDATA **)lParam == procedure data

Return Value
 zero, if successfull

Example (get program main procedure data):
 WNDPROCDATA *wpd;
 SendMessage(pd->hMainWnd, AKD_GETMAINPROC, -1, (LPARAM)&wpd);


AKD_SETMAINPROC, AKD_SETEDITPROC, AKD_SETFRAMEPROC
_______________  _______________  ________________

Set procedure in main window subclass chain.

(WNDPROC)wParam        == procedure address,
                          if (wParam == NULL) then lParam must point to the procedure
                            data that will be removed from main window subclass chain.
(WNDPROCDATA **)lParam == procedure data,
                          if (lParam == NULL) then create new procedure data
                          if (*(WNDPROCDATA **)lParam == NULL) then create new
                            procedure data and set it on top of the main window
                            subclass chain.
                          if (*(WNDPROCDATA **)lParam != NULL) then set wParam
                            procedure in procedure data and update main window
                            subclass chain.

Return Value
 zero

Example:
 WNDPROCDATA *wpd=NULL;
 LRESULT CALLBACK NewMainProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
   //...

   return wpd->NextProc(hWnd, uMsg, wParam, lParam);
 }
 wpd=NULL;
 SendMessage(pd->hMainWnd, AKD_SETMAINPROC, (WPARAM)NewMainProc, (LPARAM)&wpd);


AKD_GETMAINPROCRET, AKD_GETEDITPROCRET, AKD_GETFRAMEPROCRET
__________________  __________________  ___________________

Get return procedure from main window subclass chain. This procedure calls after message have been processed.

(int)wParam               == index of procedure in chain, if positive search from top
                             if negative from beginning
(WNDPROCRETDATA **)lParam == procedure data

Return Value
 zero, if successfull

Example:
 WNDPROCRETDATA *wprd;
 SendMessage(pd->hMainWnd, AKD_GETMAINPROC, 2, (LPARAM)&wprd);


AKD_SETMAINPROCRET, AKD_SETEDITPROCRET, AKD_SETFRAMEPROCRET
__________________  __________________  ___________________

Set return procedure in main window subclass chain. This procedure calls after message have been processed.

(WNDPROC)wParam        == procedure address,
                          if (wParam == NULL) then lParam must point to the procedure
                            data that will be removed from main window subclass chain.
(WNDPROCDATA **)lParam == procedure data,
                          if (lParam == NULL) then create new procedure data
                          if (*(WNDPROCDATA **)lParam == NULL) then create new
                            procedure data and set it on top of the main window
                            subclass chain.
                          if (*(WNDPROCDATA **)lParam != NULL) then set wParam
                            procedure in procedure data and update main window
                            subclass chain.

Return Value
 zero

Example:
 WNDPROCRETDATA *wprd=NULL;
 void CALLBACK NewMainProcRet(CWPRETSTRUCT *cwprs)
 {
   if (cwprs->message == WM_NOTIFY)
   {
     if (cwprs->wParam == ID_EDIT)
     {
       //...
     }
   }

   if (wprd->NextProc)
     wprd->NextProc(cwprs);
 }
 wprd=NULL;
 SendMessage(pd->hMainWnd, AKD_SETMAINPROCRET, (WPARAM)NewMainProcRet, (LPARAM)&wprd);


AKD_BEGINOPTIONS
________________

Begins read or save plugin options.

wParam                  == PO_READ  begins read options
                           PO_SAVE  begins save options
(unsigned char *)lParam == plugin name
                           (char *)lParam      if bOldWindows == TRUE
                           (wchar_t *)lParam   if bOldWindows == FALSE
Return Value
 HANDLE

Example read (bOldWindows == TRUE):
 PLUGINOPTIONA po;
 HANDLE hOptions;
 char szText[MAX_PATH];

 if (hOptions=(HANDLE)SendMessage(pd->hMainWnd, AKD_BEGINOPTIONS, PO_READ, (LPARAM)"ContextDLL"))
 {
   po.szOptionName="ContextMenuText";
   po.dwType=PO_STRING;
   po.lpData=(LPBYTE)szText;
   po.dwData=MAX_PATH;
   SendMessage(pd->hMainWnd, AKD_OPTION, (WPARAM)hOptions, (LPARAM)&po);

   SendMessage(pd->hMainWnd, AKD_ENDOPTIONS, (WPARAM)hOptions, 0);
 }

Example read (bOldWindows == FALSE):
 PLUGINOPTIONW po;
 HANDLE hOptions;
 wchar_t wszText[MAX_PATH];

 if (hOptions=(HANDLE)SendMessage(pd->hMainWnd, AKD_BEGINOPTIONS, PO_READ, (LPARAM)L"ContextDLL"))
 {
   po.wszOptionName=L"ContextMenuText";
   po.dwType=PO_STRING;
   po.lpData=(LPBYTE)wszText;
   po.dwData=MAX_PATH * sizeof(wchar_t);
   SendMessage(pd->hMainWnd, AKD_OPTION, (WPARAM)hOptions, (LPARAM)&po);

   SendMessage(pd->hMainWnd, AKD_ENDOPTIONS, (WPARAM)hOptions, 0);
 }

Example save (bOldWindows == TRUE):
 PLUGINOPTIONA po;
 HANDLE hOptions;
 char szText[MAX_PATH]="SomeText";

 if (hOptions=(HANDLE)SendMessage(pd->hMainWnd, AKD_BEGINOPTIONS, PO_SAVE, (LPARAM)"ContextDLL"))
 {
   po.szOptionName="ContextMenuText";
   po.dwType=PO_STRING;
   po.lpData=(LPBYTE)szText;
   po.dwData=lstrlen(szText) + 1;
   SendMessage(pd->hMainWnd, AKD_OPTION, (WPARAM)hOptions, (LPARAM)&po);

   SendMessage(pd->hMainWnd, AKD_ENDOPTIONS, (WPARAM)hOptions, 0);
 }

Example save (bOldWindows == FALSE):
 PLUGINOPTIONW po;
 HANDLE hOptions;
 wchar_t wszText[MAX_PATH]=L"SomeText";

 if (hOptions=(HANDLE)SendMessage(pd->hMainWnd, AKD_BEGINOPTIONS, PO_SAVE, (LPARAM)L"ContextDLL"))
 {
   po.wszOptionName=L"ContextMenuText";
   po.dwType=PO_STRING;
   po.lpData=(LPBYTE)wszText;
   po.dwData=lstrlenW(wszText) * sizeof(wchar_t) + 2;
   SendMessage(pd->hMainWnd, AKD_OPTION, (WPARAM)hOptions, (LPARAM)&po);

   SendMessage(pd->hMainWnd, AKD_ENDOPTIONS, (WPARAM)hOptions, 0);
 }


AKD_OPTION
__________

Read or save plugin option.

wParam                 == HANDLE returned by AKD_BEGINOPTIONS
(PLUGINOPTION *)lParam == pointer to a PLUGINOPTION structure
                          (PLUGINOPTIONA *)lParam   if bOldWindows == TRUE
                          (PLUGINOPTIONW *)lParam   if bOldWindows == FALSE
Return Value
 Length of the string copied to the buffer

Example:
 See AKD_BEGINOPTIONS examples


AKD_ENDOPTION
_____________

Ends plugin options.

wParam == HANDLE returned by AKD_BEGINOPTIONS
lParam == not used

Return Value
 TRUE   success
 FALSE  failed

Example:
 See AKD_BEGINOPTIONS examples


AKD_DLLCALL
___________

Call dll.

wParam == not used
lParam == pointer to a PLUGINCALLSEND structure if SendMessage used
          (PLUGINCALLSENDA *)lParam   if bOldWindows == TRUE
          (PLUGINCALLSENDW *)lParam   if bOldWindows == FALSE
          or pointer to a PLUGINCALLPOST, allocated with GlobalAlloc, if PostMessage used
          (PLUGINCALLPOSTA *)lParam   if bOldWindows == TRUE
          (PLUGINCALLPOSTW *)lParam   if bOldWindows == FALSE

Return Value
 zero

Example SendMessage (bOldWindows == TRUE):
 PLUGINCALLSENDA pc;
 pc.szFunction=szFunction;
 pc.bOnStart=FALSE;
 pc.lParam=0;
 SendMessage(pd->hMainWnd, AKD_DLLCALL, 0, (LPARAM)&pc);

Example SendMessage (bOldWindows == FALSE):
 PLUGINCALLSENDW pc;
 pc.wszFunction=wszFunction;
 pc.bOnStart=FALSE;
 pc.lParam=0;
 SendMessage(pd->hMainWnd, AKD_DLLCALL, 0, (LPARAM)&pc);

Example PostMessage (bOldWindows == TRUE):
 PLUGINCALLPOSTA *pc;
 if (pc=(PLUGINCALLPOSTA *)GlobalAlloc(GPTR, sizeof(PLUGINCALLPOSTA)))
 {
   lstrcpyn(pc->szFunction, szFunction, MAX_PATH);
   pc->bOnStart=FALSE;
   pc->lParam=0;
   PostMessage(pd->hMainWnd, AKD_DLLCALL, 0, (LPARAM)pc);
 }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -