永发信息网

谁帮我看一下我写的这个VB程序,为什么别人这样写就可以运行而我的却错误

答案:1  悬赏:0  手机版
解决时间 2021-05-10 14:15
  • 提问者网友:富士山上尢
  • 2021-05-09 14:58

Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long

Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint 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 Const WM_GETTEXT = &HD

Private Type POINTAPI
    x As Long
    y As Long
End Type

 

Private Sub Command1_Click()
    Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
    On Error Resume Next
    Dim P As POINTAPI
    Dim H As Long
    Dim lParam As String * 256
    GetCursorPos P
    H = WindowFromPoint(P.x, P.y)
    SendMessage H, WM_GETTEXT, 255, lParam
    Text1.Text = lParam
End Sub

他说工程1中发生未处理的WIN32异常

最佳答案
  • 五星知识达人网友:煞尾
  • 2021-05-09 16:36
9115.047关注此问题,望高手回答 QQ447186060 自动//分类//答题器 QQ问问//专用该答题器为全//自动//答题可刷金币,但会降低采纳率问题发送机正在制作中、
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