Option ExplicitPrivate Const WM_USER As Long = &H400 Private Const EM_SETTARGETDEVICE As Long = WM_USER + 72 Private Const WM_PASTE = &H302Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As LongPrivate Declare Function SendMessage Lib "user32" Alias "SendMessageA" _ (ByVal hwnd As Long, ByVal msg As Long, ByVal wp As Long, Ip As Any) As LongPrivate Sub Command1_Click() RichTextBox1.LoadFile "c:\111.txt" End SubPrivate Sub Command2_Click() SendMessage RichTextBox1.hwnd, EM_SETTARGETDEVICE, 0, 0 End Sub
Private Const EM_SETTARGETDEVICE As Long = WM_USER + 72
Private Const WM_PASTE = &H302Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As LongPrivate Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal msg As Long, ByVal wp As Long, Ip As Any) As LongPrivate Sub Command1_Click()
RichTextBox1.LoadFile "c:\111.txt"
End SubPrivate Sub Command2_Click()
SendMessage RichTextBox1.hwnd, EM_SETTARGETDEVICE, 0, 0
End Sub