Foxtable(狐表)用户栏目专家坐堂 → [求助]请问这段代码怎么转到狐表里面?


  共有2111人关注过本帖平板打印复制链接

主题:[求助]请问这段代码怎么转到狐表里面?

帅哥哟,离线,有人找我吗?
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106665 积分:542508 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2019/11/13 15:13:00 [只看该作者]

全局代码
Public Declare Function GetWindowRect Lib "user32" (ByVal hwnd As IntPtr, ByRef lpRect As RECT) As Long
    Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
    Public Structure RECT
        Public left As Int32
        Public top As Int32
        Public right As Int32
        Public bottom As Int32
    End Structure
    Public Sub Button1_Click()
        Dim p1 As RECT
        Dim hwnd As IntPtr = FindWindow(Nothing, "无标题 - 记事本")
        If hwnd <> IntPtr.Zero Then
            GetWindowRect(Me.Handle, p1)
            MsgBox(p1.right)  '获取到left ,top ,right ,bottom
        Else
            MsgBox("未找到窗口")
        End If

    End Sub

调用
Button1_Click()

 回到顶部