?_øÿÿÿÿÊœèßl! †_3WebEdit 3.0 API SpecBrowseButtons()ZmainmainWebEdit 3.0 API Spec  ./&;)z4ÿÿ ‹ ÿÿÿÿ|CONTEXT›”|CTXOMAPZ|FONTFy|KWBTREE=€|KWDATAe|KWMAP&€|SYSTEM|TOPIC'|TTLBTREElŒttÿÿÿÿ U$ÿÿÿÿa1¤ÿÿÿÿîa¯"WebEdit Module API Specification 3.0N( ¯& €P€€€‚ÿWebEdit Module API Specification 3.0&aÕ# €€€‚ÿ€]¯U# €º€€‚ÿThe following defines WebEdit modules, how to write them, and how WebEdit deals with them.&Õ{# €€€‚ÿ§cU"D X€Æ€ãôˆ<%€‰‚‚ã~Ý£«‰‚‚ã¹—>Ö‰‚‚㊹ʼn€‚ÿWhat is a WebEdit module?How does WebEdit use modules?Required FunctionsAPI callsJ{l1JÈl¯ÈWhat is a WebEdit module?C"¯& €:€€€‚ÿWhat is a WebEdit module?í¸lœ5 8€q€€‚€€‚‚‚€€‚‚ÿDefinitionA WebEdit module is a user-written routine that can be installed into, and run from WebEdit. ImplementationWebEdit modules are placed in Windows DLLs, which are then named with the extension .WEM. These modules should be placed in the same directory as the WebEdit.EXE file. In addition to the functions required by Windows, every .WEM file must contain, at minimum, two additional functions: EnumModules and RunModule. EnumModules will be executed by WebEdit upon startup, and will return information to WebEdit describing the modules in the .WEM file. RunModule will then be called to execute each individual module. Modules MUST use the 'C' style DLL calling convention. ,¯È' € €€‚€‚ÿNœ1vîù]¢How does WebEdit use modules?G!È]& €B€€€‚ÿHow does WebEdit use modules?E¢5 8€!€€‚€€‚‚‚€€‚‚ÿDetection and InstallationAt startup, WebEdit will search its directory for files with the .WEM extension. As each one is found, WebEdit will call its EnumModules routine. EnumModules will pass back the name of each module contained in the .WEM file, and any flags that may pertain to their operation. WebEdit will use this information to place an appropriate title in the tools menu. UsageWhen a menu item is selected from the Tools menu, WebEdit will call (via RunModule) the module associated with the menu item. C]å1È2†å!  Required Functions<¢! & €,€€€‚ÿRequired Functionsä¯å 5 8€_€€‚‚‚ãVuቂ‚ãß,ýo‰‚ÿEach .WEM file must contain, at minimum, the following functions in order to provide WebEdit with a way to access the modules that it contains.EnumModulesRunModule< ! A 1gÿÿÿÿc A v ¬ EnumModules5 v & €€€€‚ÿEnumModules«A y X ~€W€€‚€€‚‚‚€€‚‚‚€€‚‚‚€€‚‚‚‚€€‚€‚‚‚‚‚ÿEnumModuleschar *EnumModules();ParametersNone. Return ValueA pointer to a NULL terminated string that contains the module name. Any number of module names may be followed in succession. RemarksModule names may contain spaces.Total module names should be less than 1024 characters long.C Example:const char *szModuleInfo = "Module 1~Module Number Two~";char *EnumModules(){ return szModuleInfo;3ëv ¬ H ^€×€€‚‚€‚‚‚€‚€‚‚€€‚€‚‚‚‚‚‚€‚ÿ}would return the necessary information for two modules: Module 1Module Number TwoDelphi 2 Example:function EnumModules: pChar; export; cdecl;function EnumModules: pChar;begin Result := 'My Module' + '~' ;end;: y æ 1x ¾ÿÿÿÿæ lGRunModule3 ¬ & €€€€‚ÿRunModule Õæ E@K d€«€€‚€€‚‚‚€€‚‚‚‚‚‚€€‚‚‚‚€€‚‚ÿRunModuleint RunModule(char *szModuleName, HWND hwndWebEdit);ParametersszModuleNamePointer to a NULL-terminated string containing the name of the module to be run.hwndWebEditHandle to WebEditReturn Value1 -- The module was successfully executed0 -- The call to the module failedRemarksThe RunModule routine must parse the string passed to it by WebEdit and call an appropriate module. EacE@¬ h ModuleName passed should be less than 255 characters.¿KBG \€€€‚€€‚€‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚€‚ÿC Example:void RunModule(char *szModuleName, HWND hwndWebEdit);{ if(strcmp("Module 1", szModuleName)) Module1(hwndWebEdit); else if(strcmp("Module Number Two", szModuleName)) Module2(hwndWebEdit); else return FALSE; // If no match, then we've failed return TRUE; // Return success}void Module1(HWND hwndRTControl){ ...}void Module2(HWND hwndRTControl){ ...}ÍE@_DG \€›€€‚€€‚‚€‚‚‚‚‚‚‚‚‚‚‚‚€‚‚€€‚ÿDelphi 2 Example:function RunModule(szWizard: pChar; WebEditHandle: THandle): integer; export; cdecl;{ This function launches the specified Wizard }function RunModule(szWizard: pChar; WebEditHandle: THandle): integer;begin if StrPas(szWizard) = 'MyModule' then begin frmModule := TfrmModule.Create(Nil); frmModule.hWebEdit := WebEditHandle; frmModule.ShowModal; frmModule.Free; end;end;Delphi 2 Example Unit:ÏKBcF5 8€Ÿ€€‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚ÿunit Loader;interfaceuses SysUtils, WinTypes, WinProcs, Messages, Classes, Forms, StdCtrls, ComCtrls, dialogs, Module;function EnumModules: pChar; export; cdecl;function RunModule(szWizard: pChar; WebEditHandle: THandle): integer; export; cdecl;implementationfunction EnumModules: pChar;begin Result := 'My Module' + '~' ;end;{ This function launches the specified Wizard }function RunModule(szWizard: pChar; WebEditHandle: THandle): integer; ×_DlG2 2€¯€€‚‚‚‚‚‚‚‚‚‚‚€‚ÿbegin if StrPas(szWizard) = 'MyModule' then begin frmModule := TfrmModule.Create(Nil); frmModule.hWebEdit := WebEditHandle; frmModule.ShowModal; frmModule.Free; end;end;end.: cF¦G1ðùÿÿÿÿ¦GÙG˜JAPI calls3 lGÙG& €€€€‚ÿAPI calls €¦GäI‹ 䀀€‚‚‚‚‚ã}œʼn‚‚ãÖKb¯‰‚ã“’ÚW‰‚ãŠi˜‰‚ãGÂF,‰‚ãାZ‰‚ãX•‰‚ãk÷)㉂ãÏ„T6‰‚ã4¤‰‚ãy~ƒ‰‚ã°;_‰‚ã<…b˜‰‚ãéŒýö‰‚ÿEach module can access WebEdit using the following calls.Each call is in the format: MessageName (hWnd, wParam, lParam). Call OffsetsGet Document NameGet Document BufferGet Current Project NameRun URL BuilderList Open DocumentsOpen DocumentSave DocumentSaveAsClose DocumentNext DocumentPrevious DocumentSelect DocumentUpdate Previewer´hÙG˜JL h€Ð€ãLÍs™€‰‚ãÍùQ—‰‚ãÀj±Ä‰‚ã<ïT‰‚ãCŒ†‰‚ãˆ.¦p‰‚ÿNew DocumentInsert TextGet TextIs Document ModifiedSize Of DocumentUpdate Status bar= äIÕJ1»ÿÿÿÿ6‹ÕJ K•NCall Offsets6˜J K& € €€€‚ÿCall Offsets ÆÕJME X€€€‚‚‚€‚ƒ‚ƒ‚ƒ‚ƒƒ‚ƒƒ‚ƒƒ‚ƒƒ‚ƒƒ‚ƒƒ‚ƒƒ‚ÿThese calls are based on an offset from WE_USER, which equals 1024.constwe_GetCurrentDocumentName = WM_User + 0; we_GetCurrentDocumentBuffer =WM_User + 1;we_GetCurrentProjectName = WM_User + 2; we_RunURLBuilder = WM_User + 3; we_ListOpenDocuments = WM_User + 4;we_OpenDocument = WM_User + 5; we_SaveDocument = WM_User + 6; we_CloseDocument = WM_User + 7; we_NextDocument = WM_User + 8; we_PreviousDocument = WM_User + 9;9 K•NF Z€s€€ƒƒ‚ƒƒ‚ƒƒƒ‚ƒƒƒ‚ƒƒƒ‚ƒ‚ƒƒƒ‚ƒƒƒ‚ƒƒ‚€‚ÿwe_SelectDocument = WM_User + 10;we_UpdatePreviewer = WM_User + 11; we_NewDocument = WM_User + 12;we_GetText = WM_User + 13;we_InsertText = WM_User + 14;we_IsDocumentModified = WM_User + 15; we_SizeOfText = WM_User + 16;we_SaveAs = WM_USER + 17;we_UpdateStatusBar =WM_USER + 17;BM×N1’'ˆß×NO„Get Document Name;•NO& €*€€€‚ÿGet Document Name²×N#S t€e€€‚€‚ƒƒ‚ƒƒƒ‚ƒƒ‚‚€€‚‚‚€€‚€€‚‚€€‚‚ÿWE_GETCURRENTDOCUMENTNAMEhwndWebEdit = (HWND) hWnd;// handle to WebEdit wParam = (HWND) hRtf;// handle to RTFlParam = (LPARAM) lpszText;// addO#•Nress of string bufferDescriptionReturns the name of the current document (0 passed in wParam) or selected document (hWnd passed in wParam). Use this name in other messages when a document name is needed. ParametershWndHandle to WebEdithRtfHandle to RTF control¸O)ƒN j€q€€€‚‚‚€€‚ƒ‚ƒ‚ƒ‚‚€€‚‚‚€€‚€‚‚‚‚ÿlpszTextPoints to buffer that will receive the document name. Return Value1Success0Failure (no open document) -1Failure (selected document not found).NotesDocument name passed by lParam will contain 255 chars max. If the selected document is not found than an empty string will be returned.Delphi Exampleprocedure TfrmTester.btnCurrentDocumentNameClick(Sender: TObject);var ilReturn: LongInt; szlParam: pchar;V'#„/ ,€O€€‚‚‚‚‚‚‚‚€‚ÿbegin GetMem(szlParam, 256); StrPCopy(szlParam, txtlParam_Send.Text); ilReturn := SendMessage(hWebEditHandle, we_GetCurrentDocumentName, 0, Longint(szlParam)); txtResult_Receive.Text := inttostr(ilReturn); txtlParam_Receive.Text := StrPas(szlParam); FreeMem(szlParam, 256);end;D)ƒÃ„1Ê6‹Ì Ä…™‰Get Document Buffer=„…& €.€€€‚ÿGet Document BufferÅćV z€‹€€‚€‚ƒƒ‚ƒƒƒƒ‚€‚‚‚€€‚‚‚€€‚€€‚‚€€‚‚ÿWE_GETCURRENTDOCUMENTBUFFERhwndWebEdit = (HWND) hWnd;// handle to WebEdit wParam = 0;// not used; must be zerolParam = (LPARAM) (LPCTSTR) lpsz;// address of string bufferDescriptionReturns the handle of the rich text control of the current document ('' passed in lParam) or selected document (document name passed in lParam).ParametershWndHandle to WebEditlpszPoints to buffer that contains the document name to select. ¾…‰D V€}€€‚€€‚ƒ‚ƒ‚ƒ‚‚€€‚€‚‚‚‚‚‚‚‚ÿReturn Value> 0 a pointer to the handle of the current document.0 no open document.-1no document matching the name passed in lParam could be found.Delphi Exampleprocedure TfrmTester.btnDocumentBufferClick(Sender: TObject);var ilReturn: LongInt; szlParam: pchar;begin GetMem(szlParam, 256); StrPCopy(szlParam, 'Document1'); ilReturn := SendMessage(hWebEditHandle, we_GetCurrentDocumentBuffer, 0, Longint(szlParam));|S‡™‰) "€¦€€‚‚‚€‚ÿ txtResult_Receive.Text := inttostr(ilReturn); FreeMem(szlParam, 256);end;I‰â‰1ß|  â‰$Š€ŽGet Current Project NameB™‰$Š& €8€€€‚ÿGet Current Project Name ®â‰1Œ_ Œ€]€€‚€‚ƒƒ‚ƒƒƒƒ‚ƒ‚‚€€‚‚‚€€‚€€‚‚€€‚‚‚€€‚ƒ‚ƒ‚ÿWE_GETCURRENTPROJECThwndWebEdit = (HWND) hWnd;// handle to WebEdit wParam = 0;// not used; must be zerolParam = (LPARAM) lpszText;// address of string bufferDescriptionReturns the full filename and path of the currently open project. ParametershWndhandle to WebEditlpszTextValue of lParam. Points to buffer that will contain the Project name. Return Value1Success0Failure (no open project) Ä$Š7ŽB R€‰€€‚€€‚‚‚€€‚€‚‚‚‚‚‚‚‚‚‚‚ÿNotesProject name passed by lParam will contain 255 chars max. Delphi Exampleprocedure TfrmTester.btnProjectNameClick(Sender: TObject);var ilReturn: LongInt; szlParam: pchar;begin GetMem(szlParam, 256); StrPCopy(szlParam, txtlParam_Send.Text); ilReturn := SendMessage(hWebEditHandle, we_GetCurrentProjectName, 0, Longint(szlParam)); txtResult_Receive.Text := inttostr(ilReturn); txtlParam_Receive.Text := StrPas(szlParam);I"1Œ€Ž' €D€€‚€‚ÿ FreeMem(szlParam, 256);end;@7ŽÀŽ1çÌ‚ ÀŽùŽ»ÃRun URL Builder9€ŽùŽ& €&€€€‚ÿRun URL Builder>èÀŽCÁV z€Ñ€€‚€‚ƒƒ‚ƒƒƒƒ‚ƒ€‚‚€€‚‚‚€€‚€€‚‚€€‚‚ÿWE_RUNURLBUILDERhwndWebEdit = (HWND) hWnd;// handle to WebEdit wParam = 0;// not used; must be zerolParam = (LPARAM) lpszFilename;// address of string bufferDesùŽCÁ€ŽcriptionRuns the URL Builder dialog inside WebEdit and returns a full URL. The main benefit of this is that the URL will be in the pathing format used by WebEdit. ParametershWndhandle to WebEditlpszFilenameValue of lParam. Points to buffer that will hold the filename returned from URL builder. -àùŽpÃM h€Á€€‚€€‚ƒ‚ƒ‚‚€€‚‚‚€€‚€‚‚‚‚‚‚‚‚‚‚ÿReturn Value1Success-1User hit cancel NotesURL passed by lParam will contain 1024 chars max. Delphi Exampleprocedure TfrmTester.btnUrlBuilderClick(Sender: TObject);var ilReturn: LongInt; szlParam: pchar;begin GetMem(szlParam, 256); StrPCopy(szlParam, txtlParam_Send.Text); ilReturn := SendMessage(hWebEditHandle, we_RunURLBuilder, 0, Longint(szlParam)); txtResult_Receive.Text := inttostr(ilReturn); txtlParam_Receive.Text := StrPas(szlParam);K#CÁ»Ã( €F€€‚‚€‚ÿ FreeMem(szlParam, 256);end;DpÃÿÃ1¥| ‡ ÿÃ<İÊList Open Documents=»Ã<Ä& €.€€€‚ÿList Open DocumentsÇÿÃVÆS t€€€‚€‚ƒƒ‚ƒƒƒ‚ƒƒ‚‚€€‚‚‚€€‚€€‚‚€€‚‚ÿWE_LISTOPENDOCUMENTShwndWebEdit = (HWND) hWnd;// handle to WebEdit wOpenDocs = wParam;// flag for string filllParam = (LPARAM) lpszDocs;// address of string bufferDescriptionReturns a list of all open documents starting from the left. ParametershWndhandle to WebEditwParamif a 1 is passed to the function then only the number of open documents will be passed back - the buffer lParam points to will NOT be filled with text.Þ<ÄpÈ< F€½€€€‚‚‚€€‚‚‚€€‚‚‚‚ÿlpszDocsValue of lParam. Points to buffer that will contain hold a comma delimited list of Document names. Return ValueThe number of open documents.NotesThe document name used by WebEdit is the complete path and filename of the document.Set wParam to 1 to get only the number of open documents.Each document name passed by lParam will contain 255 chars max. Multiply this by the number of open documents to get the size of the buffer to hold the document list. ÖVÆ‚Ê< F€­€€‚€€‚€‚‚‚‚‚‚‚‚‚‚‚‚‚‚ÿDelphi Exampleprocedure TfrmTester.btnListOpenDocumentsClick(Sender: TObject);var ilBufSize: LongInt; ilNumDocuments: integer; szlParam: pchar; sDocNames: string;begin iNumDocuments := SendMessage(hWebEditHandle, we_ListOpenDocuments, 1, 0); ilBufSize := iNumDocuments * 256; GetMem(szlParam, ilBufSize); SendMessage(hWebEditHandle, we_ListOpenDocuments, 0, Longint(szlParam)); sDocNames := StrPas(szlParam); FreeMem(szlParam, ilBufSize);.pȰÊ& €€€€‚ÿend;> ‚ÊîÊ1]‚‹ îÊ%ËQÏOpen Document7°Ê%Ë& €"€€€‚ÿOpen DocumentŸîÊ(Íd –€?€€‚€‚ƒƒ‚ƒƒƒƒƒ‚ƒ€‚‚€€‚‚‚€€‚€€‚‚€€‚‚‚€€‚ƒ‚ƒ‚‚ÿWE_OPENDOCUMENThwndWebEdit = (HWND) hWnd;// handle to WebEdit wParam = 0;// not used; must be zerolParam = (LPARAM) (LPCTSTR) lpsz;// address of string bufferDescriptionOpens the selected file in WebEdit. ParametershWndhandle to WebEditlpszValue of lParam. Points to null-terminated string that contains the filename of the document to open. Return Value1Success0Failure Ä%Ë+Ï? L€‰€€€‚‚‚€€‚€‚‚‚‚‚‚‚‚‚‚‚‚ÿNotesThe filename should be 255 chars max. Delphi Exampleprocedure TfrmTester.btnOpenDocumentClick(Sender: TObject);var ilReturn: LongInt; szlParam: pchar;begin GetMem(szlParam, 256); StrPCopy(szlParam, txtlParam_Send.Text); ilReturn := SendMessage(hWebEditHandle, we_OpenDocument, 0, Longint(szlParam)); txtResult_Receive.Text := inttostr(ilReturn); txtlParam_Receive.Text := StrPas(szlParam); FreeMem(szlParam, 256);end;&(ÍQÏ# €€€‚ÿ> +ÏÏ1ò‡ÂÏÆÏíSave Document7QÏÆÏ& €"€€€‚ÿSave Document®Ïâb ’€]€€‚€‚ƒƒ‚ƒƒƒƒƒ‚ƒƒƒ€‚ƒ‚€ÆÏâQÏ€‚‚‚€€‚€€‚‚€€‚‚‚€€‚ÿWE_SAVEDOCUMENThwndWebEdit = (HWND) hWnd;// handle to WebEdit wParam = 0;// not used; must be zerolParam = (HWND) hRtf;// handle to RTFDescriptionSaves the current document ( lParam = 0) or selected document (lParam = document's RTF handle) using the existing name, or brings up the Save As dialog if no filename exists. ParametershWndHandle to WebEdithRtfHandle to RTF controlReturn Value ÂÆÏíI `€…€€ƒ‚ƒ‚ƒ‚ƒ‚‚€€‚‚‚€€‚€‚‚‚‚‚‚€‚ÿ1Success0Failure (No pages open)-1Page was not saved (user aborted the save) -2Selected page was not foundNotesIf a document handle was passed and the document could not be found then no saving will occur.Delphi Exampleprocedure TfrmTester.btnSaveDocumentClick(Sender: TObject);var ilReturn: LongInt;begin ilReturn := SendMessage(hWebEditHandle, we_SaveDocument, 0, 0); txtResult_Receive.Text := inttostr(ilReturn);end;7â$1V‹O$TySaveAs0 íT& €€€€‚ÿSaveAs4Ò$ˆb ’€¥€€‚€‚ƒƒ‚ƒƒƒƒƒ‚ƒ€‚ƒ‚€€‚‚‚€€‚€€‚‚€€‚‚‚€€‚ƒ‚ÿWE_SAVEAShwndWebEdit = (HWND) hWnd;// handle to WebEdit wParam = 0;// not used; must be zerolParam = (LPARAM) (LPCTSTR) lpsz;// address of string bufferDescriptionSaves the current document under the passed in filename.ParametershWndHandle to WebEditlpszValue of lParam. Points to null-terminated string that contains the filename to save the document under. Return Value> 0 a pointer to the handle of the current document.ñ±Ty@ N€c€€ƒ‚‚€€‚€‚‚‚‚‚‚‚‚‚‚‚‚€‚ÿ-1the file could not be saved.Delphi Exampleprocedure TfrmTester.btnSaveDocumentClick(Sender: TObject);var ilReturn: LongInt; szlParam: pchar;begin GetMem(szlParam, 256); StrPCopy(szlParam, 'NewFilename.html'); ilReturn := SendMessage(hWebEditHandle, we_SaveAs, 0, Longint(szlParam)); txtResult_Receive.Text := inttostr(ilReturn); txtlParam_Receive.Text := StrPas(szlParam); FreeMem(szlParam, 256);end;?ˆ¸1“Â%¸ðR Close Document8yð& €$€€€‚ÿClose Documentº¸ d –€u€€‚€‚ƒƒ‚ƒƒƒƒƒ‚ƒƒƒ‚€‚€‚‚‚€€‚€€‚‚€€‚‚‚€€‚ƒ‚ƒ‚ƒ‚ÿWE_CLOSEDOCUMENThwndWebEdit = (HWND) hWnd;// handle to WebEdit wParam = 0;// not used; must be zerolParam = (HWND) hRtf;// handle to RTFDescriptionCloses the current document (lParam = 0) or the selected document (lParam = document handle). ParametershWndhandle to WebEdithRtfHandle to RTF controlReturn Value1Success0Failure (no pages open to close)-1Page was not closed (user aborted the close) D ðR : B€€€ƒ‚€‚€‚€‚‚‚‚‚‚€‚ÿ-2Selected page was not found.Delphi Exampleprocedure TfrmTester.btnCloseDocumentClick(Sender: TObject);var ilReturn: LongInt;begin ilReturn := SendMessage(hWebEditHandle, we_CloseDocument, 0, 0); txtResult_Receive.Text := inttostr(ilReturn);end;>   1>O€ Ç  @Next Document7R Ç & €"€€€‚ÿNext Document ¤ Òg œ€I€€‚€‚ƒƒ‚ƒƒƒƒƒ‚ƒƒƒƒƒ€‚‚€€‚‚‚€€‚€€‚‚‚€€‚ƒ‚ƒ‚‚€€‚ÿWE_NEXTDOCUMENThwndWebEdit = (HWND) hWnd;// handle to WebEdit wParam = 0;// not used; must be zerolParam = 0;// not used; must be zeroDescriptionMakes the next document the current document. The document list will wrap back to the beginning when the end is reached. ParametershWndhandle to WebEditReturn Value1Success0Failure (less than 2 documents were open) Delphi ExampleÕÇ  @- (€«€€‚‚‚‚‚‚€‚ÿprocedure TfrmTester.btnNextDocumentClick(Sender: TObject);var ilReturn: LongInt;begin ilReturn := SendMessage(hWebEditHandle, we_NextDocument, 0, 0); txtResult_Receive.Text := inttostr(ilReturn);end;Ò @R BÒN@1N%ž‚N@‰@¦CPrevious Document; @‰@& €*€€€‚ÿPrevious Document¬N@œBg œ€Y€€‚€‚ƒƒ‚ƒƒƒƒƒ‚ƒƒƒƒƒ€‚‚€€‚‚‚€€‚€€‚‚‚€€‚ƒ‚ƒ‚‚€€‚ÿWE_PREVIOUSDOCUMENThwndWebEdit = (HWND) hWnd;// handle to WebEdit wParam = 0;// not used; must be zerolParam = 0;// not used; must be zeroDescriptionMakes the previous document the current document. The document list will wrap back to the end when the beginning is reached. ParametershWndhandle to WebEditReturn Value1Success0Failure (less than 2 documents were open) Delphi Example ݉@¦C- (€»€€‚‚‚‚‚‚€‚ÿprocedure TfrmTester.btnPreviousDocumentClick(Sender: TObject);var ilReturn: LongInt;begin ilReturn := SendMessage(hWebEditHandle, we_PreviousDocument, 0, 0); txtResult_Receive.Text := inttostr(ilReturn);end;@œBæC1 €Q†æCDŽHSelect Document9¦CD& €&€€€‚ÿSelect Document¸æC;Fd –€q€€‚€‚ƒƒ‚ƒƒƒƒƒ‚ƒƒ‚€‚€€‚‚‚€€‚€€‚‚€€‚‚‚€€‚ƒ‚ƒ‚ÿWE_SELECTDOCUMENThwndWebEdit = (HWND) hWnd;// handle to WebEdit wParam = 0;// not used; must be zerolParam = (LPARAM) lpszDoc;// address of string bufferDescriptionMakes the named document the current document. ParametershWndhandle to WebEditlpszDocValue of lParam. Points to null-terminated string that contains the name of the document to select. Return Value1Success0Failure (no open documents) ÆDEHD V€€€ƒ‚‚€€‚‚‚€€‚€‚‚‚‚‚‚‚‚‚‚‚ÿ-1No matching page NotesThe document name should be 255 chars max. Delphi Exampleprocedure TfrmTester.btnSelectDocumentClick(Sender: TObject);var ilReturn: LongInt; szlParam: pchar;begin GetMem(szlParam, 256); StrPCopy(szlParam, txtlParam_Send.Text); ilReturn := SendMessage(hWebEditHandle, we_SelectDocument, 0, Longint(szlParam)); txtResult_Receive.Text := inttostr(ilReturn); txtlParam_Receive.Text := StrPas(szlParam);I";FŽH' €D€€‚€‚ÿ FreeMem(szlParam, 256);end;AEHÏH1Jž‚܉ÏH I"MUpdate Previewer:ŽH I& €(€€€‚ÿUpdate Previewer¾ÏH'K` Ž€}€€‚‚ƒƒ‚‚ƒƒƒƒ‚€‚€€‚‚‚€€‚€€‚‚€€‚‚‚‚‚€€‚ƒ‚ƒ‚ÿWE_UPDATEPREVIEWERhwndWebEdit = (HWND) hWnd;// handle to WebEdit wParam = (WPARAM) wPreviewerMode;// Previewer ModelParam = 0;// not used; must be zeroDescriptionUpdates the previewer. Same as hitting the F5 key. ParametershWndhandle to WebEditwPrieviewerMode0: Do not change the status of the previewer1: open previewer if closed2: close previewer if open.Return Value1Success0Failure (no open documents)û¹ I"MB R€s€€ƒ‚ƒ‚ƒ‚‚€€‚€‚‚‚‚‚‚‚‚‚‚€‚ÿ-1Previewer not visible.-2Previewer was already opened -3Previewer was already closed Delphi Exampleprocedure TfrmTester.btnUpdatePreviewerClick(Sender: TObject);var ilReturn: LongInt; wParam: word;begin wParam := strtoint(txtwParam_Send.Text); ilReturn := SendMessage(hWebEditHandle, we_UpdatePreviewer, wParam, 0); txtResult_Receive.Text := inttostr(ilReturn); txtwParam_Receive.Text := inttostr(wParam);end;= 'K_M1¹Q†_M•M)€New Document6"M•M& € €€€‚ÿNew Document«_M§Og œ€W€€‚€‚ƒ‚ƒƒƒƒ‚ƒƒƒƒ‚€‚€€‚‚‚€€‚€€‚‚‚€€‚‚‚€€‚€‚‚‚ÿWE_NEWDOCUMENThwndWebEdit = (HWND) hWnd;// handle to WebEdit wParam = 0;// not used; must be zerowParam = 0;// not used; must be zeroDescriptionCreates a new document. Same as hitting the 'New' button. ParametershWndhandle to WebEditReturn ValuePasses back the handle to the new document.Delphi Exampleprocedure TfrmTester.btnNewDocumentClick(Sender: TObject);var ilReturn: LongInt;vO•M)€' €ž€€‚€‚ÿbegin ilReturn := SendMessage(hWebEditHandle, w§O)€"Me_NewDocument, 0, 0); end;< §Oe€1:܉Be€š€£…Insert Text5)€š€& €€€€‚ÿInsert Textže€‚e ˜€=€€‚€‚ƒƒ‚ƒƒƒ‚ƒ‚€‚€€‚‚‚€€‚€€‚‚€‚€‚€€‚‚‚€€‚ÿWE_INSERTTEXThwndWebEdit = (HWND) hWnd;// handle to WebEdit wParam = wBufSize;// size of string bufferlParam = (LPARAM) (LPCTSTR) lpsz;// address of string bufferDescriptionInserts text into the current document at the cursor position. ParametershWndhandle to WebEditwBufSizeLength of buffer.lpszValue of lParam. lpsz to buffer that contains the text to insert. Return Value+暀ȄE X€Í€€ƒ‚ƒ‚‚€€‚‚‚€€‚€‚‚‚‚‚‚‚‚‚‚ÿ1Success0Failure (No documents open)NotesIf no buffersize is given (wParam) the call will return 0 and no insertion of text will occur. Delphi Exampleprocedure TfrmTester.btnInsertTextClick(Sender: TObject);var ilReturn: LongInt; szlParam: pchar; wParam: word;begin GetMem(szlParam, 256); StrPCopy(szlParam, txtlParam_Send.Text); wParam := strtoint(txtwParam_Send.Text); ilReturn := SendMessage(hWebEditHandle, we_InsertText, wParam, Longint(szlParam));Û¯‚£…, &€_€€‚‚‚‚‚€‚ÿ txtResult_Receive.Text := inttostr(ilReturn); txtlParam_Receive.Text := StrPas(szlParam); txtwParam_Receive.Text := inttostr(wParam); FreeMem(szlParam, 256);end;9Ȅ܅1¬fÜ…†‰ˆGet Text2 £…†& €€€€‚ÿGet TextÔÜ…ˆ; D€©€€‚‚‚€€‚€‚‚‚‚‚‚‚‚‚‚‚ÿTo get text simply use the Windows EM_GETTEXT message.Delphi Exampleprocedure TfrmTester.btnGetTextClick(Sender: TObject);var hDocument: Handle; iSizeofText: integer; szTextIn: pchar; sInput: string;begin hDocument := THandle(SendMessage(hWebEdit, WE_GetCurrentDocumentBuffer, 0, 0)); iSizeOfText := SendMessage(hDocument, EM_GetTextLength, 1, 0); GetMem(szTextIn, iSizeOfText + 1); SendMessage(hDocument, EM_GetText, 1, Longint(szTextIn));lD†‰ˆ( €ˆ€€‚‚€‚ÿ sInput := szTextIn; FreeMem(szTextIn, iSizeOfText + 1);end;EˆΈ1ŒB8 Έ ‰gŒIs Document Modified>‰ˆ ‰& €0€€€‚ÿIs Document Modified§Έ‹g œ€O€€‚€‚ƒƒ‚ƒƒƒƒƒ‚ƒƒƒ‚€‚€€‚‚‚€€‚€€‚‚€€‚‚‚€€‚ƒ‚ƒ‚ƒ‚ÿWE_ISDOCUMENTMODIFIEDhwndWebEdit = (HWND) hWnd;// handle to WebEdit wParam = 0;// not used; must be zerolParam = (HWND) hRtf;// handle to RTFDescriptionReturns the Modified status of the current document (lParam = 0) or the selected document (lParam = document handle). ParametershWndhandle to WebEdithRtfHandle to RTF controlReturn Value1True0False-1Failure (no document open)M ‰gŒ: B€'€€ƒ‚‚€€‚€‚‚‚‚‚‚€‚ÿ-2Failure (selected document not found)Delphi Exampleprocedure TfrmTester.btnModifiedClick(Sender: TObject);var ilReturn: LongInt;begin ilReturn := SendMessage(hWebEditHandle, we_IsDocumentModified, 0, 0); txtResult_Receive.Text := inttostr(ilReturn);end;A‹¨Œ1¿f€¨ŒâŒrÀSize Of Document:gŒâŒ& €(€€€‚ÿSize Of Document%ĨŒa €‰€€‚€‚ƒƒ‚ƒƒƒƒƒ‚ƒƒƒ‚‚€€‚‚‚€€‚€€‚‚€€‚‚‚€‚€‚ƒ‚ÿWE_SIZEOFTEXThwndWebEdit = (HWND) hWnd;// handle to WebEdit wParam = 0;// not used; must be zerolParam = (HWND) hRtf;// handle to RTFDescriptionReturns the size of the current document (lParam = 0) or the selected document (lParam = document handle). .ParametershWndhandle to WebEdithRtfHandle to RTF controlReturn Value>=0Size in bytes of the current document's text including the terminating null character. _#âŒrÀ< F€G€€ƒ‚ƒ‚‚€€‚€‚‚‚‚‚‚€‚ÿ-1Failure (no pages open)-2Selected page was not found.Delphi Exampleprocedure TfrmTester.btnSizeOfDocumentClick(Sender: TObject);var ilReturn: LongInt;begin ilReturn := SenrÀgŒdMessage(hWebEditHandle, we_SizeOfText, 0, 0); txtResult_Receive.Text := inttostr(ilReturn);end;B´À1Ò8 ÿÿÿÿ´ÀïÀÃUpdate Status bar;rÀïÀ& €*€€€‚ÿUpdate Status bar1Ì´À Ãe ˜€™€€‚€‚ƒƒ‚ƒƒƒƒƒ‚ƒƒƒƒƒ‚‚€€‚‚‚€€‚€€‚‚€‚€‚‚‚€€‚€‚ÿWE_UPDATESTATUSBARhwndWebEdit = (HWND) hWnd;// handle to WebEdit wParam = 0;// not used; must be zerolParam = 0;// not used; must be zeroDescriptionUpdates WebEdit to reflect any changes made in the Document. This should automatically happen but it never hurts to be able to explicitly do this.ParametershWndhandle to WebEditReturn ValueNoneDelphi Exampleprocedure TfrmTester.btnSizeOfDocumentClick(Sender: TObject);pGïÀÃ) "€Ž€€‚‚‚€‚ÿbegin SendMessage(hWebEditHandle, we_UpdateStatusbar, 0, 0);end;1 ÃÁÃ1UÿÿÿÿÿÿÿÿÿÿÿÿÁÃåÃ$ÃåÃ" €€€ÿ1ÁÃÿÿÿÿ1ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ - ¨MS Sans SerifSystemTerminalFixedsysRomanScriptModernHM PhoneticCourierMS SerifSmall FontsMarlettCourier NewLucida ConsoleLucida Sans UnicodeTimes New RomanWingdingsMS Reference 1MS Reference 2Arial BlackArial Rounded MT BoldBook AntiquaBookman Old StyleCentury GothicCentury SchoolbookHaettenschweilerAlgerianBraggadocioBritannic BoldBrush Script MTColonna MTDesdemonaFootlight MT LightGaramondImpactKino MTWide LatinMatura MT Script CapitalsPlaybillMS LineDrawBookshelf Symbol 1Bookshelf Symbol 2Bookshelf Symbol 3SymbolArial$€$$€ , Á¸2†'ˆOB¾Ìß6‹BÈf‚܉%‡€ù| c ‹Âž‚8 Q†€O6‹ßf‚܉%‡€| ‹ž‚8 Q†€Ìî,/ & ;)F24ÿÿ.,ÿÿAPI callsCall OffsetsClose DocumentEM_GETTEXT EnumModulesGet Current Project NameGet Document BufferGet Document NameGet Text How does WebEdit use modules?$Insert Text(Is Document Modified,List Open Documents0New Document4Next Document8Open Document<Previous Document@Required FunctionsDRun URL BuilderHRunModuleLSave DocumentPSaveAsTSelect DocumentXSize Of Document\Update Previewer`Update Status bardWE_CLOSEDOCUMENThWE_GETCURRENTDOCUMENTlWE_GETCURRENTDOCUMENTBUFFERpWE_INSERTTEXTtWE_ISDOCUMENTMODIFIEDxWE_LISTOPENDOCUMENTS|WE_NEWDOCUMENT€WE_NEXTDOCUMENT„WE_OPENDOCUMENTˆWE_PREVIOUSDOCUMENTŒWE_RUNURLBUILDERWE_SAVEAS”WE_SAVEDOCUMENT˜WE_SELECTDOCUMENTœWE_SIZEOFTEXT WE_UPDATEPREVIEWER¤WE_UPDATESTATUSBAR¨WebEdit Module API Specification 3.0¬¾ÿÿWEGETCURRENTPROJECT°What is a WebEdit module?´_GETTEXT EnumModulesGet Current Project NameGet Document BufferGet Document NameGet Text How does WebEdit use modules?$Insert Text(Is Document Modified,List Open Documents0New Document4Next Document8Open Document<Previous Document@Required FunctionsDRun URL BuilderHRunModuleLSave DocumentPSaveAsTSelect DocumentXSize Of Document\Update Previewer`Update Status bardWE_CLOSEDOCUMENThWE_GETCURRENTDOCUMENTlWE_GETCURRENTDOCUMENTBUFFERpWE_INSERTTEXTtWE_ISDOCUMENTMODIFIEDxWE_LISTOPENDOCUMENTS|WE_NEWDOCUMENT€WE_NEXTDOCUMENT„WE_OPENDOCUMENTˆWE_PREVIOUSDOCUMENTŒWE_RUNURLBUILDERWE_SAVEAS”WE_SAVEDOCUMENT˜WE_SELECTDOCUMENTœWE_SIZEOFTEXT WE_UPDATEPREVIEWER¤WE_UPDATESTATUSBAR¨WebEdit Module API Specification 3.0¬äWEGETCURRENTPROJECT/&;)LzÿÿµÿÿÿÿWebEdit Module API Specification 3.0îWhat is a WebEdit module?ÈHow does WebEdit use modules?ùRequired Functions¾EnumModulesc RunModule2†API calls'ˆCall Offsets6‹Get Document NameßGet Document BufferÌGet Current Project Name| Run URL Builder‚List Open Documents‡Open Document‹Save DocumentÂSaveAsOClose Document%Next Document€Previous Documentž‚Select DocumentQ†Update Previewer܉New DocumentInsert TextBGet TextfIs Document Modified8 Size Of Document€Update Status bar(‚*‚/&;)L4ÿÿ ÿÿÿÿy~ƒ%CŒ†8 X•‡ÍùQ—<…b˜ž‚Ši˜ÌLÍs™Ü‰~Ý£«ÈÖKb¯6‹<ïTÂfVuá¾Àj±ÄB}œÅ'ˆŠ¹Å2†¹—>Öùk÷)ã‹r ëéŒýöQ†4¤Oôˆ<%îGÂF,| Ï„T6“’ÚWßାZ‚°;_€ß,ýoc ˆ.¦p€