vb改动microsip让microsip隐藏然后命令拨打电话

  • Post author:
  • Post category:其他


由于不熟练sipjs的操作无法嵌入到网页中,这是个蠢方法

Private Declare Function FindWindow Lib “user32” Alias “FindWindowA” (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Private Declare Function MoveWindow Lib “user32” (ByVal hwnd As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long

Private Declare Function SetActiveWindow Lib “user32” (ByVal hwnd As Long) As Long

Private Declare Sub Sleep Lib “kernel32” (ByVal dwMilliseconds As Long)

Private Declare Function GetWindowText Lib “user32” Alias “GetWindowTextA” (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long

Private Declare Function ShowWindow Lib “user32” (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long

Private Declare Function SetWindowPos& Lib “user32” (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long)

Private Type RECT

Left As Long

Top As Long

Right As Long

Bottom As Long

End Type

Private Declare Function GetWindowRect Lib “user32” (ByVal hwnd As Long, lpRect As RECT) As Long

Private Sub Command1_Click()

‘Dim a As RECT

Dim command As String

Shell “C:\Program Files (x86)\MicroSIP\MicroSIP.exe ” & command, vbNormalNoFocus

‘ Sleep 2000

‘Dim hwnd As Long

‘hwnd = FindWindow(vbNullString, “MicroSIP – 8001”)

‘ FormMove = MoveWindow(hwnd, 1800, 200, 100, 200, True)

‘SetActiveWindow hwnd

‘GetWindowRect hwnd, a ‘这个hwnd换为你要判断的那个窗口的句柄

‘MsgBox hwnd

‘MsgBox “这个窗口的位置是:Left=” & a.Left & ” Top=” & a.Top & vbCrLf & “大小是:” & a.Right – a.Left & “*” & a.Bottom – a.Top

End Sub

Private Sub Command2_Click()

Shell “C:\Program Files (x86)\MicroSIP\MicroSIP.exe /hangupall”

End Sub

Private Sub Command3_Click()

Unload Me

End Sub

Private Sub Form_Load()

Dim hwnd As Long

Dim strCmd As String

strCmd = Trim(command)

Shell “C:\Program Files (x86)\MicroSIP\MicroSIP.exe ” & strCmd, vbNormalNoFocus

hwnd = FindWindow(vbNullString, “MicroSIP – 8001”)

FormMove = MoveWindow(hwnd, 1275, 200, 100, 200, True)

Unload Me

End Sub

Private Sub Timer1_Timer()

Dim a As RECT

Dim hwnd As Long

hwnd = FindWindow(vbNullString, “MicroSIP – 8001”)

FormMove = MoveWindow(hwnd, 275, 1200, 100, 200, True)

‘SetActiveWindow hwnd

GetWindowRect hwnd, a ‘这个hwnd换为你要判断的那个窗口的句柄

‘Text1 = “Left=” & a.Left & ” Top=” & a.Top & vbCrLf & “大小是:” & a.Right – a.Left & “*” & a.Bottom – a.Top

‘FormMove = MoveWindow(Me.hwnd, a.Left, a.Top, 500, 100, True)

SetWindowPos Me.hwnd, -1, a.Left + 40, a.Top – 1055, 245, 105, FLAGS


End Sub

这样运行生成的文件加上手机号码就能拨打电话了

1.exe  13921455***   试过了能拨打

资源文件:

https://download.csdn.net/download/xw870228/18563511

需要源码或者调试的可以互相交流!



版权声明:本文为xw870228原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。