mIRC Home    About    Download    Register    News    Help

Print Thread
Commands to Close a window/application needed #132860 15/10/05 03:22 AM
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

Re: Commands to Close a window/application needed #132861 15/10/05 06:07 AM
Joined: Jul 2003
Posts: 655
Om3n Offline
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
Re: Commands to Close a window/application needed #132862 15/10/05 08:59 AM
Joined: Apr 2004
Posts: 759
M
Mpdreamz Offline
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
Re: Commands to Close a window/application needed #132863 15/10/05 10:35 AM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
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.
Re: Commands to Close a window/application needed #132864 15/10/05 11:20 AM
Joined: Apr 2004
Posts: 759
M
Mpdreamz Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
i wondered how long it would take you :P


$maybe