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


  共有2039人关注过本帖树形打印复制链接

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

帅哥,在线噢!
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106182 积分:540033 威望: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()

 回到顶部
帅哥,在线噢!
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106182 积分:540033 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2019/11/14 9:46:00 [显示全部帖子]

GetWindowRect(Me.Handle, p1)

改为

GetWindowRect(hwnd , p1)

 回到顶部