mIRC Home    About    Download    Register    News    Help

Topic Options
#132860 - 15/10/05 04:22 AM Commands to Close a window/application needed
MDA Offline
Vogon poet

Registered: 18/12/02
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

Top
#132861 - 15/10/05 07:07 AM Re: Commands to Close a window/application needed
Om3n Offline
Fjord artisan

Registered: 06/07/03
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

Top
#132862 - 15/10/05 09:59 AM Re: Commands to Close a window/application needed
Mpdreamz Offline
Hoopy frood

Registered: 27/04/04
Posts: 759
Loc: Arnhem, The Netherlands
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

Top
#132863 - 15/10/05 11:35 AM Re: Commands to Close a window/application needed
FiberOPtics Offline
Hoopy frood

Registered: 05/02/04
Posts: 2019
Loc: Leuven, Belgium
/*

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.

Top
#132864 - 15/10/05 12:20 PM Re: Commands to Close a window/application needed
Mpdreamz Offline
Hoopy frood

Registered: 27/04/04
Posts: 759
Loc: Arnhem, The Netherlands
i wondered how long it would take you :P
_________________________
$maybe

Top