saben si esta funcionando el comando DetectHiddenWindows, On Topic is solved

Esta sección es para preguntas sobre programación/scripting usando AutoHotkey.

Moderator: Flipeador

euxier

saben si esta funcionando el comando DetectHiddenWindows, On

16 Oct 2023, 01:20

saben si este comando DetectHiddenWindows, On sigue funcionando actualmente? porque intento ejecutar el scrip solamente en un navegador tratando de que funcionen minimizado y este se desactiva y se activa en la ventana o programa a la que me dirija

Code: Select all

DetectHiddenWindows, On
ifwinactive, ahk_exe msedge.exe

Loop
{ 
Loop, 10
 if WinExist("ahk_exe msedge.exe")
{
  ControlSend, , {2}, ahk_pid 3652 
 }
Sleep, 1000
}
5::
Pause
return

Q::
 {
 Sleep, 3000 
 if WinExist("ahk_exe msedge.exe")
 ControlSend, , !+1, ahk_pid 3652
 Sleep, 3000 
 if WinExist("ahk_exe msedge.exe")
 ControlSend, , !+2, ahk_pid 3652 
 Sleep, 3000
 if WinExist("ahk_exe msedge.exe")
 ControlSend, , !+3, ahk_pid 3652 
 Sleep, 3000
 if WinExist("ahk_exe msedge.exe")
 ControlSend, , !+4, ahk_pid 3652 
 Sleep, 3000
 if WinExist("ahk_exe msedge.exe")
 ControlSend, , !+5, ahk_pid 3652 
 return
 }
 

+1::
 {
 if WinExist("ahk_exe msedge.exe")
 ControlSend, , 1, ahk_pid 3652
 Sleep, 800
 ControlSend, , {F2}, ahk_pid 3652
 return
 }


Z::
 {
 if WinExist("ahk_exe msedge.exe")
 ControlSend, , {3}, ahk_pid 3652
 return
 }
esto es lo que estoy tratando de ejecutar


[Moderator edit: Added [code][/code] tags. Please use them yourself when posting code.]
sofista
Posts: 650
Joined: 24 Feb 2020, 13:59
Location: Buenos Aires

Re: saben si esta funcionando el comando DetectHiddenWindows, On  Topic is solved

16 Oct 2023, 18:22

euxier wrote:
16 Oct 2023, 01:20
saben si este comando DetectHiddenWindows, On sigue funcionando actualmente?
Hola: Sí, funciona correctamente. Para que no te quedes sólo con mi palabra, aquí va un par de pruebas. Antes correr las pruebas, quita MS Notepad. Luego

Code: Select all

DetectHiddenWindows On

Run, Notepad.exe,, Hide                   ; Se inicia MS Notepad en modo oculto
Sleep, 300
WinGet, Lista, List, ahk_class Notepad
MsgBox, % Lista                           ; Responde: 1
En cambio, con DetectHiddenWindows Off, el mismo código responderá 0.
euxier

Re: saben si esta funcionando el comando DetectHiddenWindows, On

19 Oct 2023, 14:28

sucede que si intento usarlo de esa manera con el comando al cambiar de navegador deja de funcionar y no ejecuta ningun comando de los que tengo alli
sofista
Posts: 650
Joined: 24 Feb 2020, 13:59
Location: Buenos Aires

Re: saben si esta funcionando el comando DetectHiddenWindows, On

19 Oct 2023, 18:05

Entonces, eso significa que el problema —o los problemas— está/n en el resto del código. Mi sugerencia es que vayas probando rutina por rutina y ver cuál funciona y cuál no.

Return to “Pedir Ayuda”

Who is online

Users browsing this forum: No registered users and 109 guests