I need to make a text editor on WinApi C ++. The text editor works with planar text (that is, there is no formatting provided). Accordingly, I want to make one large multi-Textbox for the whole window. Tell me, please, how to do it so that TextBox would change its size in accordance with changes in the size of the window in which it is located?

    1 answer 1

    case WM_SIZE: hInstance1 = GetWindowWord(hChild, GWW_HINSTANCE); Edit1 = CreateWindow( "EDIT", "", WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | WS_BORDER | ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_MULTILINE | ES_READONLY, 0, 0, 1000, 500, hChild, 100, hInstance1, NULL ); nWidth = LOWORD(lParam); nHeight = HIWORD(lParam); MoveWindow(Edit1, 0, 0, nWidth, nHeight, 1); ShowWindow(Edit1, SW_SHOWNORMAL); break; 

    Maybe it will help you. I did not check. But once did this.

    • one
      CreateWindow on each WM_SIZE? an obvious error, you need to bring CreateWindow to where the main window is created or to WM_CREATE processing. - nzeemin