Contenidos
Código en PowerShell que permite hacer click utilizando SendMessage y FindWindowEx de user32.dll
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 |
$codigo=' [DllImport("user32.dll", EntryPoint = "FindWindowEx")]public static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow); [DllImport("User32.dll")]public static extern int SendMessage(IntPtr hWnd, int uMsg, int wParam, string lParam); ' # Localizar el proceso de PowerShell_ISE que tiene abierto el formulario $proceso = Get-Process xampp-control $acciones = Add-Type -MemberDefinition $codigo -Name Acciones -PassThru # FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow) # SendMessage(IntPtr hWnd, int uMsg, int wParam, string lParam) # Tenemos que localizar la clase mediante Microsoft Spy++ $clase = "TBitBtn" # Tenemos que localizar el botón Start de Apache # (COMO HAY MUCHOS BOTONES QUE SE LLAMAN IGUAL HAY QUE BUSCAR EL VALOR IDENT. CON MICROSOFT SPY++) $identidadboton = [uint32]"0x0001043E" # Hacer click en el botón $acciones::SendMessage($identidadboton, 0x00F5, 0, 0) # Tenemos que localizar el botón Start de MySQL # (COMO HAY MUCHOS BOTONES QUE SE LLAMAN IGUAL HAY QUE BUSCAR EL VALOR IDENT. CON MICROSOFT SPY++) $identidadboton = [uint32]"0x00010442" # Hacer click en el botón $acciones::SendMessage($identidadboton, 0x00F5, 0, 0) |
Localizar el botón «Start» de Apache y MySQL con Microsoft Spy++
