Winfbe Editor Richedit Afx (Part one)

User projects written in or related to FreeBASIC.
Post Reply
Löwenherz
Posts: 86
Joined: Aug 27, 2008 6:26
Location: Bad Sooden-Allendorf, Germany

Winfbe Editor Richedit Afx (Part one)

Post by Löwenherz »

Hello .. dont know where to place this example so I try to start Here

I want to build a simple rich Editor inclusive an utf-8 utf-16 Support (If thats in General possible) with Afx and Winfbe Editor. I am Not yet very familiar with all These Features and Made this First example.

First Problem to send Text by Button click into Richedit Box. I have included already an Open and save File Dialog.

Code example freebasic

Code: Select all

' richEdit example with openSave File dialog and rich edit text box
' work in progress, freebasic, winFBE, part one, frank bruebach, 16-06-24
#define UNICODE
#INCLUDE ONCE "Afx/CWindow.inc"
USING Afx
CONST IDC_RICHEDIT = 1001
CONST IDC_OFD = 1002
CONST IDC_SFD= 1003
CONST IDC_TXT= 1004 
DECLARE FUNCTION WinMain (BYVAL hInstance AS HINSTANCE, _
                          BYVAL hPrevInstance AS HINSTANCE, _
                          BYVAL szCmdLine AS ZSTRING PTR, _
                          BYVAL nCmdShow AS LONG) AS LONG
   END WinMain(GetModuleHandleW(NULL), NULL, COMMAND(), SW_NORMAL)
' // Forward declaration
DECLARE FUNCTION WndProc (BYVAL hwnd AS HWND, BYVAL uMsg AS UINT, BYVAL wParam AS WPARAM, BYVAL lParam AS LPARAM) AS LRESULT
' ========================================================================================
' Main
' ========================================================================================
FUNCTION WinMain (BYVAL hInstance AS HINSTANCE, _
                  BYVAL hPrevInstance AS HINSTANCE, _
                  BYVAL szCmdLine AS ZSTRING PTR, _
                  BYVAL nCmdShow AS LONG) AS LONG
   ' // Set process DPI aware
   AfxSetProcessDPIAware
   DIM pWindow AS CWindow
   pWindow.Create(NULL, "CWindow with a Rich Edit control", @WndProc)
   pWindow.SetClientSize(600, 420)
   pWindow.Center
   ' // Add a rich edit control without coordinates (it will be resized in WM_SIZE)
   DIM hRichEdit AS HWND = pWindow.AddControl("RichEdit", , IDC_RICHEDIT, "RichEdit box")
   SetFocus hRichEdit
   Edit_SetSel(hRichEdit, 0, -1)

   ' // Add a button without coordinates (it will be resized in WM_SIZE)
   pWindow.AddControl("Button", , IDCANCEL, "&Close", 0, 0, 75, 23)
   pWindow.AddControl("Button", , IDC_OFD, "&Open File", 350, 350, 110, 23)
   pWindow.AddControl("Button", , IDC_SFD, "&Save File", 200, 350, 110, 23)
   pWindow.AddControl("Button", , IDC_TXT, "&Texter", 100, 350, 110, 23)
   ' // Dispatch Windows messages
   FUNCTION = pWindow.DoEvents(nCmdShow)
END FUNCTION
' ========================================================================================
FUNCTION WndProc (BYVAL hwnd AS HWND, BYVAL uMsg AS UINT, BYVAL wParam AS WPARAM, BYVAL lParam AS LPARAM) AS LRESULT
   SELECT CASE uMsg
      CASE WM_COMMAND
         SELECT CASE GET_WM_COMMAND_ID(wParam, lParam)
            ' // If ESC key pressed, close the application sending an WM_CLOSE message
            CASE IDCANCEL
               IF GET_WM_COMMAND_CMD(wParam, lParam) = BN_CLICKED THEN
                  SendMessageW hwnd, WM_CLOSE, 0, 0
                  EXIT FUNCTION
               END IF
               ' // Display the Open File Dialog
            CASE IDC_OFD
               IF GET_WM_COMMAND_CMD(wParam, lParam) = BN_CLICKED THEN
                  DIM wszFile AS WSTRING * 260 = "*.*"
                  DIM wszInitialDir AS STRING * 260 = CURDIR
                  DIM wszFilter AS WSTRING * 260 = "BAS files (*.BAS)|*.BAS|" & "All Files (*.*)|*.*|"
                  DIM dwFlags AS DWORD = OFN_EXPLORER OR OFN_FILEMUSTEXIST OR OFN_HIDEREADONLY OR OFN_ALLOWMULTISELECT
                  DIM cws AS CWSTR = AfxOpenFileDialog(hwnd, "", wszFile, wszInitialDir, wszFilter, "BAS", @dwFlags, NULL)
                  IF LEN(cws) THEN
                     DIM nItems AS LONG = AfxStrParseCount(cws)
                     IF nItems THEN
                        DIM cwsPath AS CWSTR = AfxStrParse(cws, 1)
                        MessageBoxW(hwnd, cwsPath, "Path", MB_OK)
                        FOR i AS LONG = 2 TO nItems
                           MessageBoxW(hwnd, AfxStrParse(cws, i), "File", MB_OK)
                        NEXT
                     END IF
                  END IF
                  EXIT FUNCTION
               END IF
               ' // Display the Save File Dialog
            CASE IDC_SFD
               IF GET_WM_COMMAND_CMD(wParam, lParam) = BN_CLICKED THEN
                  DIM wszFile AS WSTRING * 260 = "*.*"
                  DIM wszInitialDir AS WSTRING * 260 = CURDIR
                  DIM wszFilter AS WSTRING * 260 = "BAS files (*.BAS)|*.BAS|" & "All Files (*.*)|*.*|"
                  DIM dwFlags AS DWORD = OFN_EXPLORER OR OFN_FILEMUSTEXIST OR OFN_HIDEREADONLY OR OFN_OVERWRITEPROMPT
                  DIM cws AS CWSTR = AfxSaveFileDialog(hwnd, "", wszFile, wszInitialDir, wszFilter, "BAS", @dwFlags)
                  IF LEN(cws) THEN MessageBoxW(hwnd, cws, "File", MB_OK)
                  EXIT FUNCTION
               END IF
            '---------------------------------------------------------- //
            ' how to send textmessage by buttonclick into richeditbox ?   
            CASE IDC_TXT
               dim txtBuffer as string = "Hello dear Marvel fans" : DIM hRichEdit AS HWND
               DIM cws AS CWSTR="Sending some text into RichEditBox" ' but how?
               IF GET_WM_COMMAND_CMD(wParam, lParam) = BN_CLICKED THEN
                  MessageBoxW(hwnd, cws, "TEXT", MB_OK)
                  Edit_SetSel(GetDlgItem(hWnd, IDC_RICHEDIT), 0, -1)
                  SetWindowText hwnd,"Message Here" ' sending message into titlebar for a test ok but not into richeditbox
                  '----------------------------------------------------------- // how ?
                  SendMessage( hRichEdit, WM_SETTEXT, IDC_RICHEDIT , strptr(txtbuffer) ) ' how sending text into richedit box?
                  '----------------------------------------------------------- // how ?
               end if
                  EXIT FUNCTION
         END SELECT
         '---------------------------------------------------------- //               
      CASE WM_SIZE
         ' // If the window isn't minimized, resize it
         IF wParam <> SIZE_MINIMIZED THEN
            ' // Resize the controls
            DIM pWindow AS CWindow PTR = AfxCWindowPtr(hwnd)
            IF pWindow THEN
               pWindow->MoveWindow GetDlgItem(hwnd, IDC_RICHEDIT), 100, 50, pWindow->ClientWidth - 200, pWindow->ClientHeight - 150, CTRUE
               pWindow->MoveWindow GetDlgItem(hwnd, IDCANCEL), pWindow->ClientWidth - 95, pWindow->ClientHeight - 35, 75, 23, CTRUE
               pWindow->MoveWindow GetDlgItem(hwnd, IDC_OFD), pWindow->ClientWidth - 195, pWindow->ClientHeight - 35, 75, 23, CTRUE
               pWindow->MoveWindow GetDlgItem(hwnd, IDC_SFD), pWindow->ClientWidth - 265, pWindow->ClientHeight - 35, 75, 23, CTRUE
            END IF
         END IF
    	CASE WM_DESTROY
         ' // End the application by sending an WM_QUIT message
         PostQuitMessage(0)
         EXIT FUNCTION
   END SELECT
   ' // Default processing of Windows messages
   FUNCTION = DefWindowProcW(hWnd, uMsg, wParam, lParam)
