Abrir, ocultar el menú, poner en funcionamiento SDRSharp y recorrer el rango de frecuencias desde 400~470 MHz haciendo una captura de pantalla por cada frecuencia
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
#Abrir SDRSharp Start-Process E:\sdrsharp-x86\SDRSharp.exe Start-Sleep -Seconds 5 #Funciones necesarias para hacer clic $MouseEventSig=@' [DllImport("user32.dll",CharSet=CharSet.Auto, CallingConvention=CallingConvention.StdCall)] public static extern void mouse_event(long dwFlags, long dx, long dy, long cButtons, long dwExtraInfo); '@ $MouseEvent = Add-Type -memberDefinition $MouseEventSig -name "MouseEventWinApi" -passThru #Función para capturar la pantalla function screenshot($path) { $b=New-Object System.Drawing.Bitmap([System.Windows.Forms.Screen]::PrimaryScreen.Bounds.Width, [System.Windows.Forms.Screen]::PrimaryScreen.Bounds.Height) $g=[System.Drawing.Graphics]::FromImage($b) $g.CopyFromScreen((New-Object System.Drawing.Point(0,0)), (New-Object System.Drawing.Point(0,0)), $b.Size) $g.Dispose() $b.Save($path,'Bmp') } #Hacer clic en el botón del menú para ocultarlo [System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point(23,54) $MouseEvent::mouse_event(0x00000002, 0, 0, 0, 0) $MouseEvent::mouse_event(0x00000004, 0, 0, 0, 0) Start-Sleep -Seconds 5 #Hacer clic en Start para poner en funcionamiento SDRSharp [System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point(60,54) $MouseEvent::mouse_event(0x00000002, 0, 0, 0, 0) $MouseEvent::mouse_event(0x00000004, 0, 0, 0, 0) Start-Sleep -Seconds 5 #Mover el cursor hasta la posición de los MHz y hacer clic [System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point(382,54) $MouseEvent::mouse_event(0x00000002, 0, 0, 0, 0) $MouseEvent::mouse_event(0x00000004, 0, 0, 0, 0) Start-Sleep -Seconds 5 #Escribir en la posición de los MHz el valor 400 [System.Windows.Forms.SendKeys]::SendWait("400") Start-Sleep -Seconds 5 #Hacer 70 clics en la posición de la unidad en los MHz 1..70 | % { [System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point(422,46) $MouseEvent::mouse_event(0x00000002, 0, 0, 0, 0) $MouseEvent::mouse_event(0x00000004, 0, 0, 0, 0) Start-Sleep -Seconds 5 #Ruta de la captura de pantalla screenshot "e:\frecuencias\$_.bmp" } |