mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 99
M
MDA Offline OP
Babel fish
OP Offline
Babel fish
M
Joined: Dec 2002
Posts: 99
Greetings,

I have a timer set to open mIRC and a alias task set to access a website.

alias performtask {
url ]http://somesite.com[/url]
}

1) After performing that alias task, how do I automatically close that internet window/browser application?

2) Is there a mIRC command to minimize the browser window produced via the command url http://somesite.com when it is first activated?

Thanks to each for your time and consideration,

MDA

Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
There is no flag to open the external browser window minimised, nor a built in command for closing it again.


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
Killing a task is possible with coms:
qwerty's method with COM

Minimizing is something i havent seen around yet with COM but i doubt its not possible.


$maybe
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
/*

Usage:

/ie.navigate <url>
/ie.minimize
/ie.quit

Examples:

//ie.navigate www.mirc.com | ie.minimize
//ie.navigate www.winamp.com | .timer 1 5 ie.minimize | .timer 1 8 ie.quit

Note that you can use /ie.navigate <url> repeatedly once you've done it the first time. It will simply navigate to the new url specified. In other words, you don't need to /ie.quit if all you want to do is navigate to another page.

Note that once you have minimized the ie window, when navigating after that you don't have to call /ie.minimize anymore, it'll stay minimized until you manually maximize it or put it as active window.

This will always open an Internetexplorer window, even when your default browser is Mozilla firefox.

Just so you are clear on the matter, you can only use /ie.minimize and /ie.quit if you've previously opened a window with /ie.navigate. In other words, if you externally open a browser window, those commands will have no effect.

*/

Code:
alias ie.navigate {
  var %tmp = $$1, %open = .comopen ie internetexplorer.application
  if (!$com(ie)) %open
  elseif (!$com(ie,visible,2)) { .comclose ie | %open }
  if (!$com(ie).result) %tmp = $com(ie,visible,4,bool,true)
  %tmp = $com(ie,navigate,1,bstr*,$1)
}

alias ie.minimize {
  var %tmp = $$com(ie), %wsh = wsh $+ $ticks
  %tmp = $com(ie,locationname,3)
  .comopen %wsh wscript.shell
  %tmp = $com(%wsh,appactivate,1,bstr*,$com(ie).result)
  %tmp = $ticks + 200
  while ($ticks &lt; %tmp) !
  .comclose %wsh $com(%wsh,sendkeys,1,bstr*,% n)
}

alias ie.quit {
  if ($com(ie)) .comclose ie $com(ie,quit,1)
}


The ie.navigate alias is a bit ugly because if you would open a browser window with /ie.navigate, and then close it by clicking the "X" or pressing alt+f4, the object would remain open, but we would have lost control over it. This issue doesn't exist anymore now.

Btw does it really need to open an external browser window? Because you could have a browser window within your mIRC using nHTMLn


Gone.
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
i wondered how long it would take you :P


$maybe

Link Copied to Clipboard