END FUNCTION
' ========================================================================================
Josep Roca
Posts: 574
Joined: Sep 27, 2016 18:20
Location: Valencia, Spain

Re: Winfbe Editor Richedit Afx (Part one)

Post by Josep Roca »

> SendMessage( hRichEdit, WM_SETTEXT, IDC_RICHEDIT , strptr(txtbuffer) ) ' how sending text into richedit box?

hRichEdit does not contain a valid handle. You are sending text to a null handle.

Code: Select all

hRichEdit = GetDlgItem(hWnd, IDC_RICHEDIT)   ' Get the handle of the Rich Edit control
SendMessage( hRichEdit, WM_SETTEXT, IDC_RICHEDIT , strptr(txtbuffer) )
Löwenherz
Posts: 86
Joined: Aug 27, 2008 6:26
Location: Bad Sooden-Allendorf, Germany

Re: Winfbe Editor Richedit Afx (Part one)

Post by Löwenherz »

Thank you Jose. Does work fine now.

How I can send Chinese characters to Richedit Box correctly? See my Code snippets.. the Chinese characters are displayed correct in winfbe Editor Made utf8-8 bom active

Code: Select all

CASE IDC_TXT
               'dim txtBuffer as string = " ??? these are chinese letters these are chinese letters " '' "Hello dear Marvel fans" 
               dim txtBuffer as cwstr = " 你好 Nǐ hǎo these are chinese letters these are chinese letters "
               'AfxMsg MID(cws,2)
               DIM hRichEdit AS HWND
               DIM cws AS CWSTR="Sending some text into RichEditBox" 
               IF GET_WM_COMMAND_CMD(wParam, lParam) = BN_CLICKED THEN
                  MessageBoxW(hwnd, cws, "TEXT", MB_OK)
                  Edit_SetSel(GetDlgItem(hWnd, IDC_RICHEDIT), 0, -1)
                  SetWindowText hwnd,"Message Here" ' sending message into titlebar for a test ok but not into richeditbox
                  hRichEdit=GetDLGItem(hwnd,IDC_RICHEDIT) 'get the handle of richedit control
               '>>>>'----------------------------------------------------------- // sending chines characters to richedit but not correctly
                  SendMessage( hRichEdit, WM_SETTEXT, IDC_RICHEDIT , strptr(txtbuffer) ) 'nearly good 
                '<<<<'----------------------------------------------------------- // sending chines characters to richedit but not correctly
               end if
           [
Josep Roca
Posts: 574
Joined: Sep 27, 2016 18:20
Location: Valencia, Spain

Re: Winfbe Editor Richedit Afx (Part one)

Post by Josep Roca »

> How I can send Chinese characters to Richedit Box correctly? See my Code snippets.. the Chinese characters are displayed correct in winfbe Editor Made utf8-8 bom active

Include my wrapper functions for the RichEdit control.

Code: Select all

#define UNICODE
#INCLUDE ONCE "Afx/CWindow.inc"
#INCLUDE ONCE "Afx/AfxRichEdit.inc"
USING Afx

Code: Select all

            CASE IDC_TXT
               DIM txtBuffer as cwstr = "你好"
               DIM hRichEdit AS HWND
               IF GET_WM_COMMAND_CMD(wParam, lParam) = BN_CLICKED THEN
                  hRichEdit = GetDlgItem(hWnd, IDC_RICHEDIT)
                  RichEdit_SetText (hRichEdit, txtBuffer)
               END IF
               EXIT FUNCTION
Löwenherz
Posts: 86
Joined: Aug 27, 2008 6:26
Location: Bad Sooden-Allendorf, Germany

Re: Winfbe Editor Richedit Afx (Part one)

Post by Löwenherz »

Thank you thats all Working fine Here :)
More question about controls String Handling and much more will come later I am Sure. .. I am Just learning

Was it a very great step to Port cWindow class from Powerbasic to freebasic ?

Loewenherz
Löwenherz
Posts: 86
Joined: Aug 27, 2008 6:26
Location: Bad Sooden-Allendorf, Germany

Re: Winfbe Editor Richedit Afx (Part one)

Post by Löwenherz »

Hello again.. Made some Progress with controls and size, afx_layoutptridx and add a combobox

