;Autor: Fluid Byte ;http://www.purebasic.fr/english/viewtopic.php?p=301303#p301303 EnableExplicit Global lpPrevFunc Procedure EditCtrlProc(hWnd,uMsg,wParam,lParam) Select uMsg Case #WM_CHAR If wParam = #VK_RETURN Select hwnd Case GadgetID(1) If SendMessage_(hwnd,#EM_GETLINECOUNT,0,0) = 4;Zeilen ProcedureReturn 0 EndIf EndSelect EndIf EndSelect ProcedureReturn CallWindowProc_(lpPrevFunc,hWnd,uMsg,wParam,lParam) EndProcedure If OpenWindow(0,0,0,500,250,"Window",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) StringGadget(1,10,10,480,230,"",#ES_MULTILINE) lpPrevFunc = SetWindowLongPtr_(GadgetID(1),#GWL_WNDPROC,@EditCtrlProc()) Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow EndIf ; IDE Options = PureBasic 5.31 (Windows - x64) ; CursorPosition = 2 ; Folding = - ; EnableUnicode ; EnableXP ; EnableUser ; EnableCompileCount = 0 ; EnableBuildCount = 0