vb.net 2005 GetForegroundWindow用法
到底怎么用Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
ByVal lpString As String 这个参数老是传不对
谁能给个例子 --------------------编程问答--------------------
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Integer, ByVal lpString As String, ByVal cch As Integer) As Integer--------------------编程问答--------------------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Text = "GetWindowText的例子"
Dim strText As String
strText = Space(20)
GetWindowText(Me.Handle, strText, 20)
MessageBox.Show(strText)
End Sub
Private Declare Function GetForegroundWindow Lib "user32" Alias "GetForegroundWindow" () As Integer--------------------编程问答-------------------- Space()不能是啥原因
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Integer, ByVal lpString As String, ByVal cch As Integer) As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Text = "GetWindowText的例子"
Dim strText As String
strText = Space(20)
GetWindowText(GetForegroundWindow(), strText, 20)
MessageBox.Show(strText)
End Sub
--------------------编程问答--------------------
有空格填充 --------------------编程问答-------------------- 帮顶一个!关注ing...学习....
补充:.NET技术 , VB.NET