But how I can Change Background color of Richedit Box? I tried with wm_ctlColorstatic but without success... Help is welcome

Code: Select all

' richEdit example with openSave File dialog and rich edit text box
' work in progress, freebasic, winFBE, part four, frank bruebach, 18-06-24
#define UNICODE
#INCLUDE ONCE "Afx/CWindow.inc"
#INCLUDE ONCE "Afx/AfxRichEdit.inc"
#INCLUDE ONCE "Afx/CLayout.inc"
USING Afx

ENUM AFX_USERDATA
   AFX_LAYOUTPTRIDX = 0
END ENUM

ENUM
   IDC_RICHEDIT = 1001 '''CONST IDC_RICHEDIT = 1001
   IDC_OFD
   IDC_SFD
   IDC_TXT
   IDC_COMBOBOX
END ENUM

DECLARE FUNCTION WinMain (BYVAL hInstance AS HINSTANCE, _
                          BYVAL hPrevInstance AS HINSTANCE, _
                          BYVAL szCmdLine AS ZSTRING PTR, _
                          BYVAL nCmdShow AS LONG) AS LONG
   END WinMain(GetModuleHandleW(NULL), NULL, COMMAND(), SW_NORMAL)
' // Forward declaration
DECLARE FUNCTION WndProc (BYVAL hwnd AS HWND, BYVAL uMsg AS UINT, BYVAL wParam AS WPARAM, BYVAL lParam AS LPARAM) AS LRESULT

FUNCTION WinMain (BYVAL hInstance AS HINSTANCE, _
                  BYVAL hPrevInstance AS HINSTANCE, _
                  BYVAL szCmdLine AS ZSTRING PTR, _
                  BYVAL nCmdShow AS LONG) AS LONG
   ' // Set process DPI aware
   AfxSetProcessDPIAware
   DIM pWindow AS CWindow
   pWindow.Create(NULL, "CWindow with a Rich Edit control", @WndProc)
   pWindow.SetClientSize(600, 420)
   pWindow.Center
   ' // Add a rich edit control without coordinates (it will be resized in WM_SIZE)
   'DIM hRichEdit AS HWND = pWindow.AddControl("RichEdit", , IDC_RICHEDIT, "RichEdit box")
   DIM hRichEdit AS HWND = pWindow.AddControl("RichEdit", , IDC_RICHEDIT, "RichEdit box", , , , , _
   WS_VISIBLE OR WS_TABSTOP OR ES_LEFT OR WS_VSCROLL OR ES_MULTILINE OR ES_WANTRETURN OR ES_NOHIDESEL OR ES_SAVESEL)

   ' // Raise the 32,767 default characters limit to no limit
   SendMessageW(hRichEdit, EM_EXLIMITTEXT, 0, -1)
   ' // Set the left margin
   SendMessageW(hRichEdit, EM_SETMARGINS, EC_LEFTMARGIN, 20)
   ' // Specify which notifications the control sends to its parent window
   SendMessageW(hRichEdit, EM_SETEVENTMASK, 0, ENM_CHANGE)
   ' // Set the margins
   SendMessageW hRichEdit, EM_SETMARGINS, EC_LEFTMARGIN OR EC_RIGHTMARGIN, MAKELONG(20, 20)
   SetFocus hRichEdit
   Edit_SetSel(hRichEdit, 0, -1)
'-------------------------------------------------------------------------- //
' // Anchor the controls
   DIM pLayout AS CLayout = pWindow.hWindow
   pWindow.UserData(AFX_LAYOUTPTRIDX) = CAST(LONG_PTR, @pLayout)
   pLayout.AnchorControl(IDCANCEL, AFX_ANCHOR_BOTTOM_RIGHT)
   pLayout.AnchorControl(IDC_COMBOBOX, AFX_ANCHOR_RIGHT)
'-------------------------------------------------------------------------- //
   ' // Add a button without coordinates (it will be resized in WM_SIZE)
   pWindow.AddControl("Button", , IDCANCEL, "&Close", 0, 0, 75, 23)
   pWindow.AddControl("Button", , IDC_OFD, "&Open File", 350, 350, 110, 23)
   pWindow.AddControl("Button", , IDC_SFD, "&Save File", 200, 350, 110, 23)
   pWindow.AddControl("Button", , IDC_TXT, "&Texter", 100, 350, 110, 23)
   ' // Add a combobox control
   DIM hCombobox AS HWND = pWindow.AddControl("ComboBox", , IDC_COMBOBOX, "", 320, 20, 180, 100)
   ' // Fill the control with some data
   DIM i AS LONG = 1, wszText AS WSTRING * 260
   FOR i = 1 TO 9
      wszText = "Item " & RIGHT("00" & STR(i), 2)
      SendMessageW(hComboBox, CB_ADDSTRING, 0, CAST(LPARAM, @wszText)) 
   NEXT
   ' // Dispatch Windows messages
   FUNCTION = pWindow.DoEvents(nCmdShow)
END FUNCTION
' ========================================================================================
FUNCTION WndProc (BYVAL hwnd AS HWND, BYVAL uMsg AS UINT, BYVAL wParam AS WPARAM, BYVAL lParam AS LPARAM) AS LRESULT
   SELECT CASE uMsg
      CASE WM_COMMAND
         SELECT CASE GET_WM_COMMAND_ID(wParam, lParam)
            ' // If ESC key pressed, close the application sending an WM_CLOSE message
            CASE IDCANCEL
               IF GET_WM_COMMAND_CMD(wParam, lParam) = BN_CLICKED THEN
                  SendMessageW hwnd, WM_CLOSE, 0, 0
                  EXIT FUNCTION
               END IF
               ' // Display the Open File Dialog
            CASE IDC_OFD
               IF GET_WM_COMMAND_CMD(wParam, lParam) = BN_CLICKED THEN
                  DIM wszFile AS WSTRING * 260 = "*.*"
                  DIM wszInitialDir AS STRING * 260 = CURDIR
                  DIM wszFilter AS WSTRING * 260 = "BAS files (*.BAS)|*.BAS|" & "All Files (*.*)|*.*|"
                  DIM dwFlags AS DWORD = OFN_EXPLORER OR OFN_FILEMUSTEXIST OR OFN_HIDEREADONLY OR OFN_ALLOWMULTISELECT
                  DIM cws AS CWSTR = AfxOpenFileDialog(hwnd, "", wszFile, wszInitialDir, wszFilter, "BAS", @dwFlags, NULL)
                  IF LEN(cws) THEN
                     DIM nItems AS LONG = AfxStrParseCount(cws)
                     IF nItems THEN
                        DIM cwsPath AS CWSTR = AfxStrParse(cws, 1)
                        MessageBoxW(hwnd, cwsPath, "Path", MB_OK)
                        FOR i AS LONG = 2 TO nItems
                           MessageBoxW(hwnd, AfxStrParse(cws, i), "File", MB_OK)
                        NEXT
                     END IF
                  END IF
                  EXIT FUNCTION
               END IF
               ' // Display the Save File Dialog
            CASE IDC_SFD
               IF GET_WM_COMMAND_CMD(wParam, lParam) = BN_CLICKED THEN
                  DIM wszFile AS WSTRING * 260 = "*.*"
                  DIM wszInitialDir AS WSTRING * 260 = CURDIR
                  DIM wszFilter AS WSTRING * 260 = "BAS files (*.BAS)|*.BAS|" & "All Files (*.*)|*.*|"
                  DIM dwFlags AS DWORD = OFN_EXPLORER OR OFN_FILEMUSTEXIST OR OFN_HIDEREADONLY OR OFN_OVERWRITEPROMPT
                  DIM cws AS CWSTR = AfxSaveFileDialog(hwnd, "", wszFile, wszInitialDir, wszFilter, "BAS", @dwFlags)
                  IF LEN(cws) THEN MessageBoxW(hwnd, cws, "File", MB_OK)
                  EXIT FUNCTION
               END IF
            '---------------------------------------------------------- //
            '------- how to set background color of richEditbox ? --------------------------------------------------- //
            CASE WM_CTLCOLORSTATIC:
               DIM hRichEdit AS HWND
               If lParam = hRichEdit Then
               Dim As LRESULT lBrush = DefWindowProc(hWnd, uMsg, wParam, lParam)
               SetBkMode(wParam, TRANSPARENT)
               SetBkColor(wParam, BGR(100, 100, 200))
               'SetTextColor(wParam, BGR(255,0,0))
                return lBrush
               EndIf 
            '   
            CASE IDC_TXT
               'dim txtBuffer as cwstr = "Hello dear Marvel fans"
               dim txtBuffer as cwstr = " ??? these are chinese letters " ' go UTF-8 bom active
               'AfxMsg MID(cws,2)
               DIM hRichEdit AS HWND
               DIM cws AS CWSTR="Sending some text into RichEditBox" 
               IF GET_WM_COMMAND_CMD(wParam, lParam) = BN_CLICKED THEN
                  MessageBoxW(hwnd, cws, "TEXT", MB_OK)
                  Edit_SetSel(GetDlgItem(hWnd, IDC_RICHEDIT), 0, -1)
                  SetWindowText hwnd,"Message Here" ' sending message into titlebar for a test ok but not into richeditbox
                  hRichEdit=GetDLGItem(hwnd,IDC_RICHEDIT) 'get the handle of richedit control
                  RichEdit_SetText(hRichEdit,txtBuffer)
                   '' no need for it: SendMessage( hRichEdit, WM_SETTEXT, IDC_RICHEDIT , strptr(txtbuffer) ) 
               end if
                  EXIT FUNCTION
         END SELECT
         '---------------------------------------------------------- //      
         CASE WM_GETMINMAXINFO
         ' Set the pointer to the address of the MINMAXINFO structure
         DIM ptmmi AS MINMAXINFO PTR = CAST(MINMAXINFO PTR, lParam)
         ' Set the minimum and maximum sizes that can be produced by dragging the borders of the window
         DIM pWindow AS CWindow PTR = AfxCWindowPtr(hwnd)
         IF pWindow THEN
            ptmmi->ptMinTrackSize.x = 300 * pWindow->rxRatio
            ptmmi->ptMinTrackSize.y = 180 * pWindow->ryRatio
         END IF
         EXIT FUNCTION                  
      CASE WM_SIZE
         ' // If the window isn't minimized, resize it
         IF wParam <> SIZE_MINIMIZED THEN
            ' // Resize the controls
            DIM pWindow AS CWindow PTR = AfxCWindowPtr(hwnd)
            IF pWindow THEN
               pWindow->MoveWindow GetDlgItem(hwnd, IDC_RICHEDIT), 100, 50, pWindow->ClientWidth - 200, pWindow->ClientHeight - 150, CTRUE
               pWindow->MoveWindow GetDlgItem(hwnd, IDCANCEL), pWindow->ClientWidth - 95, pWindow->ClientHeight - 35, 75, 23, CTRUE
               pWindow->MoveWindow GetDlgItem(hwnd, IDC_OFD), pWindow->ClientWidth - 195, pWindow->ClientHeight - 35, 75, 23, CTRUE
               pWindow->MoveWindow GetDlgItem(hwnd, IDC_SFD), pWindow->ClientWidth - 265, pWindow->ClientHeight - 35, 75, 23, CTRUE
               pWindow->MoveWindow GetDlgItem(hwnd, IDC_TXT), pWindow->ClientWidth - 365, pWindow->ClientHeight - 35, 75, 23, CTRUE
            END IF
         END IF
    	CASE WM_DESTROY
         ' // End the application by sending an WM_QUIT message
         PostQuitMessage(0)
         EXIT FUNCTION
   END SELECT
   ' // Default processing of Windows messages
   FUNCTION = DefWindowProcW(hWnd, uMsg, wParam, lParam)
END FUNCTION
' ========================================================================================
Löwenherz
Posts: 86
Joined: Aug 27, 2008 6:26
Location: Bad Sooden-Allendorf, Germany

Re: Winfbe Editor Richedit Afx (Part one)

Post by Löwenherz »

Perhaps this Code snippet could be a better Idea but I couldnt colorize Background of Rich edit Box to yellow.. must be Missing correct Handling to hrichedit Control Here in my example above

Code: Select all


... 
'  new idea perhaps this works better ?
'
CASE WM_CTLCOLORSTATIC:
               DIM hRichEdit AS HWND
               hRichEdit = GetDlgItem(hWnd, IDC_RICHEDIT)
               If lParam = hRichEdit Then
               Dim As LRESULT lBrush = DefWindowProc(hWnd, uMsg, wParam, lParam)
               SendMessage(hRichEdit, EM_SETBKGNDCOLOR, 0, &HFFFF00)  'COLOR_YELLOW
               return SetBkColor(wParam, BGR(255, 255, 0)) '*lbrush(GetStockObject(NULL_BRUSH)) 
               'SetBkMode(wParam, TRANSPARENT)
               'SetBkColor(wParam, BGR(100, 100, 200))
               'SetTextColor(wParam, BGR(255,0,0))
                'return lBrush
               EndIf 
            
            
Josep Roca
Posts: 574
Joined: Sep 27, 2016 18:20
Location: Valencia, Spain

Re: Winfbe Editor Richedit Afx (Part one)

Post by Josep Roca »

The WM_CTLCOLORSTATIC message is for static and edit controls, not for RichEdit.

Remove this code:

Code: Select all

            '------- how to set background color of richEditbox ? --------------------------------------------------- //
            CASE WM_CTLCOLORSTATIC:
               DIM hRichEdit AS HWND
               If lParam = hRichEdit Then
               Dim As LRESULT lBrush = DefWindowProc(hWnd, uMsg, wParam, lParam)
               SetBkMode(wParam, TRANSPARENT)
               SetBkColor(wParam, BGR(100, 100, 200))
               'SetTextColor(wParam, BGR(255,0,0))
                return lBrush
               EndIf 
and use

Code: Select all

   RichEdit_SetBkgndColor(hRichEdit, 0, BGR(255, 255,   0))   ' yellow color
after

Code: Select all

   DIM hRichEdit AS HWND = pWindow.AddControl("RichEdit", , IDC_RICHEDIT, "RichEdit box", , , , , _
   WS_VISIBLE OR WS_TABSTOP OR ES_LEFT OR WS_VSCROLL OR ES_MULTILINE OR ES_WANTRETURN OR ES_NOHIDESEL OR ES_SAVESEL)

Löwenherz
Posts: 86
Joined: Aug 27, 2008 6:26
Location: Bad Sooden-Allendorf, Germany

Re: Winfbe Editor Richedit Afx (Part one)

Post by Löwenherz »

Thank you Jose for Help, Works fine , so simple
Löwenherz
Posts: 86
Joined: Aug 27, 2008 6:26
Location: Bad Sooden-Allendorf, Germany

Re: Winfbe Editor Richedit Afx (Part one)

Post by Löwenherz »

Hello Jose .. If you have a little time more to Check my Progress here.. may be you can Help again .. Have expanded my richEdit example with combobox and selected items.. and colored items

How I can send a Text File content of a selected File by Open Dialog ("a-calc.txt") to the richEdit Control ?

Code: Select all

' richEdit example with openSave File dialog and rich edit text box
' work in progress, freebasic, winFBE, part five, frank bruebach, 20-06-24
' expand combox with selected Items
'
#define UNICODE
#INCLUDE ONCE "Afx/CWindow.inc"
#INCLUDE ONCE "Afx/AfxRichEdit.inc"
#INCLUDE ONCE "Afx/CLayout.inc"
#INCLUDE ONCE "Afx/CCbColor.inc"
USING Afx

ENUM AFX_USERDATA
   AFX_LAYOUTPTRIDX = 0
END ENUM
ENUM
   IDC_RICHEDIT = 1001 '''CONST IDC_RICHEDIT = 1001
   IDC_OFD
   IDC_SFD
   IDC_TXT
   IDC_COMBOBOX
   IDC_CBCOLOR
   IDC_CBCOLOR2
