Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

ifwinactive


  • Please log in to reply
4 replies to this topic
Babis
  • Members
  • 67 posts
  • Last active: Jan 23 2013 01:30 PM
  • Joined: 08 Dec 2005
Hello, I am trying to make "ifwinactive" to work in 2 windows but it is not working. Although it is working with only 1 window I cannot replicate it with 2.

Working
$*numpadadd::
ifwinactive ahk_class MozillaUIWindowClass
{
  send {WHEELdown 2}
}
else
{
  send {numpadadd}
}
return

Not working:
$*numpadadd::
ifwinactive("ahk_class MozillaUIWindowClass") or winactive("ahk_class SunAwtFrame")
{
  send {WHEELdown 2}
}
else
{
  send {numpadadd}
}
return

Not working also:
$*numpadadd::
ifwinactive ahk_class MozillaUIWindowClass
ifwinactive ahk_class SunAwtFrame
{
  send {WHEELdown 2}
}
else
{
  send {numpadadd}
}
return

Any ideas please, thanks.

sinkfaze
  • Moderators
  • 6365 posts
  • Last active:
  • Joined: 18 Mar 2008
[color=red]GroupAdd, FirefoxBrowser, ahk_class MozillaUIWindowClass

GroupAdd, FirefoxBrowser, ahk_class SunAwtFrame[/color]



$*numpadadd::

[color=red]ifwinactive ahk_group FirefoxBrowser[/color]

  send {WHEELdown 2}

else

  send {numpadadd}

return


Babis
  • Members
  • 67 posts
  • Last active: Jan 23 2013 01:30 PM
  • Joined: 08 Dec 2005
Thanks a lot for your help, but still can't make it work.

It sends + on the firefox and nothing in the other window.

aaffe
  • Members
  • 1045 posts
  • Last active: Jan 16 2014 01:32 PM
  • Joined: 17 May 2007

Settitlematchmode, REgex

#IfWinActive,("ahk_class MozillaUIWindowClass"|"ahk_class SunAwtFrame")

$*numpadadd::

  Send {Wheeldown 2}

Return

#IfWinactive



Babis
  • Members
  • 67 posts
  • Last active: Jan 23 2013 01:30 PM
  • Joined: 08 Dec 2005
thanks aaffe but I cannot make it work