Hej på er :-) Jag löste det :-)RichEdit med CreatewindowEX
Jag har skapat en Richedit med hjälp av CreateWindowEx, hur jag än gör så klarar den bara 32k data, någon som vet hur jag löser det ?
Jag klistrar in min kod utan alla Constanter och deras värden.
<code>
Private m_hWnd As Long
Private lngLIB As Long
Private Declare Function MoveWindow Lib "user32" _
(ByVal hWnd As Long, ByVal x As Long, ByVal y As Long, _
ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
Private Declare Function CreateWindowEx Lib "user32" _
Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, _
ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal x As Long, _
ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, _
ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, _
lpParam As Any) As Long
Private Declare Function DestroyWindow Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) _
As Long
Private Declare Function win32_SetFocus Lib "user32" Alias "SetFocus" _
(ByVal hWnd As Long) As Long
Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" _
(ByVal lpLibFileName As String) As Long
Private Declare Function FreeLibrary Lib "kernel32" _
(ByVal hLibModule As Long) As Long
Private Sub Form_Load()
Dim Style As Long
lngLIB = LoadLibrary("RICHED20.DLL")
Style = WS_CHILD Or ES_MULTILINE Or WS_VSCROLL Or WS_HSCROLL Or _
ES_AUTOHSCROLL Or ES_AUTOVSCROLL Or WS_VISIBLE
m_hWnd = CreateWindowEx(0, "RichEdit20W", vbNullString, _
Style, _
0, 0, 0, 0, _
Me.hWnd, 0, App.hInstance, ByVal 0&)
Me.Show
Form_Resize
Call win32_SetFocus(m_hWnd)
End Sub
Private Sub Form_Resize()
If Not Me.WindowState = 1 Then
MoveWindow m_hWnd, 0, 0, (Me.Width / Screen.TwipsPerPixelY) - 8, (Me.Height / Screen.TwipsPerPixelY) - 28, Abs(True)
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
FreeLibrary lngLIB
End Sub
</code>Sv: RichEdit med CreatewindowEX
Call SendMessage(Edit_hWind, EM_EXLIMITTEXT, 0, 0)