END ENUM

DECLARE FUNCTION WinMain (BYVAL hInstance AS HINSTANCE, _
                          BYVAL hPrevInstance AS HINSTANCE, _
                          BYVAL szCmdLine AS ZSTRING PTR, _
                          BYVAL nCmdShow AS LONG) AS LONG
   END WinMain(GetModuleHandleW(NULL), NULL, COMMAND(), SW_NORMAL)
' // Forward declaration
DECLARE FUNCTION WndProc (BYVAL hwnd AS HWND, BYVAL uMsg AS UINT, BYVAL wParam AS WPARAM, BYVAL lParam AS LPARAM) AS LRESULT
FUNCTION WinMain (BYVAL hInstance AS HINSTANCE, _
                  BYVAL hPrevInstance AS HINSTANCE, _
                  BYVAL szCmdLine AS ZSTRING PTR, _
                  BYVAL nCmdShow AS LONG) AS LONG
   ' // Set process DPI aware
   AfxSetProcessDPIAware
   DIM pWindow AS CWindow
   pWindow.Create(NULL, "CWindow with a Rich Edit control_EditorFB", @WndProc)
   pWindow.SetClientSize(600, 420)
   pWindow.Center
   ' // Add a rich edit control without coordinates (it will be resized in WM_SIZE)
   'DIM hRichEdit AS HWND = pWindow.AddControl("RichEdit", , IDC_RICHEDIT, "RichEdit box")
   DIM hRichEdit AS HWND = pWindow.AddControl("RichEdit", , IDC_RICHEDIT, "RichEdit box", , , , , _
   WS_VISIBLE OR WS_TABSTOP OR ES_LEFT OR WS_VSCROLL OR ES_MULTILINE OR ES_WANTRETURN OR ES_NOHIDESEL OR ES_SAVESEL)
   RichEdit_SetBkgndColor(hRichEdit,0, BGR(255,255,90)) 'yellow color '255,255,0)
   ' // Raise the 32,767 default characters limit to no limit
   SendMessageW(hRichEdit, EM_EXLIMITTEXT, 0, -1)
   ' // Set the left margin
   SendMessageW(hRichEdit, EM_SETMARGINS, EC_LEFTMARGIN, 20)
   ' // Specify which notifications the control sends to its parent window
   SendMessageW(hRichEdit, EM_SETEVENTMASK, 0, ENM_CHANGE)
   ' // Set the margins
   SendMessageW hRichEdit, EM_SETMARGINS, EC_LEFTMARGIN OR EC_RIGHTMARGIN, MAKELONG(20, 20)
   SetFocus hRichEdit
   Edit_SetSel(hRichEdit, 0, -1)
