API SendMessage 怎么用啊


API SendMessage 如何用啊
我在vb.net中用了一个第三方控件,可是,不知道为什么它得不到tab,enter等键,听高人说是被vb.net截获了.可以用
这个函数传到这个控件上.大家知道怎么做吗 谢了

假设控件为A

VBScript .net 程序开发

hecate 13 years, 4 months ago


学习了~~~

Nu.13 answered 13 years, 4 months ago


  VB.NET code

  Public Const WM_SETTEXT As Integer = 12 <DllImport("user32.dll", CharSet:=CharSet.Auto)> _ Public Shared Function SendMessage( _ ByVal hWnd As HandleRef, _ ByVal msg As Integer, _ ByVal wParam As Integer, _ ByVal lParam As StringBuilder) As IntPtr End Function Public Shared Sub SetText(ByVal hWnd As IntPtr, ByVal text As String) Dim b As New StringBuilder(text) SendMessage(New HandleRef(Nothing, hWnd), WM_SETTEXT, b.Capacity, b) End Sub

经常晚到一步君 answered 13 years, 4 months ago

Your Answer