mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 580
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
I want to be able to load a dialog without giving it focus...

on *:dialog:AdBanner:active:0:{ if ($appactive == $true) { window -a "Status Window" } }

I'm using this code at the moment, but is has a weird effect of maximizing/restoring the program if it's minimized. $appactive seems like it must have an incorrect value at times (with mIRC 6.16)...


NaquadaBomb
www.mirc-dll.com
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
I think if you're opening the dialog on the dektop (dialog -md ...) then that would probably make $appactive return $true.

Edit:
Actually it's wierd, if mIRC is NOT active when the dialog opens, $appactive (from dialog init event) returns $true, while if mIRC IS active when the dialog opens it returns $false. :tongue:

Last edited by Iori; 09/08/04 12:53 AM.
Joined: Nov 2003
Posts: 228
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Nov 2003
Posts: 228
$appactive should be returning false because mIRC no longer has focus, the dialog does. Also, using /window will change the active window in mIRC but it will not give mIRC focus. Use /showmirc instead.
Code:
dialog test {
  title "Test Dialog"
  size -1 -1 100 100
}
on *:DIALOG:test:init:0: {
  [color:green];the reason i'm using a timer here is because
  ;/showmirc won't be triggered otherwise.[/color]
  .timer 1 0 showmirc -s
}


/showmirc
Manipulates the display of the main mIRC window, where -n = minimize, -r = restore, -s = show, -t = tray, -x = maximize, -o = on top, -p = not on top, -m = minimize according to tray settings.

Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
/window -a will actually pull mIRC into focus if the window already exists.

Joined: Nov 2003
Posts: 228
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Nov 2003
Posts: 228
You're correct but it seems it has to be used with a /timer as well. /showmirc is still better in my opinion because you're not forcing the status window to have focus.

Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
/showmirc is better, I was just pointing out that /window -a would do that. You don't need a timer for it either, called from an event it has the same result.

Joined: Nov 2003
Posts: 228
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Nov 2003
Posts: 228
Not when I call it from a dialog event, unless I'm doing something wrong. Although, I don't see the error in:

Code:
dialog test {
  title "test"
  size -1 -1 100 100
}
on *:dialog:test:init:0: {
  window -a "status window"
}


Link Copied to Clipboard