'-------------------------------------------------------------------------- //
' // Anchor the controls
   DIM pLayout AS CLayout = pWindow.hWindow
   pWindow.UserData(AFX_LAYOUTPTRIDX) = CAST(LONG_PTR, @pLayout)
   pLayout.AnchorControl(IDCANCEL, AFX_ANCHOR_BOTTOM_RIGHT)
   pLayout.AnchorControl(IDC_COMBOBOX, AFX_ANCHOR_RIGHT)
'-------------------------------------------------------------------------- //
   ' // Add a button without coordinates (it will be resized in WM_SIZE)
   pWindow.AddControl("Button", , IDCANCEL, "&Close", 0, 0, 75, 23)
   pWindow.AddControl("Button", , IDC_OFD, "&Open File", 350, 350, 110, 23)
   pWindow.AddControl("Button", , IDC_SFD, "&Save File", 200, 350, 110, 23)
   pWindow.AddControl("Button", , IDC_TXT, "&Texter", 100, 350, 110, 23)
   ' // Add a combobox control
   DIM hCombobox AS HWND = pWindow.AddControl("ComboBox", , IDC_COMBOBOX, "", 320, 20, 180, 100)
   ' // Fill the control with some data
   'DIM i AS LONG = 1, wszText AS WSTRING * 260
   DIM i AS LONG 
   for i= 1 to 9
   dim wszText(10) AS WSTRING * 260 = {"Ironman", "Batman", "Thor", "Hulk", "CaptainAmerica", "BlackWidow", _
      "Spiderman", "Giant", "CaptainMarvel", "Hawkeye"}
      SendMessageW(hComboBox, CB_ADDSTRING, 0, CAST(LPARAM, @wszText(i))) ' go
   next 
   ' // Add a color combobox control
   dim wszText(10) AS WSTRING * 260
   DIM pCbColor2 AS CCbColor =  CCbColor(@pWindow, IDC_CBCOLOR2, 100, 20, 180, 100, _
      GetSysColor(COLOR_WINDOWTEXT), GetSysColor(COLOR_WINDOWTEXT), @wszText(0), 18 * 20 * 2) 
    ' // Select a color
    SendMessageW pCbColor2.hWindow, CB_SETCURSEL, 5, 0
    'ComboBox_SetCursel(hComboBox, 0)
  '---------------------------------------------------------------------------------------- //
   DIM rgNames (17) AS WSTRING * 20 = {"Auto", "Negro", "Azul", "Verde", "Cian", "Rojo", _
      "Magenta", "Marrón", "Gris claro", "Gris", "Azul claro", "Verde claro", "Cian claro", _
      "Rojo claro", "Magenta claro", "Amarillo", "Blanco", "Selección libre..."}
   ' // Add a color combobox control
   DIM pCbColor AS CCbColor =  CCbColor(@pWindow, IDC_CBCOLOR, 100, 20, 180, 100, _
      GetSysColor(COLOR_WINDOWTEXT), GetSysColor(COLOR_WINDOWTEXT), @rgNames(0), 18 * 20 * 2)
    ' // Select a color
    SendMessageW pCbColor.hWindow, CB_SETCURSEL, 5, 0
  ' // Select the first item in the combo box
   ComboBox_SetCursel(hComboBox, 0)
   ' // Dispatch Windows messages
   FUNCTION = pWindow.DoEvents(nCmdShow)
