网上都说SendMessage hwnd,WM_SETTEXT,0,Str 我怎么试都不行。拿记事本试的
解决方案 »
- 怎么取出IE游览器工具栏的图标,就是这些后退、前进、停止。具体看图
- **********怎么会recordcount为-1
- msflexgrid如何讓內容自動控制單元格的長度?
- 为什么这样写会溢出?Const counti = 1000 x = counti * 161 - 1
- treeview节点问题,下午结帖
- 数据回显问题
- VB中如何在SQL语句中使用排序查询以供数据报(Data Report)输出使用?
- 刚学vb,关于屏幕分辨率的问题请教大家?
- 在VB中通过字符串调用一个外部dll中的函数,是用哪个函数?
- 如何 在一个工程中判断一个子窗体有没有加载并处于显示状态
- 关于ADO控件
- 哈哈自动编号我搞定了,日期加序号的
Option Explicit
Private Const WM_CHAR = &H102
Private Const WM_SETCURSOR = &H20
Private Const WM_SETFOCUS = &H7
Private Const WM_KEYDOWN = &H100
Private Const WM_LBUTTONDOWN = &H201
Private Const MK_LBUTTON = &H1Private Declare Function GetTickCount Lib "kernel32" () As Long
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As LongPrivate Declare Function CreateCaret Lib "user32" (ByVal hwnd As Long, ByVal hBitmap As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Private Declare Function SetCaretPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
Private Declare Function ShowCaret Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetFocus Lib "user32" () As Long
Private Declare Function GetActiveWindow Lib "user32" () 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 SetCursor Lib "user32" (ByVal hCursor As Long) As Long'将一个字符串通过PostMessage传送出去
Private Sub subPostString(ByVal lngHandle As Long, ByVal strP As String)
Dim intP As Integer
Dim intK As Integer
Dim lngAsc As Long
Dim lngP As Long
Dim strT As String
On Error GoTo errSub
For intP = 0 To Len(strP) - 1
strT = Mid(strP, intP + 1, 1)
If Asc(strT) <= 0 Then
lngAsc = AscW(StrConv(strT, 128))
If lngAsc < 0 Then
lngAsc = lngAsc + 65536 '2^16
End If
Else
lngAsc = Asc(strT)
End If
lngP = PostMessage(lngHandle, WM_CHAR, lngAsc, 0)
Next intP
Exit Sub
errSub:End SubPrivate Sub Command1_Click()
Call subPostString(Text1.hwnd, Text2.Text)
End SubPrivate Sub Form_Load()
End Sub