????? ????? ???? Wordbreak ???? ?? ????? ?????

?????? ????????? ?????? ?????????
???? ???????: 109551 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

??????

????? ??? ??????? ??????? EM_SETWORDBREAKPROC ??? ???? ???? ????? ???????? ?????? wordwrap ?????????? ???? ????? ?? ??? ??????? wordwrap. ????? ?????? wordwrap ?????????? ?? ?? ???? ???? ????? ????? ?????? (MLE) ?? ?????. ??? ????? ??? ??????? ?????? ??? ??????? (??? ??? ?? ??? ?????? ??? ?????) ? ?? ??? ?? ???? ??????? ?????? wordwrap (wordbreak) ?????? ??.

??????? ????

???? ???? wordwrap ???? ?????? ???? ???? (????? ????? ??? ?? ???? ??????? ??? ?????) ????? ?? ?????? ?????? ???? ?? ????? ??? ????? ????? ??????. ??? ???? wordwrap ??? ?????? ?? ????? ????? ?????? ??? ???? ?????.

????? ???? wordwrap ?????? ???? ????? Windows ??? ??? ??? ?? ???? ?????? ???? ??????? ????? ?????? ????? ??? ????? ???? ??? ??????. ???? ????? ??? ???? ???? ?? ???? ????? ?? MLE ???????? ?? ?? ???. ?????? ??? ???? ?? ????????? ??? ????? EM_SETWORDBREAKPROC ?????? ?????? ??? Platform SDK.

????? ?? ????? ????????? ???????? ???? ???? ????? ??? ??? ?? ???? ???? ????? ????? ?????? ?? "~" () ??????? (??? ???? ??????) ????? ?? ????? ??????? ("") ???.

????? ???????? ???????? ????? ?? ???? ???? ??????? ???? ???? ????? ????? ?????? ??? ???? ???? ????? ?? ???? ????.

??? ?????

   //Prototype the application-defined wordbreakproc.
   int CALLBACK WordBreakProc(LPSTR, int, int, int) ;

   //Install wordbreakproc in the WM_INITDIALOG case.
     case WM_INITDIALOG:

/* 
   For 16 bit applications use the following line to setup your
   CALLBACK function.

       lpWrdBrkProc = MakeProcInstance(WordBreakProc, hInst);

It is not neccessary to use MakeProcInstance in 32-bit applications.
*/ 


       //Send the EM_SETWORDBREAKPROC message to the edit control
       //to install the new wordbreak procedure.
        SendDlgItemMessage(hDlg, ID_EDIT, EM_SETWORDBREAKPROC, 0,
                           (LPARAM)(EDITWORDBREAKPROC)lpWrdBrkProc) ;
        return (TRUE);

   int FAR PASCAL WordBreakProc(LPSTR lpszEditText, int ichCurrent,
                                int cchEditText, int wActionCode)
   {

      char FAR *lpCurrentChar;
      int  nIndex;
      int  nLastAction;

      switch (wActionCode) {

        case WB_ISDELIMITER:

        // Windows sends this code so that the wordbreak function can
        // check to see if the current character is the delimiter.
        // If so, return TRUE. This will cause a line break at the ~
        // character.

         if ( lpszEditText[ichCurrent] == '~' )
            return TRUE;
         else
            return FALSE;

         break;

        // Because we have replaced the default wordbreak procedure, our
        // wordbreak procedure must provide the other standard features in
        // edit controls.

       case WB_LEFT:

        // Windows sends this code when the user enters CTRL+LEFT ARROW.
        // The wordbreak function should scan the text buffer for the
        // beginning of the word from the current position and move the
        // caret to the beginning of the word.

            {
               BOOL bCharFound = FALSE;

               lpCurrentChar = lpszEditText + ichCurrent;
               nIndex = ichCurrent;

               while (nIndex > 0  &&
                     (*(lpCurrentChar-1) != '~' &&
                      *(lpCurrentChar-1) != 0x0A) ||
                     !bCharFound )

              {
                  lpCurrentChar = AnsiPrev(lpszEditText ,lpCurrentChar);
                  nIndex--;

                  if (*(lpCurrentChar) != '~' &&  *(lpCurrentChar) != 0x0A)

                     // We have found the last char in the word. Continue
                     // looking backwards till we find the first char of
                     // the word.
                    {
                      bCharFound = TRUE;

                      // We will consider a CR the start of a word.
                      if (*(lpCurrentChar) == 0x0D)
                          break;
                    }

               }
               return nIndex;

            }
         break;


        case WB_RIGHT:

        //Windows sends this code when the user enters CTRL+RIGHT ARROW.
        //The wordbreak function should scan the text buffer for the
        //beginning of the word from the current position and move the
        //caret to the end of the word.

         for (lpCurrentChar = lpszEditText+ichCurrent, nIndex = ichCurrent;
              nIndex < cchEditText;
              nIndex++, lpCurrentChar=AnsiNext(lpCurrentChar))

          if ( *lpCurrentChar == '~' ) {
         lpCurrentChar=AnsiNext(lpCurrentChar);
            nIndex++;

            while ( *lpCurrentChar == '~' ) {
              lpCurrentChar=AnsiNext(lpCurrentChar);
              nIndex++;
             }

            return nIndex;
          }

          return cchEditText;
          break;


    }
  }

				
????? ?????? wordwrap (wordbreak) ????? ???? ??????? ?? ??? .DEF ???????. ???? ????? ?????? ?????? ????? ???????? ??? ??????? ???????.

???????

???? ???????: 109551 - ????? ??? ??????: 05/????? ???????/1426 - ??????: 2.2
????? ???
  • Microsoft Platform Software Development Kit-January 2000 Edition
????? ??????: 
kbmt kbctrl kbeditctrl kbhowto KB109551 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????109551

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com