END FUNCTION
' ========================================================================================
FUNCTION WndProc (BYVAL hwnd AS HWND, BYVAL uMsg AS UINT, BYVAL wParam AS WPARAM, BYVAL lParam AS LPARAM) AS LRESULT
   SELECT CASE uMsg
      CASE WM_COMMAND
         SELECT CASE GET_WM_COMMAND_ID(wParam, lParam)
            ' // If ESC key pressed, close the application sending an WM_CLOSE message
            CASE IDCANCEL
               IF GET_WM_COMMAND_CMD(wParam, lParam) = BN_CLICKED THEN
                  SendMessageW hwnd, WM_CLOSE, 0, 0
                  EXIT FUNCTION
               END IF
               CASE IDC_CBCOLOR2
               ' // Get selected color
               IF GET_WM_COMMAND_CMD(wParam, lParam) = CBN_SELENDOK THEN
                  DIM dwColor AS COLORREF
                  dwColor = SendMessageW(CAST(HWND, lParam), CBCOL_GETSELCOLOR, 0, 0)
                  ' Alternate way
'                  DIM pCbColor AS CCbColor PTR = CAST(CCbColor PTR, GetPropW(CAST(HWND, lParam), "CBCOLORPTR"))
'                  IF pCbColor <> NULL THEN dwColor = pCbColor->SelColor
               END IF
               ' // Display the Open File Dialog
            CASE IDC_OFD
               IF GET_WM_COMMAND_CMD(wParam, lParam) = BN_CLICKED THEN
                  DIM wszFile AS WSTRING * 260 = "*.*"
                  DIM wszInitialDir AS STRING * 260 = CURDIR
                  DIM wszFilter AS WSTRING * 260 = "BAS files (*.BAS)|*.BAS|" & "All Files (*.*)|*.*|"
                  DIM dwFlags AS DWORD = OFN_EXPLORER OR OFN_FILEMUSTEXIST OR OFN_HIDEREADONLY OR OFN_ALLOWMULTISELECT
                  DIM cws AS CWSTR = AfxOpenFileDialog(hwnd, "", wszFile, wszInitialDir, wszFilter, "BAS", @dwFlags, NULL)
                  IF LEN(cws) THEN
                     DIM nItems AS LONG = AfxStrParseCount(cws)
                     IF nItems THEN
                        DIM cwsPath AS CWSTR = AfxStrParse(cws, 1)
                        MessageBoxW(hwnd, cwsPath, "Path", MB_OK)
                        FOR i AS LONG = 2 TO nItems
                           MessageBoxW(hwnd, AfxStrParse(cws, i), "File", MB_OK) 
                        NEXT
                     END IF
                  END IF
                  dim hRichEdit2 as hwnd
                  dim txtBuffer2 as cwstr= "a-calc.txt"
                  hRichEdit2=GetDLGItem(hwnd,IDC_RICHEDIT) 'get the handle of richedit control
                  RichEdit_SetText(hRichEdit2,txtBuffer2)
                  EXIT FUNCTION
               END IF
               ' // Display the Save File Dialog
            CASE IDC_SFD
               IF GET_WM_COMMAND_CMD(wParam, lParam) = BN_CLICKED THEN
                  DIM wszFile AS WSTRING * 260 = "*.*"
                  DIM wszInitialDir AS WSTRING * 260 = CURDIR
                  DIM wszFilter AS WSTRING * 260 = "BAS files (*.BAS)|*.BAS|" & "All Files (*.*)|*.*|"
                  DIM dwFlags AS DWORD = OFN_EXPLORER OR OFN_FILEMUSTEXIST OR OFN_HIDEREADONLY OR OFN_OVERWRITEPROMPT
                  DIM cws AS CWSTR = AfxSaveFileDialog(hwnd, "", wszFile, wszInitialDir, wszFilter, "BAS", @dwFlags)
                  IF LEN(cws) THEN MessageBoxW(hwnd, cws, "File", MB_OK)
                  EXIT FUNCTION
               END IF               
            CASE IDC_TXT
               'dim txtBuffer as cwstr = "Hello dear Marvel fans"
               dim txtBuffer as cwstr = " ??? these are chinese letters " ' go UTF-8 bom active
               'dim txtBuffer as cwstr = "a-calc.txt" ' go UTF-8 bom active
               'AfxMsg MID(cws,2)
               DIM hRichEdit AS HWND
               DIM cws AS CWSTR="Sending some text into RichEditBox" 
               IF GET_WM_COMMAND_CMD(wParam, lParam) = BN_CLICKED THEN
                  MessageBoxW(hwnd, cws, "TEXT", MB_OK)
                  Edit_SetSel(GetDlgItem(hWnd, IDC_RICHEDIT), 0, -1)
                  SetWindowText hwnd,"Message Here" ' sending message into titlebar for a test ok but not into richeditbox
                  hRichEdit=GetDLGItem(hwnd,IDC_RICHEDIT) 'get the handle of richedit control
                  RichEdit_SetText(hRichEdit,txtBuffer)
                   '' no need for it: SendMessage( hRichEdit, WM_SETTEXT, IDC_RICHEDIT , strptr(txtbuffer) ) 
               end if
                  EXIT FUNCTION
                  '--------------------------------------------------- //
                  CASE IDC_COMBOBOX
               ' // The selection has changed
               IF GET_WM_COMMAND_CMD(wParam, lParam) = LBN_SELCHANGE THEN
                  ' // Handle of the combobox
                  DIM hCombobox AS HWND = GetDlgItem(hwnd, IDC_COMBOBOX)
                  ' // Retrieve the Item selected
                  DIM curSel AS LONG = ComboBox_GetCursel(hCombobox)
'                  ' // Retrieve the lenght of the text of the selected item
 '                 DIM nLen AS LONG = ComboBox_GetLBTextLen(hComboBox, curSel)
'                  ' // Retrieve the text of the selected item
'                  DIM pwszText AS WSTRING PTR = CAllocate(nLen + 1, SIZEOF(WCHAR))
'                  ComboBox_GetLBText(hComboBox, curSel, pwszText)
'                  MessageBoxW hwnd, "You have selected " & *pwszText, "ComboBox Test", MB_OK
'                  Deallocate pwszText
'                  pwszText = NULL
                  ' // Alternate and shorter way
                  MessageBoxW hwnd, "You have selected " & _
                     AfxGetComboBoxText(hCombobox, curSel), "ComboBox Test", MB_OK
               END IF
                  
         END SELECT
         '---------------------------------------------------------- //      
         CASE WM_GETMINMAXINFO
         ' Set the pointer to the address of the MINMAXINFO structure
         DIM ptmmi AS MINMAXINFO PTR = CAST(MINMAXINFO PTR, lParam)
         ' Set the minimum and maximum sizes that can be produced by dragging the borders of the window
         DIM pWindow AS CWindow PTR = AfxCWindowPtr(hwnd)
         IF pWindow THEN
            ptmmi->ptMinTrackSize.x = 300 * pWindow->rxRatio
            ptmmi->ptMinTrackSize.y = 180 * pWindow->ryRatio
         END IF
         EXIT FUNCTION                  
      CASE WM_SIZE
         ' // If the window isn't minimized, resize it
         IF wParam <> SIZE_MINIMIZED THEN
            ' // Resize the controls
            DIM pWindow AS CWindow PTR = AfxCWindowPtr(hwnd)
            IF pWindow THEN
               pWindow->MoveWindow GetDlgItem(hwnd, IDC_RICHEDIT), 100, 50, pWindow->ClientWidth - 200, pWindow->ClientHeight - 150, CTRUE
               pWindow->MoveWindow GetDlgItem(hwnd, IDCANCEL), pWindow->ClientWidth - 95, pWindow->ClientHeight - 35, 75, 23, CTRUE
               pWindow->MoveWindow GetDlgItem(hwnd, IDC_OFD), pWindow->ClientWidth - 195, pWindow->ClientHeight - 35, 75, 23, CTRUE
               pWindow->MoveWindow GetDlgItem(hwnd, IDC_SFD), pWindow->ClientWidth - 265, pWindow->ClientHeight - 35, 75, 23, CTRUE
               pWindow->MoveWindow GetDlgItem(hwnd, IDC_TXT), pWindow->ClientWidth - 365, pWindow->ClientHeight - 35, 75, 23, CTRUE
            END IF
         END IF
' // Must pass this one to the ownerdrawn combobox
     CASE WM_DRAWITEM
         IF wParam = IDC_CBCOLOR THEN
            SendMessageW GetDlgItem(hwnd, wParam), uMsg, wParam, lParam
            FUNCTION = CTRUE
            EXIT FUNCTION
         END IF
       IF wParam = IDC_CBCOLOR2 THEN
            SendMessageW GetDlgItem(hwnd, wParam), uMsg, wParam, lParam
            FUNCTION = CTRUE
            EXIT FUNCTION
         END IF
    	CASE WM_DESTROY
         ' // End the application by sending an WM_QUIT message
         PostQuitMessage(0)
         EXIT FUNCTION
   END SELECT
   ' // Default processing of Windows messages
   FUNCTION = DefWindowProcW(hWnd, uMsg, wParam, lParam)
END FUNCTION
' ========================================================================================
Found this perhaps its correct function ?

Code: Select all

richEdit_LoadRtfFromFile hRichEdit, "a-calc.txt"
Josep Roca
Posts: 574
Joined: Sep 27, 2016 18:20
Location: Valencia, Spain

Re: Winfbe Editor Richedit Afx (Part one)

Post by Josep Roca »

RichEdit_LoadRtfFromFile is to load files that contain rich text formated text, not plain text.

Open the text file, read the contents and then use RichEdit_Settext.
Löwenherz
Posts: 86
Joined: Aug 27, 2008 6:26
Location: Bad Sooden-Allendorf, Germany

Re: Winfbe Editor Richedit Afx (Part one)

Post by Löwenherz »

Hello Jose , its Not working Here with Reading the File correct sorry must Missing some Features for it

Code: Select all

...
' // Display the Open File Dialog
            CASE IDC_OFD
               IF GET_WM_COMMAND_CMD(wParam, lParam) = BN_CLICKED THEN
                  DIM wszFile AS WSTRING * 260 = "*.*"
                  DIM wszInitialDir AS STRING * 260 = CURDIR
                  DIM wszFilter AS WSTRING * 260 = "BAS files (*.BAS)|*.BAS|" & "All Files (*.*)|*.*|"
                  DIM dwFlags AS DWORD = OFN_EXPLORER OR OFN_FILEMUSTEXIST OR OFN_HIDEREADONLY OR OFN_ALLOWMULTISELECT
                  DIM cws AS CWSTR = AfxOpenFileDialog(hwnd, "", wszFile, wszInitialDir, wszFilter, "BAS", @dwFlags, NULL)
                  'print cws  : print wszFile
                  IF LEN(cws) THEN 
                     DIM nItems AS LONG = AfxStrParseCount(cws)
                     IF nItems THEN
                        DIM cwsPath AS CWSTR = AfxStrParse(cws, 1)
                        MessageBoxW(hwnd, cwsPath, "Path", MB_OK)
                        print cws
                        FOR i AS LONG = 2 TO nItems
                           MessageBoxW(hwnd, AfxStrParse(cws, i), "File", MB_OK) 
                        NEXT
                     END IF
                  END IF
                  'print "cws: " + cws : print wszFile  
                  dim hRichEdit as hwnd 
                  hRichEdit=GetDLGItem(hwnd,IDC_RICHEDIT)
                  var  f=freefile
                   Open wszFile For Binary Access Read As #f
                   Chdir(Exepath)
                   Get #f, , str(wszfile)
                   If not Len(wszfile)>0 Then 
                     If Lcase(Right(wszfile, 4)) = "a-calc2.txt" Then 
                   print "wszfile " + wszfile
                   RichEdit_SetText(hRichEdit,wszFile ) 
                  end if
                  end if
                  end if
               ...
               
Help is Welcome again.. thx
Josep Roca
Posts: 574
Joined: Sep 27, 2016 18:20
Location: Valencia, Spain

Re: Winfbe Editor Richedit Afx (Part one)

Post by Josep Roca »

Add

Code: Select all

#INCLUDE ONCE "Afx/CStream.inc"
to the list of include files.

Replace your code for the open file dialog with:

Code: Select all

               ' // Display the Open File Dialog
            CASE IDC_OFD
               IF GET_WM_COMMAND_CMD(wParam, lParam) = BN_CLICKED THEN
                  DIM wszFile AS WSTRING * 260 = "*.*"
                  DIM wszInitialDir AS STRING * 260 = CURDIR
                  DIM wszFilter AS WSTRING * 260 = "BAS files (*.BAS)|*.BAS|" & "All Files (*.*)|*.*|"
                  DIM dwFlags AS DWORD = OFN_EXPLORER OR OFN_FILEMUSTEXIST OR OFN_HIDEREADONLY
                  DIM cwsPath AS CWSTR = AfxOpenFileDialog(hwnd, "", wszFile, wszInitialDir, wszFilter, "BAS", @dwFlags, NULL)
                  MessageBoxW(hwnd, cwsPath, "Path", MB_OK)
                  IF LEN(cwsPath) THEN
                     SCOPE
                        DIM pstm AS CFileStream
                        pstm.Open(cwsPath, STGM_READ)
                        ' Ansi text. If the file contains Unicode text, use ReadTextW.
                        DIM cwsText AS CWSTR = pstm.ReadTextA(-1)
                        DIM hRichEdit AS HWND = GetDLGItem(hwnd, IDC_RICHEDIT)
                        RichEdit_SetText(hRichEdit, cwsText)
                     END SCOPE
                  END IF
                  EXIT FUNCTION
               END IF
Löwenherz
Posts: 86
Joined: Aug 27, 2008 6:26
Location: Bad Sooden-Allendorf, Germany

Re: Winfbe Editor Richedit Afx (Part one)

Post by Löwenherz »

Many thanks I Had never found this solution to be truly all is working fine I am so Glad.. its Like a little learning Curve step by step :)

Another question about scintilla / scilexer..

Does any pWindow.AddControl exist for it ?

Code: Select all

' -- how to finde infos about Scintilla, Scilexer for WINFBE Editor (afx)
' -- does a pWindow AddControll already exists? 
' -- or I must create a similar richEdit Control for it? 

#INCLUDE ONCE "Afx/CWindow.inc"
'#INCLUDE ONCE "commctrl.bi"
#include "scintilla2.bi"
#include "scilexer2.bi"
#include "Lexilla2.bi"
DyLibLoad("SciLexer.dll")

USING Afx
const IDC_SCINT=1001

Dim myScintilla As HWND
   ' // Adds a button
   pWindow.AddControl("Button", , IDCANCEL, "&Close", 350, 250, 75, 23)
   pWindow.AddControl("Scintilla"," " , IDC_SCINT, "&Scintilla", 50, 50, 275, 223)
   'myScintilla = CreateWindowEx(0,"Scintilla","", WS_CHILD Or WS_BORDER Or WS_VISIBLE Or WS_TABSTOP Or WS_CLIPCHILDREN,10,10,500,400,hWnd,NULL, GetModuleHandle(NULL),NULL)
   
' ---------------
Josep Roca
Posts: 574
Joined: Sep 27, 2016 18:20
Location: Valencia, Spain

Re: Winfbe Editor Richedit Afx (Part one)

Post by Josep Roca »

I don't have wrappers for Scintilla in my framewok. Therefore, you have to specify all the window styles by yourself.

Code: Select all

   '// Load the Scintilla control
   DIM hLib AS ANY PTR = DyLibLoad("SciLexer.dll")   '---> change path if needed
   ' // Add an Scintilla control
   pWindow.AddControl("Scintilla", , IDC_SCINT, "&Scintilla", 50, 50, 275, 223, _
      WS_CHILD OR WS_VISIBLE OR ES_MULTILINE OR WS_VSCROLL OR WS_HSCROLL OR _
      ES_AUTOHSCROLL OR ES_AUTOVSCROLL OR ES_NOHIDESEL)
I don't use this control. Therefore, I'm not in position of answering more questions about it. Look at the source code for the WinFBE editor.
Post Reply